Free, independent guides since 2010

Analytics & data

Consent Mode and analytics: how it works

What Google Consent Mode v2 does, basic versus advanced implementation, how it relates to your cookie banner, modelled data, and what it means for EU website owners.

<guide section="Analytics & data" type="article" read="1 min"/>

When a visitor rejects analytics cookies, your Google tags need to know – and behave accordingly. That is what Consent Mode does. It works together with your cookie consent banner.

SignalControls
analytics_storageAnalytics cookies
ad_storageAdvertising cookies
ad_user_dataSending user data to Google for advertising
ad_personalizationPersonalised advertising (remarketing)

Basic and advanced

  • Basic: Google tags only load after the visitor consents. No data without consent.
  • Advanced: tags load with denied defaults and send cookie-less pings; Google models missing conversions.

Implementation outline

JavaScript
// Before any Google tag: set defaults to denied
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('consent', 'default', {
  analytics_storage: 'denied', ad_storage: 'denied',
  ad_user_data: 'denied', ad_personalization: 'denied'
});
// When the visitor accepts analytics in your banner:
gtag('consent', 'update', { analytics_storage: 'granted' });

Many consent platforms set these signals automatically.

What to check

  • The banner offers a real reject option.
  • No tracking requests before a choice (inspect the Network tab).
  • Choices are remembered and can be changed.
  • Your privacy statement explains what happens in each case.

Frequently asked questions

Basic or advanced Consent Mode?

Basic is the most privacy-friendly: nothing is sent to Google without consent. Advanced sends cookie-less pings that Google uses for modelling; whether that is acceptable depends on legal advice and your national authority’s view.

Do I need Consent Mode if I do not use Google tools?

No. It only concerns Google tags such as Google Analytics and Google Ads.