Publications / Analytics and marketing
Google Consent Mode v2 – what it is and how to set it up
Consent Mode v2 passes the visitor’s decision from the cookie banner to Google tags. We explain the four parameters, basic and advanced mode, and the gtag code to paste.

Latest posts
- Google merged the Google tag with Tag Manager – what it changes for cookie consent
- Advertising on Google or measuring traffic? Check whether you need a cookie banner
- How should a proper cookie banner work?
- How to prepare your website for consetgo – pre-installation checklist
- Cookies in an online shop – a practical checklist
Google Consent Mode is a way of telling Google tags (e.g. Google Analytics 4 and Google Ads) what the visitor consented to in the cookie banner. The tags adjust their behaviour to this information. Consent Mode itself does not display a banner or collect consent – it works with the banner you already have. Version 2 added two parameters related to ads. Below we describe the parameters, the two modes, Google’s requirements for traffic from the European Economic Area and sample code.
The four Consent Mode v2 parameters
Each parameter takes the value “granted” (consent) or “denied” (no consent). The descriptions below follow the definitions in the Google documentation.
| Parameter | What it covers |
|---|---|
| ad_storage | storage of data related to advertising, e.g. cookies in the browser or device identifiers in apps |
| analytics_storage | storage of data related to analytics, e.g. visit duration |
| ad_user_data | consent to sending user data to Google for online advertising purposes |
| ad_personalization | consent to personalised advertising (e.g. remarketing) |
The first two parameters concern storage on the device. The two new ones concern what Google may do with the data: whether it may use it for advertising and whether it may personalise ads. Google also describes three additional parameters: functionality_storage (e.g. language settings), personalization_storage (e.g. video recommendations) and security_storage (e.g. authentication and fraud prevention).
Basic mode and advanced mode
Google describes two ways of implementing Consent Mode. They differ in whether the Google tag loads before the visitor’s decision.
| Feature | Basic mode | Advanced mode |
|---|---|---|
| When the Google tag loads | only after consent | immediately when the page is opened |
| What reaches Google on refusal | nothing, not even the consent state | cookieless pings (including the consent state, a timestamp and the referring page address) |
| Modelling of missing data | in Google Ads, a general conversion model | an advertiser-specific model; in GA4, behavioural modelling once the thresholds are met |
Advanced mode gives Google more data for modelling, but it also sends requests to Google from people who did not consent. It is worth discussing the choice of mode with the person responsible for data protection in your company. Google states in its documentation that the website owner is responsible for collecting consent.
When Google requires Consent Mode v2
The requirement comes from Google’s EU user consent policy. According to Google Ads Help, it applies to advertisers who receive data from users in the European Economic Area (EEA) and want to use ad personalisation (including remarketing) and measurement through tags and SDKs that send data to Google. The same requirements cover Google Analytics data used in Google Ads, Search Ads 360 and Display & Video 360. Google states that since March 2024, for customers with EEA traffic who use the first version of Consent Mode, the ad_storage value is automatically copied to ad_user_data.
In short: if you run Google Ads campaigns, measure conversions or build remarketing lists from EEA traffic, Google expects the ad_user_data and ad_personalization signals. According to Google, without collected consent and passed signals, tags can no longer be used for ad personalisation and remarketing for this traffic.
Cookie laws apply regardless of Google’s requirements. Consent to storing analytics and advertising cookies must be collected even if the website does not use Google products. The obligation comes from Article 5(3) of the ePrivacy Directive and the national laws implementing it in each Member State (e.g. § 25 TDDDG in Germany). More on the ePrivacy Directive and Google Consent Mode v2 pages.
Sample code: default values and update
Consent Mode is set with the gtag('consent', …) command. The default values must reach the page before the Google tag code or the GTM container. Google warns that in the wrong order the default values will not work.
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'wait_for_update': 500
});
</script>
<!-- only below this: the Google tag code (gtag.js) or the GTM container -->The wait_for_update parameter gives the banner the specified number of milliseconds to pass on the decision before the tags send data. It is useful when the consent tool loads asynchronously. Default values can also be set for selected countries with the region parameter.
After the visitor’s decision, the banner calls an update, e.g. after a click on “Accept all”:
gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});With partial consent, e.g. to analytics only, analytics_storage gets “granted” and the three advertising parameters stay “denied”. On later visits, the banner should immediately set the previously saved choice. The full description of the command order is in the guide Set up consent mode on websites.
Additional settings: ads_data_redaction and url_passthrough
Google describes two settings that work together with Consent Mode. They are set with the gtag('set', …) command before the config commands.
- ads_data_redaction – when it is true and ad_storage is “denied”, Google Ads and Floodlight tags remove ad click identifiers from the data they send. With consent to ad_storage, the setting changes nothing.
- url_passthrough – when cookies are blocked, information about the ad click and the session can be passed in link URLs (e.g. the gclid, dclid, gclsrc, _gl and wbraid parameters).
gtag('set', 'ads_data_redaction', true);
gtag('set', 'url_passthrough', true);The most common implementation mistakes
- Default values after the Google tag. If gtag('consent', 'default', …) comes after gtag.js or the GTM container in the page code, the tags may start without consent information.
- “granted” by default. The default value for visitors from the EU should match the situation before the decision, i.e. no consent.
- No update on the next visit. The banner must read the saved choice and send an update on every page, including on later visits.
- Only the two parameters from the first version. For EEA traffic, Google then copies ad_storage to ad_user_data, but it does not fill in the ad_personalization parameter. Personalised ads and remarketing depend on it.
How to check that the signals work
- Open the website in a private browser window.
- In the developer tools (F12), go to the console and type dataLayer. The list should contain an entry with the command “consent”, “default” and the “denied” values, recorded before the Google tag entries.
- Accept a chosen category in the banner and type dataLayer again. A “consent”, “update” entry with the new values should appear.
How Consent Mode v2 works in consetgo
The consetgo consent module supports Google Consent Mode v2 without extra code. At the start of every page it inserts the “denied” default values – before the Google tags and before the GTM container. By default it works in advanced mode: the Google tags load straight away and send only cookieless signals before consent. The other scripts are blocked on the server, before the page reaches the browser, and load only after consent to their category. You enable basic mode in the module panel (Settings → Integrations). After the visitor’s decision, it updates the signals according to the categories they consented to:
| Category in the banner | Consent Mode parameters |
|---|---|
| Marketing | ad_storage, ad_user_data, ad_personalization |
| Analytics | analytics_storage |
| Functional | functionality_storage, personalization_storage |
| Necessary | security_storage (always granted) |
In addition, the module blocks Google tags on the server before the page reaches the browser. GA4, Google Ads and GTM load only after consent to their category. This matches basic mode as Google describes it: Google receives no data from people who refused. Google Tag Manager is a container by default – it loads after consent to analytics or marketing, and the tags inside it are blocked separately, according to their own category.
If your website already has gtag('consent', 'default', …) code added by hand or by another plugin, remove it after installing the module so that the default values come from one source. We have collected the other legal requirements a cookie banner must meet on the How consetgo meets these requirements page.
Questions and answers
Is Consent Mode v2 enough instead of a cookie banner?
No. Consent Mode only passes the consent state to Google. Consent has to be collected by a banner or another consent management tool, and the obligation to collect it comes from the cookie laws.
Do I have to add gtag consent code if I use consetgo?
No. The module itself inserts the default signals at the start of the page and updates them after the visitor’s decision. Your own code with default values could conflict with them.
What does the value denied mean?
That the visitor has not consented to the purpose in question. A Google tag that fires in this state does not store or read cookies related to that purpose.
Does Consent Mode apply only to Google Ads?
No. The signals are read by Google tags, including Google Analytics 4 and Google Ads. The analytics_storage parameter concerns analytics, and ad_storage, ad_user_data and ad_personalization concern ads.