Home Installation Guide Install CookieLet with Google Tag Manager.

Install CookieLet with Google Tag Manager.

Last updated on Sep 14, 2026

Google Tag Manager (GTM) is the easiest way to install CookieLet if you already manage your marketing and analytics tags there. Instead of editing your site's code, you add the CookieLet tag to your container once, and GTM loads it on every page.

This guide covers the full setup: creating your container, adding the CookieLet template, configuring your default consent state, and verifying the banner is live.

Time required: about 15 minutes
You will need: a Google Tag Manager account with publish rights, and a website already added in your CookieLet dashboard

Already installed CookieLet with the direct code snippet? Use one method or the other, never both. Two installations means two banners and duplicated consent records. Remove the snippet from your site before adding the GTM tag.

How it works

The CookieLet tag does three things on every page load: it tells Google's tags that consent has not been given yet, it loads your consent banner, and it passes the visitor's decision back to GTM so your other tags know whether they're allowed to fire.

Because of that ordering, the CookieLet tag must always use the Consent Initialization – All Pages trigger. It's the only trigger GTM guarantees to run before everything else in the container.

Step 1 — Create your GTM container

Skip this step if GTM is already installed on your site.

  1. Go to tagmanager.google.com and sign in.

  2. Select Create Account. Enter your account name, country, and your website's domain as the container name.

  3. Choose Web as the target platform and select Create.

  4. GTM shows you two code snippets. Copy the first and paste it as high as possible inside the <head> of every page. Copy the second and paste it immediately after the opening <body> tag.

  5. Save and publish your site changes, then select OK in GTM.

Placement matters. If the GTM snippet sits below your analytics or advertising tags, those tags load before CookieLet can block them — and cookies get set before the visitor has consented.

Step 2 — Find your Website ID and Account ID

In your CookieLet dashboard, open the installation screen for your website and select the Install with GTM tab. Both IDs are listed there.

Copy both values somewhere handy — you'll paste them into GTM in Step 4. Keep this tab open; you'll come back to it at the end to verify.

Note on naming: CookieLet calls it your Website ID. The GTM template calls the same value Site Id. They are the same thing.

Step 3 — Add the CookieLet template to your container

CookieLet provides a ready-made GTM tag template, so you never have to paste custom HTML into your container.

Option A — from the Community Template Gallery

  1. In GTM, go to Tags → New and select Tag Configuration.

  2. Select Discover more tag types in the Community Template Gallery.

  3. Search for cookielet and select the Cookielet CMP template.

  4. Select Add to workspace, review the permissions it requests, and select Add.

Option B — import the template file

Contact support@cookielet.com for the template file. It has a .tpl extension.

  1. In GTM, open Templates from the left-hand menu.

  2. In the Tag Templates section, select New.

  3. Open the three-dot menu in the top right of the template editor and select Import.

  4. Choose the .tpl file you were sent.

  5. Select Save, then close the editor.

Either way, the template now appears as Cookielet CMP in your container's tag type list.

You add the template once per container. If you manage several GTM containers, repeat this step in each one.

Step 4 — Create and configure the CookieLet tag

  1. Go to Tags → New.

  2. Select Tag Configuration and choose Cookielet CMP.

Site Id and Account Id

Paste your Website ID from Step 2 into the Site Id field, and your Account ID into the Account Id field. Both are required — the tag won't save without them.

Double-check you haven't swapped them. If the two IDs are reversed, the tag fires successfully in GTM but the banner never loads.

Default Consent Settings

This is the consent state applied before the visitor has made a choice. Expand Default Consent Settings and select Add Row.

Set the row like this:

  • Analytics Cookies — Disabled

  • Advertisement Cookies — Disabled

  • Functional Cookies — Disabled

  • Security Cookies — Enabled

  • Share user data with Google — Disabled

  • Use data for ads personalization — Disabled

  • Regions — All

Select Add to save the row.

Security is the only category that stays enabled, because it covers cookies your site needs to function and protect itself. Everything else is switched on only after the visitor accepts.

Why set this explicitly? The template applies a denied-by-default state on its own if you leave the table empty, but adding the row makes your consent configuration visible to anyone auditing the container — and it's the row you'll copy when you add region-specific defaults.

