Google Tag Manager
Sadang and Google Tag Manager
Today, Sadang runs as a script tag above your Tag Manager container and passes consent to it. A Community Template for the Tag Manager gallery is in development.
Set it up today.
- Set a default first. Sadang loads asynchronously and sends its own default once its settings have loaded, which can be after Tag Manager starts. Until the default moves to the very start of the script (in development), add Google's default consent snippet inline at the top of the
<head>, above everything else:<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'default', { ad_storage: 'denied', analytics_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied', functionality_storage: 'denied', personalization_storage: 'denied', security_storage: 'granted', wait_for_update: 500 }); </script> - Add the Sadang script next. Above the Google Tag Manager snippet, add the Sadang script with your site's configuration URL (see the installation guide).
- Keep Tag Manager as it is. Sadang sets the Consent Mode default and pushes
IsConsentManagementPlatformand aconsent_default_setevent to the data layer. - Let Google tags read the signals. Google tags adjust to
ad_storage,analytics_storage,ad_user_dataandad_personalizationwithout extra set-up. - Gate other tags. For non-Google tags, use Tag Manager's consent settings to require the consent type each tag needs - for example, a marketing pixel needs
ad_storage. - Check it. Use Tag Manager's preview mode and the browser's
dataLayerto confirm the default appears before your tags fire and the update appears after a choice. Test in a Chrome or Edge private window: Firefox private windows send Global Privacy Control, which Sadang treats as a refusal, so no banner appears. Our guide how to check what your site runs before consent walks through it.
The Community Template, in development.
Consent Initialization trigger
The template will fire on Tag Manager's Consent Initialization trigger, before every other tag.
Default and update through the template
It will set the default and update through Tag Manager's consent APIs, as Google asks of consent templates.
Region defaults in Tag Manager
Region defaults set in the template, so they can be managed alongside your tags.
Published in the gallery
We will publish it in the Tag Manager Community Template Gallery and link it here.
Questions
Is there a Sadang template in the Tag Manager gallery?
Not yet. A Community Template is in development. Until then, add the Sadang script to your page above the Tag Manager snippet.
Will my Google tags respect the visitor's choice?
Google tags read the Consent Mode signals Sadang sets. For other tags, use Tag Manager's consent settings to require the consent type they need.
Can I put the Sadang script inside a Custom HTML tag?
We do not recommend it: a Custom HTML tag runs after Tag Manager has started, which is too late for the default consent state.