Home › How-tos › The Secret Setups › Consent Mode
How to set up Consent Mode v2 in Google Tag Manager
Live guide · Checked 28 October 2026 · Updated 28 October 2026 · Checked every week against Consent Mode's own help pages
Start every visit with Google's storage denied, switch it on when people accept your cookie banner, and keep Google Ads and GA4 modelling the rest. Needed for ads to UK and EU users.
- Time
- 30 minutes
- You will need
- Google Tag Manager
- A cookie banner you can hook into (your own or a consent platform)
- Stuck?
- Troubleshooting or ask us a question
Step by step
Turn on consent overview
In Tag Manager: Admin > Container Settings, tick Enable consent overview and save. A shield icon appears on the Tags page to show each tag's consent settings.
Set the defaults before anything else
Make a Custom HTML tag fired on Consent Initialization - All Pages. It must run before every other tag:
<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 }); gtag('set', 'ads_data_redaction', true); gtag('set', 'url_passthrough', true); </script>Update consent when people accept
When someone clicks Accept on your banner, run this (put it in your banner's accept handler, or push an event your banner already sends):
window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('consent', 'update', { ad_storage: 'granted', ad_user_data: 'granted', ad_personalization: 'granted', analytics_storage: 'granted' }); window.dataLayer.push({ event: 'consent_granted' });Remember the choice on the next page
Store the choice and run the update again early on every page for people who already accepted:
if (localStorage.getItem('consent') === 'granted') { gtag('consent', 'update', { ad_storage: 'granted', ad_user_data: 'granted', ad_personalization: 'granted', analytics_storage: 'granted' }); }Hold non-Google tags until consent
Google tags adjust themselves to consent. Others (Meta, TikTok, LinkedIn and the rest) don't. For each, open the tag, go to Advanced Settings > Consent Settings, choose Require additional consent for tag to fire and add
ad_storage. Or fire them on aconsent_grantedcustom event trigger.Check it in Preview
In Preview, open the Consent tab in Tag Assistant. Before Accept, every type should say Denied; after Accept, Granted. Check Meta's tag doesn't fire until Accept.
Publish and confirm in Google Ads
Publish. In Google Ads go to Goals > Conversions > Summary and open Diagnostics after a few days: it shows whether consent signals are being received.
Tips from people who set these up every week
- Use a Google-certified consent platform if you serve the EU at scale: it handles the defaults, regions and the update for you.
- url_passthrough keeps the click ID in links when cookies are denied, so conversions can still be matched.
Troubleshooting: questions and answers
Do I still need a cookie banner?
Yes. Consent Mode tells Google tags what the visitor chose; the banner is how they choose. UK and EU law needs the banner before non-essential cookies.
Tags fire before consent.
Check the defaults tag is on Consent Initialization, not Initialization or Page View, and that non-Google tags require ad_storage.
Official help pages
Let Claude fix the rest of your funnel
Lead Focus is 12 Claude Skills that find the stage of your funnel that's costing you leads, then fix it: ads, landing pages, follow-ups and tracking. One payment, 12 months of updates, and a 14-day refund.
Get Lead Focus · $29.99Still stuck, or have a question?
Tell us where you got to and what you see. We read every message and reply by email, usually the same working day.