1. Help Center
  2. Consent Notices

Enable Google Consent Mode with Didomi

For advertisers, Google Consent Mode (GCM) serves as a link between data privacy and digital advertising by adjusting the behavior of Google tags to the consent status of your users. This way, you can obtain insights about campaign conversions and other data, always respecting user consent choices for ads cookies and analytics cookies, which will help you optimize and improve ad monetization. 

With Consent Mode, your Google tags will be able to determine whether or not a user has given cookie consent for advertising purposes:

- If a user consents, the measurement tools used will continue to run as usual.

- If a user does not consent, the relevant Google tags will adapt accordingly to not use ads cookies. Instead, other measurement processes will be used at a more aggregate level.

1- How does it work? 

Google Consent Mode introduces two new tag settings which manage cookies for advertising and analytics purposes for advertisers. This is done by using the global site tag (gtag.js) or Google Tag Manager. It works with the following products:

  • Google Ads
  • Floodlight
  • Google Analytics

Google Consent Mode will adjust the behavior of consent status, conversion and Google Analytics pings.

You can learn more about Google Consent Mode in their documentation.

2- Enable Google Consent Mode with Didomi

⚠️ Google Consent Mode will be enabled by default on all new notices. If you create a new notice and you do not want to use Google Consent Mode, you will need to disable it manually.


With Google Consent Mode, Didomi's consent notice sends information to Google about whether the user has given consent or not for Google Analytics and Google Ads cookies. Google's tags will dynamically adapt, only utilizing tools for the specified purposes when consent has been given by the user.

When consent for ad storage or analytics storage is denied, the associated Google measurement functions deployed via global site tags (gtag.js) or Google Tag Manager will adjust their behavior accordingly.


Google Consent Mode only works with gtag.js, so make sure you are using gtag.js and not other legacy tags such as ga.js, analytics.js or conversion.js. 

There are two options, please choose one of them:
1/ To configure Google Consent Mode, activate our integration in the step "INTEGRATIONS" of  the Didomi console and follow the steps described in our 📰 technical documentation

Didomi Compliance Console et 11 pages de plus - Personnel – Microsoft_ Edge 2021-07-01 at 2.36.09 PM

Activating Google Consent Mode will automatically select "Google Advertising Products" and our new "Google Analytics Products" vendor in the "VENDORS & PURPOSES"  section:

Didomi Compliance Console et 10 pages de plus - Personnel – Microsoft_ Edge 2021-07-01 at 2.34.47 PM

Your old Google Analytics vendor will still be selected and you will have to unselect it if don't need it anymore. Be sure to configure GA properly before unselecting it to avoid losing data. 

2/ Use our Google Tag Manager template
In this case, you wouldn't need the Google Consent Mode integration from Didomi.
The link and integration would be done through the template directly.
Please refer to our 📰 technical documentation or our 📰 Github repo to do so.

What to do about GA?

To make sure Didomi is able to send events to GA, you will have to make sure Didomi is ready before loading GA. To do so, you will have to change your current configuration and make sure that gtag.js is used.

1. In a tag manager

Before Google Consent Mode, you probably have conditioned Google Analytics to:

- Didomi being ready or the user modifying his consent choices

- Google Analytics having user consent

To make sure Google Consent Mode is working, you will have to remove these conditions and only use the didomi-ready event. 

You will not need any condition on your custom events anymore.

2. Outside a tag manager

In this case, you probably added some data attributes to your Google Analytics tag. For example: 

<script type="didomi/javascript" data-vendor="your-ga-vendor-sdk-id" src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>

For Google Consent Mode, you will have to remove the data-vendor data-attribute from your tag to load Google Analytics on every page whether the user consent is given or not. 

<script type="didomi/javascript" src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>