Google Analytics 4
Opinionated path: GA4 + Consent Mode v2, CMP first, tags gated in GTM or equivalent.
Prerequisites
- Quickstart completed (or the same
window.INTA+uc.jsorder in GTM). settings.gtagIdset to your GA4 measurement ID (G-XXXXXXXX) when using automatic Google coordination from the CMP.- Read Google Consent Mode once—defaults matter.
Recommended: GA4 via Google Tag Manager
- Implement the CMP using Google Tag Manager on Consent Initialization.
- Add a Google tag or GA4 Configuration tag that respects consent in the tag’s consent settings (align with your legal default for each consent type).
- Do not fire GA4 on a naked “All Pages” trigger if that implies full analytics cookies before the CMP runs—use consent-aware configuration.
Inline gtag (no GTM)
If you load gtag.js directly:
- Still place
window.INTA+uc.jsfirst in<head>. - Load GA after the CMP snippet, or ensure Consent Mode is set before hits you care about.
Duplicate GA loaders (GTM + hard-coded gtag) are a common source of double hits and wrong consent state—pick one primary path.
Verify
- GTM Preview or GA DebugView: before accept, analytics should not behave as fully consented unless you deliberately configured defaults that way.
- After Accept, you should see normal collection (subject to ad blockers, etc.).
Related
Last updated