Skip to content
FunnelGuard

Fix guide by FunnelsGuard

gtag.js loaded but config never called: how to fix GA4

TRK-008High impactDetectedBy FunnelGuardPublished Updated
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.

Where the data stops
  1. Page loadsVisitor arrives from an ad
  2. gtag.js file loadsLibrary downloaded
  3. gtag('config') callMissing from the page
  4. collect hitNever sent
  5. GA4 reportsNo sessions or conversions

The script loads, but the config call is missing, so no hit is ever sent.

Sessions recorded in GA4 per weekExample numbers
Sessions recorded in GA4 per week (example)Week 1 (working): 2,400 sessions; Week 2 (working): 2,350 sessions; Week 3 (config removed): 0 sessions; Week 4 (config removed): 0 sessions09201,8402,4002,35000Week 1 (working)Week 2 (working)Week 3 (config remove…Week 4 (config remove…sessions

Example: weekly sessions before and after the config call goes missing. Numbers are illustrative.

How to check if your site has it

Check in your browser
  1. Open the page and DevTools

    Open a funnel page in Chrome, press F12 and go to the Network tab. Tick Preserve log.

  2. Reload and filter

    Reload the page and filter by collect. A working GA4 setup sends a request to google-analytics.com/g/collect with tid=G-XXXXXXX.

  3. Look for the script

    Filter by gtag/js. If you see that request but no collect request, the library loaded without a config call.

  4. Inspect the source

    View the page source and search for gtag(. You should find gtag('config' with your measurement ID. If it is missing, or sits inside a script with a syntax error, that is the cause.

  5. 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.

Complete Google tag snippet (place high in <head>)html
<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>
Add the missing config call by platform
  1. Find where the tag is added

    Check your theme header, a header and footer scripts plugin, or an analytics plugin. Look for the gtag/js line on its own.

  2. 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.

  3. Clear caches

    Purge page, plugin and CDN caches so visitors get the new header.

How to confirm it's fixed

Confirmation checks
  • Reload the page with DevTools open: a g/collect request appears with your tid=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.
Page head before and after

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

Prevention habits
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: no collect hit.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.