Startseite » Webanalytics » Google Consent Mode

What is Google Consent Mode?

Google Consent Mode is a new way for your website to measure conversions and get analytic insights while being fully compliant with GDPR when using services like Google Analytics, Google Tag Manager (GTM) and Google Ads.

In short, Google Consent Mode bridges the gap between privacy and data-driven advertising by ensuring that your website’s analytics and marketing can be executed seamlessly based on each user’s consent.

How does Google Consent Mode work?

Google Consent Mode is an API that allows your website to run all of Google’s services based on user consent, meaning your users’ consent status is the deciding factor in how Google’s tags and scripts behave on your website.

Google Consent Mode introduces two new tag settings that manage cookies for analytics and advertising purposes on your website.

  • analytics_storage
  • ad_storage

Both values can be either “granted” or “denied”.

analytics_storage function

With the “analytics_storage” tag setting, Google Consent Mode controls the behavior of statistics cookies on your website based on the consent status of your end users.

This means that the user’s consent status is now transmitted to Google via the Google Consent API. Now, if a user does not give consent, Google provides aggregated and non-identifying metrics. These are fantastic innovations, as now you can get data on the above tools even without consent. But you still act DSGVO compliant, because it is only a projection.

ad_storage function

With the “ad_storage” tag setting, Google Consent Mode controls the behavior of marketing cookies on your website based on the consent status of your end users.

Your website may display contextual advertising based on anonymous data instead of targeted advertising based on personal data.

Google Consent Mode allows your website to measure conversions for a specific campaign at an aggregate level, rather than at the level of individual users. This gives you insights into the performance of your performance marketing campaigns in a fully GDPR-compliant way, regardless of the consent of the respective users.

With which tools does Google Consent Mode work?

Google Consent Mode works with the following Google tags provided via gtag.js and “Web” containers in Google Tag Manager:

  • Google Ads
  • Floodlight
  • Google Analytics
  • Conversion Linker

How do I integrate Google Consent Mode?

It is important that you include the following code in the code before loading it Google Tag Manager. You can also read the whole thing in Google’s https :// guide. 

The important thing here is to ask yourself the following questions before integrating Google Consent Mode:

  1. Which Consent Management Tool do I have in use?
  2. Is there possibly a direct integration with Google Consent Mode? Cookiebit and One Trust are already fully integrated and you only need to load the Consent API, the rest is done by the respective tool.
  3. If you have another tool in use, you will need to adjust the Consent Update section accordingly.
  4. If you are not interested in Google Consent Mode, you don’t need to adjust anything – everything will continue to work as usual.
  5. It is also important to mention that the whole thing is relatively new and things can still change here. So please enjoy everything with caution and without guarantee.
// Include the following lines to define the gtag() function when
// calling this code prior to your gtag.js or Tag Manager snippet
.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

// Call the default command before gtag.js or Tag Manager runs to
// adjust how the tags operate when they run. Modify the defaults
// per your business requirements and prior consent granted/denied, e.g.:
('consent', 'default', {'ad_storage': 'denied'});

// Optionally turn on URL passthrough to pass ad click
// information in query parameters from page to page on your site
('set', 'url_passthrough', true);

<!-- Load gtag.js or Tag Manager as normal, e.g.: -->
<script async src="">
.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
('js', new Date());

('config', 'GA_MEASUREMENT_ID');
('config', 'AW_CONVERSION_ID');

// Call the update command when your consent status changes
// (e.g. after a visitor grants consent). Modify the updates per
// your business requirements and what consent is granted, e.g.:
('consent', 'update', {'ad_storage': 'granted'});


Helpful topics around web analytics