Skip to main content

Set Up Google Consent Mode v2

Time: 20 minutes Requires: ConsentForge installed, Google Tag Manager

Google Consent Mode v2 is required for Google Ads conversion modeling and GA4 behavioral modeling in the EU from March 2024.

Add this snippet before your GTM container tag and before ConsentForge:

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});
</script>

Step 2: Install ConsentForge via GTM template

  1. In GTM, go to Templates → Search Gallery → ConsentForge
  2. Add the template, create a new tag, set trigger: Consent Initialization - All Pages
  3. Enter your embed token

For each GA4 or Google Ads tag:

  1. Open the tag → Advanced Settings → Consent Settings
  2. Set: analytics_storage for GA4, ad_storage + ad_user_data for Ads

Step 4: Verify

  1. Open GTM Preview mode and visit your site
  2. Deny consent — confirm GA4 tag fires in "modeling mode"
  3. Accept consent — confirm GA4 fires normally
  4. In DevTools Console: window.dataLayer.filter(e => e[0] === 'consent') — should show default + update

See also: Google Consent Mode v2 docs