Table of Contents
The same steps, with the download button, are on the GTM install page.
Do these four steps
Create a free banner first if you do not have one. The same clicks, with a download button, are on the GTM install page.
1. Import the template
Download cookie-banner-consent-mode.tpl first.
- In Google Tag Manager, click Templates in the left menu.
- In the Tag Templates box, click New. A blank editor opens.
- Click the three dots at the top right, next to Save. Click Import and pick
cookie-banner-consent-mode.tplfrom your Downloads folder. - The name changes to Cookie Banner Generator — Consent Mode v2 and you see Template created. If Save is blue, click it. Close the editor with the X at the top left.
- Click Tags, then New. Name it
Cookie Banner Generator — Consent Mode. - Click Tag Configuration and choose Cookie Banner Generator — Consent Mode v2. Leave every field as it is. An empty table means everything starts as denied.
- At the bottom of the Tag Configuration box, click Advanced Settings, then Tag firing priority. Type
1000. - Click Triggering and choose Consent Initialization - All Pages.
- Click Save.
If you see a red error after importing, stop and email support@cookie-banner.ca with a screenshot.
2. Add the banner
Grab your banner and click Copy snippet on the banner.
If GTM is how you install things:
- In GTM, click Tags, then New.
- Name the tag
Cookie Banner. - Click Tag Configuration, choose Custom HTML, and paste the snippet.
- At the bottom of the Tag Configuration box, click Advanced Settings, then Tag firing priority. Type
50. - Click Triggering and choose Consent Initialization - All Pages.
- Click Save.
If you can edit the site HTML: paste that same snippet in the head, above the Google Tag Manager snippet. You still need the template from step 1.
3. Tell each other tag to wait
Stay in the same Google Tag Manager container. In the left menu, click Tags. That list is the tags that were already firing on the site, plus the two you just created.
Open a tag that was already there, such as Google Analytics or a Meta pixel. Leave Cookie Banner Generator — Consent Mode and Cookie Banner as you saved them.
- In the left menu, click Tags.
- Click the name of an existing tag. Skip the two tags from steps 1 and 2.
- Click inside the Tag Configuration box to edit it.
- At the bottom of that box, click Advanced Settings.
- Click Consent Settings.
- Select Require additional consent for tag to fire.
- Check the boxes below for that kind of tag.
- Click Save at the top right.
- Click Tags again and open the next existing tag. Stop when the only tags you have not changed are the two from steps 1 and 2.
| Tag | Check | |---|---| | GA4 | Analytics Storage | | Google Ads | Ad Storage, Ad User Data, Ad Personalization | | Meta, LinkedIn, TikTok, other ad pixels | Ad Storage | | Hotjar and other analytics | Analytics Storage |
If Consent Settings is missing, the tag is usually Custom HTML. Open Triggering, remove All Pages, and add a Custom Event trigger named cookie_consent_update. Fire it when consent_marketing equals true for an ad pixel, or consent_analytics equals true for an analytics tool.
4. Preview, then publish
- Click Preview at the top right. Enter your site address and click Connect.
- Leave the banner sitting there. In Tag Assistant, open the Consent tab. Ad Storage, Analytics Storage, Ad User Data, and Ad Personalization should say Denied.
- Click a GA4 or ads tag. It should say it has not fired, or that consent blocked it. Refresh. It should still be blocked.
- On the banner, click Accept All. Those tags should say Fired.
- Refresh. The tags should fire again, and the banner should stay hidden.
- In GTM, click Submit, name the version, and click Publish.
Common mistakes
- Searching the Community Gallery for this template. Download the file in step 1 and import it.
- Wrong trigger. Use Consent Initialization, not All Pages.
- Banner only, on All Pages. The default is set too late. Import the template.
- No Denied row. GTM treats a missing default as granted.
- Priority 9999 on the banner tag. That starts the tag earlier. It does not wait for the banner file.
- Meta or LinkedIn with no consent setting. Consent Mode does not block those tags by itself.
- Wrong script URL. Use
https://www.cookie-banner.ca/api/v1/banner.js?id=…from the dashboard.
Background: why this matters
Skip this if you only needed the setup. Useful context for audits and Ads accounts.
Why GTM needs consent
GTM is a container. GA4, Google Ads, Meta, LinkedIn inside it set tracking cookies. Under GDPR cookie rules (and similar laws), those tags must wait for permission.
Consent Mode v2 signals
| Signal | Controls |
|---|---|
| ad_storage | Ads / remarketing cookies |
| analytics_storage | Analytics cookies (GA4) |
| ad_user_data | Sending user data for ads (required since Mar 2024) |
| ad_personalization | Personalized ads (required since Mar 2024) |
Denied → cookieless pings + modelling. Granted → normal cookies.
Basic vs Advanced
- Basic: tags do not fire until consent — simplest, lose all non-consent data.
- Advanced: cookieless pings when denied — better modelled coverage; still no cookies without consent. Our template is built for Advanced.
Google Ads / GA4
Without v2 signals in the EEA/UK you lose remarketing lists, modelled conversions, and audience features. GA4 uses behavioural modelling when analytics_storage is denied.
How our pieces talk
- Consent Initialization → template sets Denied (+
wait_for_update) - Template reads
cookie_consentfor returning visitors and updates immediately - Banner loads → UI for new visitors
- User chooses → banner updates
gtag, pushescookie_consent_update, notifies the GTM template callback - Google tags follow Consent Mode. Other tags follow the consent setting from step 3.
Full install reference: /integrations/google-tag-manager.
Frequently Asked Questions
Do I need cookie consent if I use Google Tag Manager?
Answer: Yes. GTM itself is not the tracker — the tags inside it are. Those need consent before they set non-essential cookies.
What is Google Consent Mode v2?
Answer: A Google framework with four consent signals (ad_storage, analytics_storage, ad_user_data, ad_personalization) that change how Google tags behave when consent is denied or granted.
Do I need both the banner script and the GTM template?
Answer: Yes for a complete setup. The banner is the UI + storage. The template sets defaults early and keeps Google tags in sync.
What is the difference between Basic and Advanced Consent Mode?
Answer: Basic blocks tags until consent. Advanced sends cookieless pings when denied so Google can model. Prefer Advanced for most sites.
Do I need Consent Mode v2 for Google Ads?
Answer: Yes for EEA/UK remarketing and conversion features since March 2024 (ad_user_data and ad_personalization).
Can I load the cookie banner through GTM?
Answer: Yes. Import the template first (priority 1000, defaults denied, Consent Initialization). Add the banner as Custom HTML on that same trigger at priority 50. If you can edit the site, put the banner script in the head before GTM instead.
Does this work with Google Analytics 4?
Answer: Yes. GA4 respects Consent Mode natively. Denied → cookieless pings; granted → full tracking.
What is ads data redaction?
Answer: When enabled and ad_storage is denied, Google strips ad-click IDs like gclid from requests. Turn it on for stricter privacy.
Ready? Create your free banner, run the steps above, Preview, then Publish. Full reference: GTM integration.
Ready to add a cookie banner?
Create a free banner in minutes and paste it onto your site. No signup required.
Free plan: 1 banner on unlimited sites. Pro is $99 one-time.
Read more
What Is a Cookie Banner? How It Works and What Makes It Legal (2026)
A cookie banner asks visitors for consent before non-essential cookies load. Learn what it must do, the rules in the EU, UK, Canada and US, and the mistakes regulators fine.
How to Add a Cookie Banner to Your Website (2026): Free 5-Minute Guide
How to add a cookie banner to your website without code. Use a free consent management platform, paste one snippet, and stay GDPR compliant in minutes.
Multi-Language Cookie Banners: How to Show Cookie Consent in 10 Languages Automatically
Learn how to create cookie consent banners that auto-detect visitor language and display in their native tongue. Covers 10 languages including Japanese, Arabic, German, and more.