🍪 Google Consent Mode v2: How to Set It Up for Europe and the USA Without Losing Analytics
Cookie consent is no longer just a checkbox in a banner. For ads and analytics it has become a technical signal: the browser tells Google what may be stored and what may not. If that signal is missing, in Europe you risk breaking the law and losing accurate data, and in the USA you may mishandle the "opt-out" choices of residents of certain states. Below — how Consent Mode v2 works, how Europe and the USA differ, and how to set it up in GTM and GA4 with code examples.
📄 Contents
- What Consent Mode v2 is and how it works
- Why you need it: law and data retention
- Consent signals: what is actually passed
- Basic and advanced modes
- Europe: regions and countries
- USA: federal level and states
- Code examples: default and update
- Setting up Google Tag Manager
- Setting up GA4 and Google Ads
- Verification and common mistakes
- Already built into BooStore
- Frequently asked questions
🧩 1. What Consent Mode v2 is and how it works
Consent Mode is a mode in which Google tags (Analytics, Google Ads, Floodlight and tags in Tag Manager) respect the user's choice about cookies and data sharing. Technically it is two calls before and after the choice:
denied.How it works
Key parameters that make the mode work correctly:
wait_for_update— how many milliseconds to wait for the user's choice before sending tags;url_passthrough— passes transition parameters between pages without cookies (useful when analytics is declined);ads_data_redaction— hides advertising identifiers whenad_storageis denied.
🎯 2. Why you need it: law and data retention
Consent Mode has two jobs, and both matter equally.
⚖️ Legal
Show the regulator and the user that non-essential cookies and data sharing are enabled only after consent, and that a refusal is respected.
📉 No measurement loss
On refusal, tags don't go completely blind: Google can use modeling and anonymized signals so conversion estimates stay realistic.
📊 Honest analytics
You see the difference between "no data" and "data limited by consent" instead of losing reports entirely.
🎯 Working ads
Google Ads receives ad_user_data and ad_personalization signals and correctly limits personalization on refusal.
If you simply "don't load anything without consent", you lose both data and optimization. If you load everything indiscriminately, you break the rules. Consent Mode is the compromise: the law is respected and measurements are preserved where possible.
📶 3. Consent signals: what is actually passed
Consent Mode v2 uses four main signals. They are the most commonly checked during audits and they determine how ads and analytics behave.
Four key v2 signals
ad_storageAllows cookies and local storage for advertising (Google Ads, Floodlight).
analytics_storageAllows cookies for analytics, such as Google Analytics.
ad_user_dataAllows sending user data to Google for advertising purposes.
ad_personalizationAllows personalized advertising and remarketing.
| Signal | What it controls | If denied |
|---|---|---|
ad_storage | Advertising cookies and identifiers | Ad cookies are not set, identifiers are not used |
analytics_storage | Analytics cookies | Analytics cookies are not set |
ad_user_data | Sending user data to Google for advertising | Data is not sent for advertising purposes |
ad_personalization | Ad personalization and remarketing | Non-personalized ads are shown |
Optionally, functionality_storage, personalization_storage and security_storage may be used. Things strictly necessary for the site to work are usually allowed; the rest is consent-based.
Important: ad_user_data and ad_personalization appeared in v2. Old setups with only ad_storage and analytics_storage are no longer sufficient for advertising in the EEA.
⚙️ 4. Basic and advanced modes
| Parameter | Basic mode | Advanced mode |
|---|---|---|
| Tags before consent | Do not load | Load in a restricted mode |
| Cookieless signals | None | Yes (anonymized pings) |
| Conversion modeling | Limited or unavailable | Available with enough data |
| Setup complexity | Simpler | Higher: requires correct default and update |
| When it fits | Small site, minimal measurement | Store with ads and a need to estimate conversions |
For an online store with advertising you usually need advanced mode: it preserves conversion estimates when some users decline cookies. But it requires careful implementation — otherwise the data becomes unreliable.
🇪🇺 5. Europe: regions and countries
In Europe the base model is prior informed consent (opt-in) for non-essential cookies and trackers. Before consent, analytics and advertising cookies must not be set, and Consent Mode must start in denied. Below is a guide to the key jurisdictions.
| Region / country | Laws and regulator | Model | Notes |
|---|---|---|---|
| EU / EEA (27 countries) | GDPR + ePrivacy (Directive 2002/58/EC), EDPB and national regulators | opt-in | Consent before non-essential cookies; strictly necessary — without consent; refusal must be as easy as consent |
| United Kingdom | UK GDPR + PECR, ICO | opt-in | Similar to the EU; separate PECR rules for cookies and electronic communications |
| Switzerland | revFADP (nFADP) + TCA, FDPIC | opt-in for non-essential | Its own privacy regime; for ads and analytics it's better to ask for consent |
| Germany | GDPR + TDDDG (formerly TTDSG), BfDI and state regulators | opt-in | Strict requirements for cookie banners and equal buttons |
| France | GDPR + Loi Informatique et Libertés, CNIL | opt-in | CNIL regulates cookies and trackers in detail; refusal must be simple |
| Spain | GDPR + LSSI, AEPD | opt-in | Requirements for information and explicit consent |
| Italy | GDPR + Codice Privacy, Garante | opt-in | Strict requirements for banners and analytics |
| Netherlands | GDPR + Telecommunicatiewet, AP | opt-in | Analytics without consent is allowed only in limited cases |
| Poland | GDPR + PKE (Prawo komunikacji elektronicznej), UODO | opt-in | Consent for non-essential cookies and trackers |
| Ireland | GDPR + ePrivacy Regulations, DPC | opt-in | DPC is the lead regulator for many IT companies |
opt-in — consent before non-essential cookies; opt-out — request-based opt-out of sale/sharing.
denied by default for the whole region, show a banner with equal "Accept" and "Decline" buttons, and send update after the choice. Strictly necessary cookies don't require consent, but their list must truly be necessary.
A regional default can be set separately — for example, for EEA countries, the UK and Switzerland — without affecting the rest of the world. This is done with the region parameter (see code examples below).
🇺🇸 6. USA: federal level and states
The USA has no single federal privacy law like the GDPR. Instead, individual state laws apply, and the models differ: more often it is opt-out (users can opt out of the sale/sharing of data), less often opt-in for sensitive data or minors.
For Consent Mode this means: the signals ad_storage, analytics_storage, ad_user_data and ad_personalization must be switchable based on the user's choice, and for some states you must account for "Global Privacy Control" and restrictions on selling data.
| State | Law | Effective | Model | Notes |
|---|---|---|---|---|
| California | CCPA / CPRA | 2020 / 2023 | opt-out | CPPA; right to opt out of sale/sharing, GPC, opt-in for minors |
| Virginia | CDPA | 2023 | opt-out | One of the first "second wave" laws |
| Colorado | CPA | 2023 | opt-out | Universal opt-out, GPC support |
| Connecticut | CTDPA | 2023 | opt-out | Transparency and opt-out requirements |
| Utah | UCPA | 2023 | opt-out | Lighter regime than California |
| Texas | TDPSA | 2024 | opt-out | Broad business scope |
| Oregon | OCPA | 2024 | opt-out | Universal opt-out |
| Montana | Montana Consumer Data Privacy Act | 2024 | opt-out | Separate rules for sensitive data |
| Delaware | DPDPA | 2025 | opt-out | Consent requirements for sensitive data |
| Iowa | ICDPA | 2025 | opt-out | Limited set of rights |
| Nebraska | NDPA | 2025 | opt-out | — |
| New Hampshire | NHPA | 2025 | opt-out | — |
| New Jersey | NJDPA | 2025 | opt-out | — |
| Kentucky | KCDPA | 2025 | opt-out | — |
| Maryland | MODPA | 2025 | opt-out | Stricter restrictions on data sales |
| Minnesota | MCDPA | 2025 | opt-out | Universal opt-out |
| Rhode Island | RIDTPA | 2026 | opt-out | — |
| Indiana | INCDPA | 2026 | opt-out | — |
| Tennessee | TIPA | 2025 | opt-out | — |
opt-in — consent before non-essential cookies; opt-out — request-based opt-out of sale/sharing.
Google supports passing Consent Mode signals for the USA, including states with privacy laws. Check the current list and guidance in Google's official help and with a qualified lawyer.
💻 7. Code examples: default and update
The main rule: default must be placed before gtag.js and GTM load. Otherwise tags will load without consent.
Step 1. Default before tags load
Place in <head> before the main Google code:
<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',
functionality_storage: 'denied',
personalization_storage: 'denied',
security_storage: 'granted',
wait_for_update: 500
});
gtag('set', 'ads_data_redaction', true);
gtag('set', 'url_passthrough', true);
</script>
Regional default (EEA, UK, Switzerland only)
gtag('consent', 'default', {
region: ['ES','DE','FR','IT','PL','NL','IE','GB','CH'],
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});
Step 2. Update after the user's choice
<script>
function grantConsent(){
gtag('consent', 'update', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
});
}
function denyConsent(){
gtag('consent', 'update', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied'
});
}
</script>
Call grantConsent() or denyConsent() from your banner button handlers. If the user has already made a choice earlier (stored in a cookie), send update right at page load without waiting for another click.
This is how a banner with equal buttons looks
🏷️ 8. Setting up Google Tag Manager
In GTM, Consent Mode is configured at the tag and container level. Steps:
gtag('consent','default',...) code in <head> above the GTM snippet. This way the container receives the initial denied state.ad_storage, ad_user_data, ad_personalization, analytics_storage. The tag won't fire until the required consent is given.update, you can create a Custom HTML tag that calls gtag('consent','update',...) on the choice event.Updating consent with a GTM tag
<script>
gtag('consent', 'update', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
});
dataLayer.push({ event: 'consent_update' });
</script>
📊 9. Setting up GA4 and Google Ads
Google Analytics 4
gtag/GTM. You don't need to duplicate update separately if it is sent correctly.Google Ads
- Link Google Ads to GA4 and make sure conversions are passed with consent in mind;
- In Google Ads measurement settings, check the Consent Mode status;
- For US states where applicable, use Restricted Data Processing;
- Verify that with
ad_personalization = deniedremarketing and personalization are actually limited.
✅ 10. Verification and common mistakes
- Default before tags. If
gtag.jsor GTM loaded before default, the mode won't work correctly. - Not just analytics. Advertising needs all four signals, including
ad_user_dataandad_personalization. - Update after the choice. Banner buttons must actually change the state, not just close the window.
- Stored choice. On a repeat visit, send
updateimmediately so you don't wait for a click. - Single source. Don't duplicate GTM loading and don't send conflicting
defaultcalls from different places. - Test refusal. Test the "Decline" scenario separately, not only "Accept".
- Region. For the EEA, UK and Switzerland use
deniedby default; for other regions it depends on your policy and the law.
Check results in Tag Assistant, GA4 DebugView and Google Ads reports. Look not only at "did the tag fire" but also at which consent signals it received.
🚀 11. Already built into BooStore
In BooStore you don't need to assemble consent mode manually from separate scripts: it's implemented at the platform level. Just enable it in the "Statistics" settings — and it works for both Google Analytics and Google Tag Manager.
How the built-in implementation works:
- before GTM loads, Consent Mode default = denied is set, and if the cookie was already accepted — update = granted is sent immediately (before
gtm.js); - the consent script loads once with both IDs (GA and GTM), a second call is skipped — there is no double container load;
- on "Accept" or "Decline" a standard consent update is sent immediately for
ad_storage,analytics_storage,ad_user_data,ad_personalization; - the GTM container is not reloaded — only the container from the site header remains;
- for Analytics, consent update and config are preserved on acceptance.
The logic of the built-in consent script (files currentsite_header_java.php and hotengine-script-cookie-confirm.php) is built on exactly this scheme: first the safe denied state, then a single user-choice handler that updates all four signals and doesn't reload tags.
❓ Frequently asked questions
What is Consent Mode v2 in simple terms?
Which signals are required for advertising?
ad_storage, ad_user_data and ad_personalization. Analytics needs analytics_storage. In v2 the last two advertising signals became mandatory, and they are often forgotten.How do Europe and the USA differ on consent?
Do I need Consent Mode if I don't show ads?
What happens if I set default granted?
How do I set up Consent Mode in GTM?
gtag('consent','default',...) before the container, then in Consent Overview and each tag's Consent Settings add the required consent checks. Send update after the user's choice. Verify in Preview Mode and Tag Assistant.How do I set up Consent Mode in GA4?
What are wait_for_update, url_passthrough and ads_data_redaction?
wait_for_update allows time for the user's choice, url_passthrough passes parameters between pages without cookies, and ads_data_redaction hides advertising identifiers when ad_storage is denied.