On this page
Before you start
You need:
- Google Tag Manager on every page of your website, and permission to publish its container
- every tracking tag on your website loading through Tag Manager
- your website set up in the Portal
The CookieScan template works on every plan. It can't hold back a tag written straight into your website's code, because that tag runs before Tag Manager loads CookieScan. If you have tags like that, see Choose how to install CookieScan.
Copy your CookieScan ID
Your CookieScan ID is the key the template uses to load your banner. It has the form NN-NNNNNN.
Open the Install Code window
Go to Cookie Banner, then Install Code.
Choose the Tag Manager tab
Select Google Tag Manager Install.
Copy the key
Select Copy Key.
Turn off Auto-blocking
With Tag Manager, Google Consent Mode and Tag Manager's consent settings decide which tags fire, so Auto-blocking must be off.
Open the banner settings
Go to Cookie Banner, then Settings.
Untick Auto-block cookies
Untick Auto-block cookies. Leave Use Google Consent Mode ticked.
Save your settings
Select Save & Publish.
Add the CookieScan template
Create a new tag
In Tag Manager, open your container, go to Tags and select New.
Open the Community Template Gallery
Select Tag Configuration, then Discover more tag types in the Community Template Gallery.
Add the CookieScan template
Search for CookieScan, select the template, then select Add to workspace.
You can also open the CookieScan template in the Tag Manager Community Template Gallery.
Fill in the tag
You only need to fill in CookieScan ID. Leave the other fields as they are unless you need them.
| Field | What to enter |
|---|---|
| CookieScan ID | The key you copied from the Portal. |
| Enable Google Consent Mode | Leave it ticked. Untick it only if you don't use Consent Mode. |
| Default settings | Optional. Leave it empty to deny every consent type except security_storage everywhere, until the visitor chooses. security_storage is always granted. |
| Redact ads data | Optional, under Other Settings. Removes ad identifiers from Google Ads and Floodlight requests while ad storage is denied. |
| Pass ad click information through URLs | Optional, under Other Settings. Keeps ad identifiers in your internal links while waiting for consent. |
Set a different default by region
Use Default settings when you want a different starting point in different countries. Which regions start as denied is your decision.
Select Add Region to add a row for each group of regions. In each row:
- Region takes country codes, such as
GB, FR, or subdivision codes, such asUS-CA, separated by commas. - The granted and denied columns take consent types, separated by commas.
List ad_storage, analytics_storage, ad_user_data and ad_personalization in every row, because a type left out of a row gets no default in those regions. Then add one row with a blank Region. It covers every region you haven't listed. When regions overlap, the most specific one wins.
This example denies by default in the UK, the EEA and Switzerland, and grants everywhere else:
| Region | Granted consent types | Denied consent types |
|---|---|---|
| The country codes below | ad_storage, analytics_storage, ad_user_data, ad_personalization | |
| Blank | ad_storage, analytics_storage, ad_user_data, ad_personalization |
GB, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LI, LT, LU, MT, NL, NO, PL, PT, RO, SK, SI, ES, SE, CHGoogle explains how regions work in its guide to setting up Consent Mode.
Set the trigger
Choose the trigger
Under Triggering, choose Consent Initialization - All Pages.
Save the tag
Give the tag a name, such as CookieScan, and select Save.
This trigger fires before every other trigger, so the default is in place before Google tags run. Don't use All Pages or Initialization - All Pages.
Check it and publish
Preview your container
In Tag Manager, select Preview and open your website in Tag Assistant.
Check the default
Select the Consent Initialization event, then Consent. On-page Default shows the values you set.
Check nothing updates yet
No On-page Update appears until you select a button on your banner. This holds for a new visitor, so clear your website's cookies first if you have chosen on your banner before.
Accept on your banner
Select Accept all. A consent update with granted values appears.
Publish the container
Select Submit, then Publish.
Once visitors start making choices, the Dashboard shows Receiving consents. See Check your banner is working.
Update an older template
If you added the CookieScan template before, update it to get the latest version. In Tag Manager, open Templates, select the CookieScan template and select Update. Then publish your container.
How the template works
The CookieScan template:
- sets the Consent Mode default through Tag Manager, before any other tag fires
- applies a returning visitor's saved choice straight away
- loads the CookieScan script, which shows your cookie banner
- sends a consent update each time a visitor saves a choice
How categories map to Consent Mode shows which consent types each category controls.
Next steps
- Fire tags on consent in Tag Manager, for tags that don't read Consent Mode
- Choose advanced or basic Consent Mode
- Google Consent Mode isn't working
- Does CookieScan work with Google Tag Manager?