GTM and GA4: The Definitive Configuration Guide for 2026
Google Tag Manager is the standard deployment mechanism for GA4, but a poorly structured GTM container creates maintenance nightmares, duplicate events, and data quality problems that are difficult to diagnose. Here's how to structure it correctly from the start.
The Configuration tag: one and only one
Your GTM container should have exactly one GA4 Configuration tag. This tag loads the GA4 script and sends the initial page_view.
It fires on "All Pages" with a trigger priority that ensures it loads before any event tags.
Having more than one Configuration tag, a common mistake when migrating from an older setup, causes duplicate page_views and session counting errors.
Set the Configuration tag to send a page_view on load (the default) unless your site is a Single Page Application, in which case you'll need a custom trigger that fires on each virtual page navigation rather than on every DOM ready event.
Event tags and the dataLayer pattern
For custom events (add_to_cart, purchase, form_submit, etc. ), use a pattern where your website pushes events to the dataLayer, and GTM listens for those events to fire GA4 tags.
This separates tracking logic from implementation and makes auditing easier, you can inspect the dataLayer in any browser console without needing GTM preview mode.
Use a consistent dataLayer schema: event name in snake_case, e commerce data in the items array following the GA4 specification.
Inconsistent naming is the most common source of data quality problems, "addToCart" in one place and "add_to_cart" in another creates two separate events in GA4 that should be one.
Enhanced measurement and duplicate events
GA4's enhanced measurement (scroll, outbound clicks, site search, video engagement, file downloads) runs client side. If you're also tracking these events manually via GTM, you'll get duplicate events.
The fix: either disable enhanced measurement for events you're tracking via GTM, or remove the manual GTM tags for events that enhanced measurement covers adequately.
Scroll tracking is the most common duplication point, enhanced measurement fires at 90% scroll depth by default, while many custom setups fire at multiple thresholds.
Decide which approach serves your analysis, implement one, and disable the other. A GA4 audit will detect scroll event duplication and flag it as a data quality issue.
Consent mode integration in GTM
In GTM, set up consent mode with a Consent Initialization trigger for the default consent state tag, which must fire before any GA4 tags.
Use the built in Consent Overview feature (Container Settings → Consent Overview) to verify that all GA4 tags have the correct consent type assignments.
GA4 Configuration tags need "analytics_storage" consent type; Google Ads tags need "ad_storage".
Ready to audit your GA4 property?
Run a full GA4 audit in under 10 minutes. Free to start.
Start Free Audit