Set up Didomi to obtain user consent

To capture valuable insights while protecting user privacy, you need to collect consent from your website users. We recommend you use a Consent management platform (CMP) or work with your content management system (CMS) to collect consent and send it to Google. 

Step 1: Set up a consent banner

  1. Work with Didomi to sign up for and get access to their platform.
  2. Configure your banner using the 'Consent Notice Getting Started' wizard.
  3. Make sure your banner complies with the requirements in the Google EU user consent policy (EUUCP).

For additional information on banner setup, review the Didomi Help Centre.

Step 2: Set up consent mode

Set up using Google Tag Manager

  1. Open Google Tag Manager and navigate to your container.
  2. In 'Tags', click New and name your tag.
  3. Click Tag Configuration, then click Discover more tag types in the Community Template Gallery. From the gallery, search for 'Didomi', then install 'Didomi CMP by Didomi'.
  4. From the Didomi UI, click 'My Organisation' at the top of the page, then click Copy Public API Key.
  5. Tick the box labelled 'Embed the Didomi Web SDK' in Google Tag Manager and paste the API key from the above step into the box labelled 'Public API key'.
  6. Configure the default settings that you would like to use under the 'Set Google Consent Mode default status' section. Use comma-separated ISO 3166-2 country codes in the Region box if you customise defaults by region.
  7. Click Add, then click Triggering.
  8. Select 'Consent Initialisation – All Pages', then click Save.
  9. Click Preview in the top right-hand corner to test your container. View instructions for testing below.
  10. Publish your container.

Set up using another platform or directly from your website’s code

  1. From your Didomi account, open your Consent Notice for editing (Consent Notices, then click on the pencil next to the correct row).
  2. Go to the Publish tab and copy the code from the third section down titled 'Paste the Didomi SDK code'.
  3. If you use a website builder, review their documentation to learn how to implement code in the <head> tag of each page. Otherwise, continue to step 4.
  4. In the <head> tag of each page (review the instructions above if you use a website builder), paste the following code followed by the CMP script that you copied earlier at the very top of the <head> tag. Note that this is critical in order to ensure that the CMP functions properly.

<script>

// Define dataLayer and the gtag function.

window.dataLayer = window.dataLayer || [];

function gtag(){dataLayer.push(arguments);}

 

// Set default consent for specific regions according to your requirements

gtag('consent', 'default', {

  'ad_storage': 'denied',

  'ad_user_data': 'denied',

  'ad_personalization': 'denied',

  'analytics_storage': 'denied',

 'regions':[<list of ISO 3166-2 region codes>]

});

// Set default consent for all other regions according to your requirements

gtag('consent', 'default', {

  'ad_storage': 'denied',

  'ad_user_data': 'denied',

  'ad_personalization': 'denied',

  'analytics_storage': 'denied'

});

 

</script>

<!--Banner script here!-->

Testing using Tag Assistant

Learn more about how to Troubleshoot consent mode with Google Tag Manager.

Was this helpful?

How can we improve it?
true
Achieve your advertising goals today!

Attend our Performance Max Masterclass, a livestream workshop session bringing together industry and Google ads PMax experts.

Register now

Search
Clear search
Close search
Google apps
Main menu
16844244473695530419
true
Search Help Centre
true
true
true
true
true
73067
false
false
false