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.

  1. 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>
  2. 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).
  3. Keep Tag Manager as it is. Sadang sets the Consent Mode default and pushes IsConsentManagementPlatform and a consent_default_set event to the data layer.
  4. Let Google tags read the signals. Google tags adjust to ad_storage, analytics_storage, ad_user_data and ad_personalization without extra set-up.
  5. 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.
  6. Check it. Use Tag Manager's preview mode and the browser's dataLayer to 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.
Tag Manager

One consent choice, read by every tag on the page.