On this page
What this issue is
The Google tag (gtag.js) has two parts. The first is a script file loaded from googletagmanager.com/gtag/js?id=G-XXXXXXX. The second is a short inline script that sets up window.dataLayer, defines a gtag() function and calls gtag('js', new Date()) and gtag('config', 'G-XXXXXXX').
Why it costs you leads or sales
Without the config call, GA4 receives nothing from the page. Sessions, conversions and key events stop appearing. Reports look like traffic fell, and ad platforms that import GA4 conversions get no signal to optimise on.
- Page loadsVisitor arrives from an ad
- gtag.js file loadsLibrary downloaded
- gtag('config') callMissing from the page
- collect hitNever sent
- GA4 reportsNo sessions or conversions
The script loads, but the config call is missing, so no hit is ever sent.
Example: weekly sessions before and after the config call goes missing. Numbers are illustrative.
How to check if your site has it
Open the page and DevTools
Open a funnel page in Chrome, press F12 and go to the Network tab. Tick Preserve log.
Reload and filter
Reload the page and filter by
collect. A working GA4 setup sends a request togoogle-analytics.com/g/collectwithtid=G-XXXXXXX.Look for the script
Filter by
gtag/js. If you see that request but nocollectrequest, the library loaded without a config call.Inspect the source
View the page source and search for
gtag(. You should findgtag('config'with your measurement ID. If it is missing, or sits inside a script with a syntax error, that is the cause.Check the console
In the Console tab look for red errors that happen before the config line, such as
gtag is not defined.
How to fix it
Use the full Google tag snippet from GA4: Admin > Data streams > your web stream > View tag instructions > Install manually. Replace G-XXXXXXX with your own measurement ID.
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>Find where the tag is added
Check your theme header, a header and footer scripts plugin, or an analytics plugin. Look for the
gtag/jsline on its own.Paste the full snippet
Replace the partial code with the complete snippet above, or let a plugin such as Site Kit add it from your measurement ID, and remove the manual one so you do not double up.
Clear caches
Purge page, plugin and CDN caches so visitors get the new header.
Check the sales channel first
In Settings > Customer events and the Google & YouTube app, see whether GA4 is already connected there.
If you edited the theme
Go to Online Store > Themes > Edit code > theme.liquid. Make sure the full snippet sits inside
<head>, not just the script src line.
Use a Google tag
In GTM create a Google tag with your measurement ID (G-...) and a trigger of Initialization - All Pages or All Pages. GTM then makes the config call for you.
Remove hard-coded gtag.js
If the site also has a hard-coded gtag.js, remove it to avoid double page_views.
Preview and publish
Use Preview to confirm the tag fires, then publish the container.
Open custom code
Go to Site settings > Custom code > Head code.
Paste the full snippet
Add both script blocks, save and publish the site. Custom code only runs on the published site.
Add to funnel or website
In the funnel or website settings open the tracking code or custom code area for the head.
Paste and save
Paste the full snippet, save, and republish each funnel that needs tracking.
Use the built-in connection
In Marketing integrations, connect Google Analytics with your measurement ID. Wix adds the tag for you.
Or use custom code
Under Settings > Custom code, add the full snippet to the Head for all pages. Custom code needs a paid plan with a connected domain.
Use the built-in field
Go to Settings > Developer tools > External API keys (or Analytics integrations) and enter your measurement ID if available for your version.
Or code injection
Under Settings > Developer tools > Code injection > Header, paste the full snippet. Code injection needs a plan that supports it.
Edit your base template
Put the full snippet in the shared layout so every page gets it, high in
<head>.Check for script errors
Make sure no earlier script throws an error, and that a build step or CSP is not removing the inline block.
How to confirm it's fixed
- Reload the page with DevTools open: a
g/collectrequest appears with yourtid=G-.... - The request includes
en=page_view. - GA4 Admin > DebugView or Reports > Realtime shows your visit within a minute or two.
- The snippet appears once per page, not twice.
- Test a form or checkout page too, not just the home page.
Broken
- Only the gtag/js script src line is present
- No gtag('config') call
- No collect request in the Network tab
- GA4 Realtime stays empty
Fixed
- Script src plus the inline dataLayer, gtag, js and config lines
- collect request sent on page load
- page_view appears in Realtime
- Key events can be recorded
How to prevent it happening again
- Always copy the full tag from GA4 instead of retyping parts.
- Keep the tag in one place, such as the base template or one GTM container.
- Re-test tracking after theme changes, plugin updates and builder redesigns.
- Note who owns analytics code so clean-ups do not remove the inline block.
- Run a scheduled check that looks for the collect request, not just the script.
How FunnelGuard handles this
FunnelGuard detects this issue today. Its robot visitor runs your real journeys on a schedule and watches the tracking hits sent to GA4. If the page loads but no collect hit is sent, the check flags it.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. Alerts can go to email, Slack, Teams, WhatsApp, a webhook or PagerDuty. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why is my GA4 not collecting data even though gtag.js is installed?
Most often the page loads the gtag.js file but never runs gtag('config', 'G-XXXXXXX'). Without that call, no hit is sent. Add the full inline snippet after the script tag and check for a g/collect request in the Network tab.
What does gtag('config') do?
It tells the Google tag which GA4 property to send data to and starts sending the first page_view. It also applies settings for that measurement ID. Without it, the library is loaded but idle.
How do I know if the gtag config command is missing?
View the page source and search for gtag('config'. Then open DevTools > Network and filter by collect. If gtag/js loads but no g/collect request follows, the config call is missing or failing.
Do I need gtag('js', new Date()) as well?
Yes, the standard Google snippet includes it before the config call, and you should copy the whole snippet rather than parts. Along with the dataLayer and gtag() function lines, it is part of the official install code.
Can I fix this with Google Tag Manager instead?
Yes. Create a Google tag in GTM with your G-ID and fire it on Initialization or All Pages. GTM then handles the config call. Remove any hard-coded gtag.js so you do not get duplicate page_views.
Why does Realtime show nothing after I added the snippet?
Check that caches are cleared, the right measurement ID is used, and no ad blocker or consent banner is stopping hits during your test. Also confirm the snippet is on the published site, not only in a draft.
Can FunnelGuard tell me when GA4 stops sending hits?
Yes. FunnelGuard runs your journeys on a schedule and flags a page where no GA4 collect hit is sent. It re-checks from a second region and sends one alert with a screenshot and a likely cause.
Related issues
- TRK-001GA4 tag missing from a funnel pageFix guide
- TRK-002GA4 tag missing site-wide after a theme or builder changeFix guide
- TRK-003Wrong GA4 measurement ID (staging or another client's property)Fix guide
- TRK-006GA4 installed twice (gtag.js and GTM) causing double page_viewsFix guide
- TRK-007GA4 config fires after the conversion event (race on fast redirects)Fix guide
- TRK-009GA4 script blocked by Content Security PolicyFix guide