Set up Sirdata 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. Sign up for a Sirdata account.
  2. Configure the banner using the Sirdata wizard.
  3. Make sure your banner complies with the requirements in the Google EU User Consent Policy (EUUCP) and that you choose to enable Google Consent Mode.

For more details, review the Sirdata documentation.

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.
  4. From the gallery, search for “Sirdata”, then install “Sirdata CMP | Google Consent Mode by SirDataFR”.
  5. In your Sirdata account, click Retrieve Code. From the code, find the partner ID (first bolded section) and configuration ID (second bolded section) as shown:
https://cache.consentframework.com/js/pa/34693/c/h602L/stub 
  1. Configure the default settings you’d like to use for any regions or countries where you require consent to be denied by default, keeping in mind Google’s EUUCP.
  2. Check the box next to “Load Sirdata CMP script?” and paste the IDs you gathered in step 5.
  3. Click Add, then click Triggering.
  4. Select Consent Initialization - All Pages, then click Save.
  5. Click Preview in the top right corner to test your container. View instructions for testing below.
  6. Publish your container.

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

  1. From your Sirdata account, choose Retrieve Code. Copy the first code snippet to your clipboard.
  2. 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 you copied earlier at the very top of the <head> tag. Note that this step is critical in order to ensure 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
Search
Clear search
Close search
Google apps
Main menu
1309388894502059797
true
Search Help Center
true
true
true
true
true
102259
false
false