On this page
Overview
You can install CookieScan with a script tag in your website's code, or with the CookieScan template in Google Tag Manager. Both show the same cookie banner and record the same consents. They differ in what holds back your other tags until a visitor makes a choice. Both methods work on every plan.
| Method | Use it when | What holds tags back until consent | Auto-block cookies |
|---|---|---|---|
| Script tag | Some or all of your tags are in your website's code | Auto-blocking, plus Google Consent Mode for Google tags | On |
| Google Tag Manager | Every tag on your website loads through Tag Manager | Consent Mode and Tag Manager's consent settings | Off |
The Install Code window in the Portal has a tab for each method: Manual Install for the script tag and Google Tag Manager Install for the template.
Use a script tag
Use a script tag if you are not sure which method to pick. It works however your other tags load, because Auto-blocking runs in the browser before them.
You paste one line of code into the <head> of every page, above all other scripts. With Auto-block cookies turned on, CookieScan holds back scripts and cookies in the categories a visitor hasn't accepted. Auto-blocking can only stop what loads after the CookieScan script, so the script must come first.
If you also use Tag Manager, keep its code on the page below the CookieScan script. Keep Use Google Consent Mode turned on, so Google tags in Tag Manager follow each visitor's choice as well.
To set it up, see Install with a script tag.
Use Google Tag Manager
Use Tag Manager if every tag on your website loads through it, including Google Analytics and any ad pixels. You add the CookieScan template to your container. It sets the Google Consent Mode default before any other tag fires, then loads your cookie banner.
With this method you turn off Auto-block cookies, and Tag Manager decides which tags fire:
- Google tags read Consent Mode and adjust themselves.
- Tags that don't read Consent Mode need Tag Manager's consent settings, or CookieScan's consent events on Premium and Enterprise plans.
A tag written straight into your website's code runs before Tag Manager loads CookieScan, so this method can't hold it back. Move that tag into Tag Manager, or use a script tag instead.
To set it up, see Install with Google Tag Manager.
Website builders
On a website builder, you add the script tag through the builder's own settings. Follow the guide for yours:
- Install CookieScan on WordPress
- Install CookieScan on Shopify
- Install CookieScan on Wix, which needs Auto-block cookies turned off