Skip to main content

How to leverage Google Consent Mode v2

Since version 32.1.0 of the CMP, we improved a lot the behavior of the Google Consent Mode v2 in order to be bulletproof regarding the Google requirements.


Consent mode lets you communicate your user's cookie consent status to Google. Tags adjust their behavior and respect user's choices. Consent mode receives your user's consent choices from your cookie banner or widget and dynamically adapts the behavior of Analytics, Ads, and third-party tags that create or read cookies.

When you enable consent mode, Google measurement products ensure that a visitor’s consent mode state is preserved across the pages they visit.

Basic consent mode
When you implement consent mode in its basic version, you prevent Google tags from loading until a user interacts with a consent banner. This setup transmits no data to Google prior to user interaction with the consent banner. When the user grants consent, Google tags load and execute the consent mode APIs. The tags send the consent states to Google in the following order:

  1. Send default consent states.
  2. Send updated consent states.

However, when the user doesn’t consent, no data is transferred to Google at all – not even the consent status. Google tags are completely blocked from firing. Consent mode's conversion modeling in Ads is then based on a general model.

Advanced consent mode
When you implement consent mode in its advanced version, Google tags load when a user opens the website or app. The tags load the consent mode API and do the following:

  • Set default consent states. By default, consent will be denied, unless you set your own defaults.
  • While consent is denied, the Google tags send cookieless pings.
  • Wait for user interaction with the banner and update consent states.
  • Only when a user grants consent to data collection, Google tags send the full measurement data. Learn more about tag behavior.

This implementation enables improved modeling compared to the Basic one as it provides an advertiser-specific model as opposed to a general model.

Find more information in the Google official documentation

caution

In order to leverage Google Consent Mode you need to at least have :

  • the Google Advertising Product vendor ( id 755 ) in your source / notice
  • and the IAB purposes 1, 3, 4, 7, 9 selected

Go to the backoffice in the Notices menu. Then click on the notice you use or you want to implement in your website.
Go to Advanced tab and switch on enableGCM

Activate enableGCM

Implementation using regular code

Now you can get the updated code in the Notice menu. Just click on the given notice.

Activate enableGCM

  1. Click on the copy button on the top right of the code window.
  2. Then past the code the highest possible just after the <head> tag

That's It ! Your website is now ready for Google Consent Mode v2

Implementation using Google Tag Manager

You can leverage AppConsent CMP using our last template from the GTM Gallery.

  1. Install the GTM template Sfbx Appconsent CMP Setup
  2. Copy/past your APP_KEY
  3. Click on enableGCM in the tag
  4. Then deploy.

For more information, see this page : Install Appconsent with Google Tag Manager

  1. Go to https://tagassistant.google.com/
  2. Click on Add Domain and fill your domain
  3. On your website, accept the CMP then return to tag assistant
  4. On the left side, click on the first message entry
  5. Now in the middle of the page, select the consent tab, you should have something like below :

GCM State after an ACCEPT_ALL

If you refuse / deny the CMP , you will get a full denied GCM state :

GCM State after an ACCEPT_ALL