Fix GA4 When gtag.js Loads but Sends No Hits

A loaded gtag.js file and a populated dataLayer do not prove that Google Analytics received an event. Start with Google’s exact wrapper and a correctly ordered config command, then verify the browser request.

Last updated: October 15, 2026.

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){ dataLayer.push(arguments); }
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX', { debug_mode: true });
</script>

Replace the placeholder with the web stream’s Measurement ID. Keep the wrapper exactly as shown: gtag() pushes its arguments object, while unrelated objects added to the data layer do not automatically become Google tag commands.

Verify the command before the report

Google’s gtag.js API reference requires the Google tag snippet above event commands and identifies the destination through the config target ID. Confirm that the ID in the script URL and the config command belongs to the intended GA4 web stream.

In browser developer tools, filter the Network panel for collect. Reload with extensions disabled if necessary. No request usually points to malformed initialization, consent state, content-security policy, an ad blocker, or a wrapper that never issued a valid command.

Inspect the first data-layer entries in the console, but do not mistake their presence for delivery. The queue can contain values that the loaded tag never recognizes as commands. Compare initialization against the unmodified snippet from the stream settings before debugging application events.

Use DebugView without leaving debug mode enabled

Google’s DebugView guidance accepts debug_mode: true on a config or event command. Remove that parameter after testing; setting it to false does not disable the mode according to the documentation.

If a collection request exists but DebugView remains empty, inspect consent values and verify that the browser is not sending to another property. Do not install both gtag.js and Google Tag Manager for the same configuration without a deliberate plan, because duplicate setups can distort results.

Continue with tracing JavaScript errors, running scripts after DOM readiness, and preventing duplicate form events.

Related Web Cheat Sheet guides

Sergey Kornilov

Sergey Kornilov