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.