Google Consent Mode v2
Google Consent Mode v2 lets Google tags adjust their behavior based on user consent — collecting aggregated, cookieless data even when full consent is not given. This protects your conversion reporting while staying GDPR-compliant.
What ConsentForge sends to Google
| Consent type | Maps to ConsentForge category |
|---|---|
analytics_storage | Analytics |
ad_storage | Marketing |
ad_user_data | Marketing |
ad_personalization | Marketing |
functionality_storage | Functional |
personalization_storage | Functional |
security_storage | Necessary (always granted) |
Setup with GTM (recommended)
See the Google Tag Manager setup guide for full instructions.
ConsentForge fires gtag('consent', 'update', {...}) automatically after the user makes a decision. You don't need to write any custom code.
Setup without GTM
If you're using gtag.js directly, ConsentForge will update consent mode automatically as long as gtag is available on window.
Set default consent state in your HTML (before ConsentForge loads):
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Default: deny everything until user decides
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});
</script>
ConsentForge then calls gtag('consent', 'update', {...}) with the user's actual choices.
Verifying Consent Mode
Open DevTools Console and run:
window.dataLayer.filter(e => e[0] === 'consent')
You should see the default and then the update event.