Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • When to use Didomi's GTM template?
  • How to enable and configure Didomi's GTM template?
  • Embedding the Didomi Web SDK from the GTM template
  • Preview
  • Submit
  • Debugging
  1. SDKs
  2. Web SDK
  3. Tags and vendors management
  4. Tags management
  5. Tag managers
  6. Google Tag Manager

Didomi's GTM template

PreviousConfigure the Didomi / GTM integrationNextTealium

Last updated 2 months ago

This section describes how to enable and configure Didomi's GTM custom template. The template is part of

There are a few reasons why you might want to make use of this template:

  • Enabling this template on your site automatically enables support.

  • Templates are a native way to integrate with GTM.

  • Any time a template is updated you will have the chance to automatically update it via the GTM console.

  • No custom events or triggers are needed to handle Google consent mode statuses. The template currently supports GCM statuses only (Google Ads and Google Analytics).

When to use Didomi's GTM template?

Do not use the GTM template if your notice uses any regulation other than GDPR.

If you need to enable for your site, the GTM template is the most performant way to do so.

How to enable and configure Didomi's GTM template?

Google Consent Mode is only supported with the GDPR regulation.

When using the template, please disable the Google Consent Mode integration in the console to prevent conflicts. Also remember to enable the GTM integration within the Didomi's console

In order to use this GTM template (Didomi CMP), you will need to create a new tag and associate the template with at least one trigger.

Creating a new tag

After accessing your Google Tag Manager account and select your workspace of choice.

  • Click the "New Tag" button as shown here,

Or navigate to the "Tags" tab, and click on the "New" button at the top right side of the tags table.

  • Use a relevant name for the new tag ("Didomi CMP" was used for this example) and hit the "Tag Configuration" card.

  • From that screen you should have access to all the templates in the Community Template Gallery, including the "Didomi CMP" one. Look for it and load it.

At this point, you should have access to the template UI

Associating a trigger to a tag

We want our tag to be fired on all pages and make sure that it is fired before any other tags. In order to achieve that,

  • Click on the "Triggering" card to choose a trigger so that the tag fires.

  • Select the "Consent Initialization" trigger.

  • Save the tag. This is where you will choose the default values for the consent mode parameters.

Embedding the Didomi Web SDK from the GTM template

The template's UI will give you the option of embedding the Didomi Web SDK from within the template:

While the template can embed the SDK directly on your website, we do not recommend this setup in production as it delays loading the Web SDK and subsequent tags that depend on it like advertising, analytics, etc. We are leaving the option available for testing purposes. Embedding the Didomi SDK through GTM will result in fewer consents being passed to vendors and a lower consent rate from their perspective.

We recommend embedding the Web SDK directly into the source code of your website for the best performance. By being directly in the source code of your website, the Didomi Web SDK can load faster and also ensures that IAB vendors can detect a CMP on the page as soon as possible.

When embedding the Didomi Web SDK directly in the code of your website, make sure that the "Embed the Didomi Web SDK" option on the template is disabled.

Embedding the Web SDK configuration

Once you have enabled the "Embed the Didomi Web SDK" option, the UI will change as follows.

A quick note on the fields,

  • Public API key: Required field. It must be a valid UUID value.

  • Notice ID: Optional field. Setting its value would be the equivalent to configuring "Manual Targeting" in the Didomi console. Leaving it blank would be the equivalent to "Domain Targeting" in the Didomi console.

  • Apply GDPR globally: Enable this option if you want GDPR to apply to all your users. This option must be checked if you are an EU-based company.

Preview

In order to test the tag on a website, you can make use of the "Preview" feature of the GTM platform. You can find a "Preview" button at the top right of the GTM navbar menu.

You will be prompted by the following screen where you can set up the URL of your website.

Clicking continue opens the "Tag Assistant" website. This assistant is a live tool that can help tremendously with debugging your tags and/or templates.

You can see that the tag being previewed is in fact being fired during the initial load of the site.

Submit

Once the testing/previewing process has been successful, you can "Submit" a tag to a website so that it goes live.

In this case, click on the "Submit" button at the top right of the GTM nav bar menu (to the right of the "Preview" button).

Debugging

You can check whether "hits" are being correctly transmitted to Google or not. To do so, go to the DevTools/Network tab, filter by "collect" and look for the gcs parameter (as shown in the image below).

You will find a value for the parameter (G111 in this case). It can be understood as follows:

  • G1: This initial value is always the same.

  • The following digit (0 or 1) refers to ad_storage.

  • The third number (0 or 1) refers to analytics_storage.

For both cases 0 means “denied” and 1 means “granted”.

In our case, G111 means that marketing and statistics cookies have both received consent.

If you're previewing and/or have submitted our GTM template to your site and the gcs parameter values don't match, please make sure to enable the following vendor IDs via the DIDOMI console: google, googleana-4TXnJigR

New tag - option 1
New tag - option 2
Didomi GTM template in the Community Gallery
Associating a trigger to the template

Enable IAB TCF support: Enable this option if the IAB TCF is enabled for your consent notice in the Didomi Console. See for more information.

This example uses https://sandbox.didomi.io/gtm.html
Didomi CMP Test is the name of the tag used in this example
https://support.didomi.io/iab-tcf
Google's Community Template Gallery.
Google Consent Mode
Google Consent Mode
Embedding Didomi's SDK via the GTM template