On this page
Before you start
You need:
- your website set up in the Portal, as in Set up your first website, or Add a client website if you're a reseller
- access to the
<head>of your website's pages, or a builder setting that adds code there - Auto-block cookies set the way you want it at Cookie Banner, then Settings, then Auto-block cookies, because the install code depends on it
On WordPress, Shopify or Wix, follow the guide for your builder: WordPress, Shopify or Wix.
If your website sends a Content Security Policy, also see Allow CookieScan in your Content Security Policy.
Copy the install code
Each website in your subscription has its own install code, and so does each subdomain you add. If you have more than one website, pick the right one first.
Open the Install Code window
Go to Dashboard, then Install Code, or to Cookie Banner, then Install Code.
Choose the Manual Install tab
Select Manual Install. Step 1 shows your install code.
Copy the code
Select Copy next to the code.
The code looks like this, with your CookieScan ID in place of YOUR-COOKIESCAN-ID:
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>If Auto-block cookies is off, the address in your code ends in /gtm?id= instead of /js?id=. Copy the code exactly as the Portal shows it.
Add the code to your website
Open your website's page template
Find the file or setting that controls the
<head>of every page. On most websites this is a shared header or layout.Paste the code at the top
Paste it straight after the opening
<head>tag, above every other script.Publish the change
Save and publish your website. Clear any page cache so visitors get the new version.
Your page's head then starts like this, with your other scripts below the CookieScan script:
<head>
<meta charset="utf-8">
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
</head>Leave the CookieScan script tag as it is. Adding async or defer to it lets other scripts run first.
Warning: Put CookieScan first
Auto-blocking can only stop scripts and cookies that load after the CookieScan script. A script above it runs before your visitor has made a choice.
Check it worked
Open your website in a private browser window. Your cookie banner appears within a few seconds. Make a choice on the banner, then check that the Dashboard shows Receiving consents next to Cookie banner status. Check your banner is working has the full checks.
If you use Google Consent Mode, also open your browser's console. A warning that starts [CookieScan] Google tags were initialised before CookieScan means a Google tag is above the CookieScan script. See Google Consent Mode isn't working.