Shopify makes it easy to add third-party scripts to your store. This guide covers the two recommended ways to install CookieScan: editing your theme directly, or using a Shopify app.
Before you start
You will need:
- An active CookieScan subscription (view plans)
- Your banner installation code from the CookieScan dashboard:
- Go to Cookie Banner in the left sidebar
- Click the Install Code button
- Copy the script tag shown
- Owner or Staff access to your Shopify admin
The install code looks like this:
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
Replace YOUR-COOKIESCAN-ID with the code from your dashboard.
Where it goes: in the
<head>of your theme, before any analytics or marketing scripts. Shopify's Online Store 2.0 themes place this intheme.liquid.
Method 1: Edit your theme (recommended)
This is the fastest, most reliable way to add CookieScan to Shopify.
Step 1 – Open the theme editor
- In your Shopify admin, go to Online Store → Themes
- Find your current (live) theme
- Click the three dots (…) next to the Customize button
- Select Edit code
Tip: Before editing, click the three dots again and select Duplicate. This creates a backup of your theme you can restore if anything goes wrong.
Step 2 – Open theme.liquid
- In the left sidebar under Layout, click theme.liquid
- You will see the full HTML structure of your theme
- Find the opening
<head>tag near the top
Step 3 – Paste the CookieScan script
Add your CookieScan script immediately after the opening <head> tag, before any other content:
<head>
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
<meta charset="utf-8">
...rest of your head content...
</head>
Step 4 – Save and verify
- Click Save (top right)
- Open your store in a new incognito window
- The CookieScan banner should appear within a second
Method 2: Use Shopify Customer Privacy + Custom Pixel
Shopify has a built-in Customer Privacy API for consent management. Use this if you want CookieScan to integrate with Shopify's native privacy controls.
- In your Shopify admin, go to Settings → Customer Privacy
- Under Cookie banner, click Set up
- Turn OFF Shopify's default banner (CookieScan will replace it)
- Go to Settings → Customer events
- Click Add custom pixel
- Name it “CookieScan”
- In the code field, paste:
const cookieScanScript = document.createElement('script'); cookieScanScript.src = 'https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID'; document.head.appendChild(cookieScanScript); - Under Customer privacy, set the permissions to match your requirements
- Click Save, then Connect the pixel
Method 3: Install via Google Tag Manager (if using GTM)
If you already have GTM installed on your Shopify store via a theme snippet or app:
- In your CookieScan dashboard, go to Cookie Banner → Install Code
- Switch to the Google Tag Manager Install tab and copy your CookieScan ID
- In GTM, go to Templates → Search Gallery and add the CookieScan template
- Create a new tag using the template, paste your ID
- Set the trigger to Consent Initialization – All Pages
- Submit and publish your GTM container
Verify the installation
In your CookieScan dashboard, click Cookie Banner → Install Code. Step 3 is Verify Installation – follow it to confirm everything is working.
Alternatively:
- Visit your store in a new incognito window
- Open DevTools (F12) → Network tab → filter by
cookiescan - You should see
banner.cookiescan.comloaded
What happens next
Once installed, CookieScan handles the rest automatically:
- Scans your store and detects every cookie (including third-party apps)
- New cookies appear in Cookie Manager → Unclassified – move them into the right category
- The banner blocks cookies until the user consents
- All consent decisions are logged in Consent Log
Troubleshooting
Banner not appearing
- View page source (Ctrl+U / Cmd+Option+U) and search for
cookiescan– confirm it's in the<head> - If you use a custom theme builder or app that overrides the header, try Method 2 (custom pixel) instead
- Check that your theme is published (not just a draft)
Conflict with Shopify's default cookie banner
- Go to Settings → Customer Privacy → Cookie banner and disable it
Checkout pages show no banner
- Shopify's checkout runs on a separate domain and Shopify-controlled template
- On Shopify Plus, you can edit
checkout.liquidand add the script there too - Other plans: use the Customer Privacy API (Method 2) which works site-wide
Full documentation
For detailed setup help, go to Cookie Banner → Install Code → support guide in your CookieScan dashboard, or visit our support guides.