Guides
Google Analytics 4 and Tag Manager
Use Google Analytics 4 and Google Tag Manager with Consentful so they respect cookie consent and Google Consent Mode v2.
Updated · By Mihir Vaghani, founder of The Plugins Company
Google Analytics 4 (gtag.js)
Easiest: on the Scripts tab, add https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX in the Analytics category, plus a second inline script in the same category:
Then remove any GA snippet from your site's code. GA4 now loads only after the visitor allows analytics.
Google Tag Manager
Keep your GTM container on the page as usual — Consentful sets Consent Mode v2 defaults to denied before it loads, and sends an update when the visitor chooses. Inside GTM:
- Open Admin → Container settings and turn on Enable consent overview.
- For each Google tag, the built-in consent checks already apply.
- For non-Google tags (Meta, Hotjar…), set Additional consent checks to require
ad_storageoranalytics_storage— or move those tags into Consentful's Scripts tab instead.
Make sure Consentful loads before GTM in the page head. The platform apps place it first automatically.
Sources
- Google Tag Platform: Set up consent mode
