Skip to content

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

Shopify Platform

Dougal Matthews
4 min read

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:

  1. An active CookieScan subscription (view plans)
  2. 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
  3. 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 in theme.liquid.

This is the fastest, most reliable way to add CookieScan to Shopify.

Step 1 - Open the theme editor

  1. In your Shopify admin, go to Online Store β†’ Themes
  2. Find your current (live) theme
  3. Click the three dots (...) next to the Customize button
  4. 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

  1. In the left sidebar under Layout, click theme.liquid
  2. You will see the full HTML structure of your theme
  3. 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

  1. Click Save (top right)
  2. Open your store in a new incognito window
  3. 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.

  1. In your Shopify admin, go to Settings β†’ Customer Privacy
  2. Under Cookie banner, click Set up
  3. Turn OFF Shopify's default banner (CookieScan will replace it)
  4. Go to Settings β†’ Customer events
  5. Click Add custom pixel
  6. Name it "CookieScan"
  7. 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);
  1. Under Customer privacy, set the permissions to match your requirements
  2. 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:

  1. In your CookieScan dashboard, go to Cookie Banner β†’ Install Code
  2. Switch to the Google Tag Manager Install tab and copy your CookieScan ID
  3. In GTM, go to Templates β†’ Search Gallery and add the CookieScan template
  4. Create a new tag using the template, paste your ID
  5. Set the trigger to Consent Initialization - All Pages
  6. 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:

  1. Visit your store in a new incognito window
  2. Open DevTools (F12) β†’ Network tab β†’ filter by cookiescan
  3. You should see banner.cookiescan.com loaded

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.liquid and 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.