Skip to content
Tools · Consent Mode v2

Ship the consent banner the legal team will sign off on.

A jurisdiction-aware Consent Mode v2 scaffold — all seven Google signals, an accessible banner, a GTM variable + trigger template, and per-vendor wiring for Meta Pixel, TikTok, LinkedIn, Pinterest, Klaviyo, and Hotjar. Every signal name and default follows Google's documentation. The legal copy is yours to own; the wiring is ours to ship.
Step 1 · Your jurisdiction
7 signals · 4 snippets · 3 apps mapped
Scaffold, not legal advice. The code is production-grade wiring for Consent Mode v2 signals. The categories, copy, retention windows, and list of in-scope processors still need counsel review — especially for EU, UK, and California traffic.

What the Consent Mode v2 scaffold actually ships

Since March 2024, Google has required Consent Mode v2 for any site advertising to European Economic Area (EEA) traffic. Sites without it lose personalized advertising, remarketing audiences, and conversion measurement for EEA users. Most agencies charge $2,000 to $5,000 to implement it. This generator produces the same artifact in under a minute.

Pick a jurisdiction — EU, UK, California, or rest of world — and the apps on your site. You get a gtag('consent', 'default', …) block with the region-correct default state across all seven signals (ad_storage, analytics_storage, ad_user_data, ad_personalization, functionality_storage, personalization_storage, security_storage). You get an accessible banner with a preference center. You get a controller that wires Accept / Reject / Save to gtag('consent', 'update', …), persists the choice to localStorage with a version stamp, and pushes consent_updated to the dataLayer so GTM can re-evaluate gated tags. You get a GTM template with four Data Layer Variables and three Custom Event triggers ready to gate Meta Pixel, TikTok, and every other non-Consent-Mode-aware vendor.

Why the defaults aren't invented

Every signal name and consent value in this scaffold is lifted from Google's Consent Mode v2 documentation. The EU / UK defaults follow the opt-in model required by GDPR + ePrivacy + UK-GDPR: every marketing and personalization signal starts as denied. The California defaults follow the CCPA/CPRA opt-out model: granted by default, with automatic denied override when Global Privacy Control is detected in the browser. Rest-of-world defaults to granted with a visible withdraw control — if you operate in Brazil (LGPD), Canada (PIPEDA/Quebec Law 25), or Australia, confirm the local requirement with counsel.

Scaffold, not legal advice

The code is production-grade wiring. The consent categories, retention windows, and copy still need counsel review — every jurisdiction has its own requirements for what counts as informed consent and what counts as a legitimate interest. We emit the skeleton that compiles correctly; your legal team owns the fill-in.

What about ongoing monitoring?

Shipping the banner is a one-time event. Keeping every new marketing tag gated behind consent, catching the rogue tag a marketer adds without asking — that's where most implementations drift. NiceLookingData's full audit includes four Consent Mode v2 checks across GA4 and GTM, re-runs nightly, and emails you when a tag starts firing without a consent guard. Generate the scaffold here, then run a free audit to keep it honest.

For a deeper explanation of the gtag('consent', 'default', …) ordering requirement, the four v2 parameters, and the verification steps that confirm your implementation is working, read Consent Mode v2: What It Is, Why It's Required, and How to Implement It. For the GTM-specific wiring — Consent Initialization trigger, tag consent settings, and cookie restore for returning visitors — see GTM Consent Mode v2 Setup.