Google Consent Mode V2

1) Configure your banner

Use the wizard at to configure your banner. Be sure your banner complies with the requirements in the Google EU User Consent Policy (EUUCP). For more details, see the Sirdata documentation.

2) Add the banner to your site

Using Google Tag Manager

  1. Open Google Tag Manager and navigate to your container

  2. In Tags, click New

  3. Name the tag

  4. Click Tag Configuration

  5. Click “Discover more tag types in the Community Template Gallery”

  6. Search for Sirdata and install Sirdata CMP | Google Consent Mode by SirDataFR

  7. In the Sirdata UI, choose Retrieve Code. From the code, get the partner ID and configuration ID as shown:
  1. Configure the default settings you would like to use for any regions / countries where you require consent to be denied by default, keeping in mind Google’s EUUCP (see above)

  2. Check the box next to “Load Sirdata CMP script?” and paste the IDs you gathered in step 7.

  3. Click Add

  4. Click Triggering

  5. Select Consent Initialization - All Pages

  6. Click Save

  7. Test your container by clicking Preview in the top right corner (see instructions for testing below)

  8. Publish your container.

Using Other Platforms or Directly Editing Website Code

  1. In the Sirdata UI, choose Retrieve Code. Copy the first code snippet to your clipboard.

  2. If you use a website builder, review their documentation to find out how to implement code in the “head tag” of each page. Otherwise, skip to step two.

  3. In the head tag of each page (see step 2 if you use a website builder), paste the following code followed by the CMP script you copied in step 2 at the very top of the head tag. Note that this is critical in order to ensure the CMP functions properly.

// 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'

<!--Banner script here!-->

Testing using Tag Assistant

See here for details:

Last updated