Region-specific defaults (optional)

Keep the All row as your global fallback, then add extra rows for specific regions. Enter comma-separated country or region codes in the Regions column, for example GB, DE, FR or US-CA for California alone.

A row with specific region codes applies only to visitors in those regions. The All row covers everyone else.

Other Settings

Expand Other Settings to reach these three options:

  • Wait For Time — how long, in milliseconds, Google's tags pause while waiting for a consent decision. The default of 2000 suits most sites. Raise it if your banner is slow to appear; lower it if you're losing analytics data from visitors who leave quickly.

  • Ads Data Redaction — recommended on. While advertising consent is denied, Google's ad tags strip advertising identifiers from requests and route traffic through cookieless domains.

  • URL Pass Through — optional. Preserves click identifiers such as gclid across pages when cookies are denied, so conversions are still attributed. Turn it on if you run Google Ads.

CDN Host

Leave this at https://cdn.cookielet.com. Only change it if CookieLet support gives you a different host.

Triggering

Select the Triggering section and choose Consent Initialization – All Pages.

Don't use All Pages. The ordinary All Pages trigger fires alongside your other tags, not before them, which defeats the purpose of the consent banner.

Give the tag a clear name, such as CookieLet CMP — Consent Init, and select Save.

Step 5 — Make your other tags respect consent

Google tags — GA4, Google Ads, Floodlight — read the consent state automatically once CookieLet sets it. Non-Google tags need to be told.

For each third-party tag in your container (Meta Pixel, LinkedIn Insight, TikTok Pixel, Hotjar and similar):

  1. Open the tag and expand Advanced Settings → Consent Settings.

  2. Select Require additional consent for tag to fire.

  3. Add the consent type the tag depends on — usually ad_storage for advertising tags and analytics_storage for analytics tags.

The tag will now wait until the visitor grants that consent type.

Step 6 — Preview and test

  1. Select Preview in the top right of GTM and enter your website URL.

  2. Tag Assistant opens your site in a new window. Confirm the CookieLet banner appears.

  3. In Tag Assistant, open the Consent tab and check the On-page Default column. Every type except security_storage should read denied.

  4. Accept cookies on the banner, then check the On-page Update column. The types you consented to should switch to granted.

  5. Confirm your analytics and advertising tags only fire after that update.

Step 7 — Submit and publish

Close Preview, select Submit in GTM, give the version a name such as Added CookieLet consent banner, and select Publish.

Nothing you configured is live on your website until you publish the container.

Step 8 — Verify in CookieLet

Return to the CookieLet installation screen and select Verify Installation. CookieLet checks your live site for the banner and activates consent recording.

Once verification succeeds, open Consent Log in your dashboard to confirm decisions are being recorded.

Troubleshooting

The banner doesn't appear on my site

  • Confirm you published the container — saving the tag is not enough.

  • Check the GTM container snippet itself is on the page you're testing.

  • Re-check the Site Id and Account Id for typos or a swap.

  • Test in a private or incognito window; you may already have a stored consent decision.

  • Clear your site's cache and CDN cache.

Two banners appear

CookieLet is installed twice — usually the direct snippet is still in your site's <head> alongside the GTM tag. Remove the snippet and keep the GTM tag.

Tags are firing before the visitor consents

  • Check the CookieLet tag is on the Consent Initialization – All Pages trigger, not All Pages.

  • Check the GTM container snippet is at the very top of your <head>.

  • For non-Google tags, confirm you added the additional consent checks described in Step 5.

  • Check no tag is hard-coded into your site outside GTM. Tags pasted directly into your theme aren't governed by your container.

Verify Installation fails

  • Wait a minute after publishing and try again.

  • If your site is behind a password wall, staging login or "coming soon" page, our verifier can't reach it.

  • Check the GTM container is published to the live environment, not only to a preview or a custom workspace.

Analytics data dropped after installing

That's expected, and it's the point: visitors who decline are no longer tracked. If the drop is larger than expected, check that Wait For Time isn't too short, and consider turning on URL Pass Through so ad clicks are still attributed.

Still need help?

Email support@cookielet.com with your website URL and your GTM container ID (it starts with GTM-), and we'll check the configuration for you.