Skip to main content

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 typeMaps to ConsentForge category
analytics_storageAnalytics
ad_storageMarketing
ad_user_dataMarketing
ad_personalizationMarketing
functionality_storageFunctional
personalization_storageFunctional
security_storageNecessary (always granted)

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.

Open DevTools Console and run:

window.dataLayer.filter(e => e[0] === 'consent')

You should see the default and then the update event.