Prerequisites
Before configuring GTM, ensure you have:
- A compatible CMP (Consent Management Platform) — Google-certified CMPs include Cookiebot, OneTrust, Usercentrics, Complianz, and others listed in Google's CMP partner program
- The CMP integrated with your website and collecting consent before the GTM snippet fires
- Access to your GTM container
Step 1: Add the Consent Initialization Tag
The consent default state must be set BEFORE any Google tags can fire. Create a new tag in GTM:
- Tag Type: Consent Initialization — All Pages (custom HTML or use Google's "Consent Overview" tag)
- Fire on: Consent Initialization trigger (a special GTM trigger that fires before all other tags)
This tag sets the default consent state to "denied" for all four consent types, signalling to Google tags that they should operate in restricted mode until consent is granted:
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});
Step 2: Install Your CMP's GTM Tag
Your CMP provider supplies a GTM tag template (available in the GTM Tag Templates gallery or as a Custom HTML tag). This tag:
- Loads the CMP's cookie banner JavaScript
- Reads the user's consent choice (from a cookie if they have already chosen)
- Updates consent state via
gtag('consent', 'update', ...)when the user makes a choice
The CMP tag must fire on the Consent Initialization trigger (same as the default tag) so consent is updated before Google tags execute.
Step 3: Verify Consent Signal Forwarding
After installing both tags, verify in GTM Preview Mode:
- Open Preview Mode and browse to your website
- In the timeline, look for the "Consent Initialization" event
- Click it → Tags → Tags Fired should show your consent default tag and CMP tag
- Click your CMP tag → check the output — if the user has previously consented, the consent update should have fired (showing 'granted' states)
Step 4: Configure GA4 and Google Ads Tags
Your GA4 Configuration tag and Google Ads tags do NOT need modification — they automatically respect the consent signals set by Consent Mode. However, verify in GTM Preview:
- With consent denied: GA4 Configuration tag should fire but use cookieless mode (no client_id cookie set)
- With consent granted: GA4 Configuration tag fires normally with full cookie functionality
Step 5: Enable Consent Mode in GA4 and Google Ads
Consent Mode functionality is automatic once signals are flowing. However, confirm in:
- GA4 Admin → Data Streams → your stream → Configure Tag Settings → should show "Consent mode is active"
- Google Ads → Admin → Consent settings → should show consent mode is receiving signals
Summary
The GTM Consent Mode v2 setup requires: (1) consent default tag firing on Consent Initialization trigger setting all types to 'denied', (2) CMP tag on the same trigger updating consent to 'granted' for categories the user accepts, (3) GA4 and Google Ads tags respecting signals automatically. The order is critical — defaults must be set before Google tags fire.
See our Consent Mode v2 Implementation service for professional setup.
Need Consent Mode v2 configured in GTM? Contact Adslytics.
Need expert tracking setup?
Our Google Tag Manager experts have delivered 500+ tracking setups with a 98% success rate.
Get a Free Consultation →