Skip to content

EARN UP TO 50% COMMISSION WITH OUR RESELLER ACCOUNTS + REGULAR PASSIVE INCOME SIGN UP TODAY

Install CookieScan

Install with a script tag

Add the CookieScan install code to the head of every page, so your cookie banner shows and Auto-blocking can hold back cookies until visitors choose.

Updated 3 min read

Applies to:
  • Cookie banner

https://cookiescan.com/help/install-with-a-script-tag/ Β· Updated 12 October 2026

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.

  1. Open the Install Code window

    Go to Dashboard, then Install Code, or to Cookie Banner, then Install Code.

  2. Choose the Manual Install tab

    Select Manual Install. Step 1 shows your install code.

  3. Copy the code

    Select Copy next to the code.

The code looks like this, with your CookieScan ID in place of YOUR-COOKIESCAN-ID:

HTML
<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

  1. 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.

  2. Paste the code at the top

    Paste it straight after the opening <head> tag, above every other script.

  3. 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:

HTML
<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.

Next steps

Was this article helpful?

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks, your comment has been sent.

Sorry, we couldn't record your feedback. Please try again later.

Still stuck?

Our support team can help with anything these guides don't cover. Tell us your CookieScan ID and the page address so we can look straight away.

Back to Install CookieScan