Magento (Adobe Commerce) gives you three reliable ways to install CookieScan: via the admin panel using Design Configuration, editing a theme layout XML file, or via Google Tag Manager. This guide covers all three.
Before you start
You will need:
- An active CookieScan subscription (view plans)
- Your banner installation code from the CookieScan dashboard (Cookie Banner → Install Code)
- Admin access to your Magento backend
- For Method 2: SSH or FTP access to your server
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.
Method 1: Design Configuration (recommended)
The easiest way to add scripts site-wide through the admin.
Step 1 – Open Design Configuration
- Log into your Magento admin
- Go to Content → Design → Configuration
- Find your Global scope (or the Website/Store you want to target) and click Edit
Step 2 – Add script to HTML Head
- Expand the HTML Head section
- In Scripts and Style Sheets, paste your CookieScan script tag:
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script> - Click Save Configuration
Step 3 – Flush cache
- Go to System → Cache Management
- Select all cache types
- Click Flush Magento Cache
Step 4 – Verify
- Visit your store in a new incognito window
- The CookieScan banner should appear
Method 2: Edit default_head_blocks.xml (for developers)
Best if you want the script committed to your theme code and deployed through version control.
Step 1 – Locate your theme
Navigate to your custom theme directory on the server, typically:
app/design/frontend/<Vendor>/<theme>/Magento_Theme/layout/default_head_blocks.xml
If the file doesn't exist, create it.
Step 2 – Add the script block
Open default_head_blocks.xml and add inside the <head> tag:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"
src_type="url"/>
</head>
</page>
Step 3 – Clear cache and deploy
From your Magento root via SSH:
bin/magento cache:flush
bin/magento setup:static-content:deploy -f
Method 3: Install via Google Tag Manager
If GTM is already installed on your Magento store:
- In CookieScan, open Cookie Banner → Install Code and switch to the Google Tag Manager Install tab
- Copy your CookieScan ID
- In GTM, go to Templates → Search Gallery and add the CookieScan template
- Create a tag using the template, paste your ID
- Trigger: Consent Initialization – All Pages
- Submit and publish
Disable Magento's built-in cookie restriction mode (if enabled)
Magento has a basic cookie notice. Disable it so CookieScan manages consent:
- Go to Stores → Configuration
- Expand Web → Default Cookie Settings
- Set Cookie Restriction Mode to No
- Save and flush cache
Verify the installation
- Visit your store in a new incognito window
- The CookieScan banner should appear
- Open DevTools (F12) → Network tab → filter by
cookiescan - Confirm
banner.cookiescan.comloads
You can also use the Verify Installation step in your CookieScan dashboard.
What happens next
Once installed, CookieScan handles the rest:
- Scans your store for all cookies, including those set by Magento extensions
- New cookies appear in Cookie Manager → Unclassified to categorise
- Blocks cookies until user consents
- Logs every consent decision for audit purposes
Troubleshooting
Banner not appearing
- Flush Magento cache (System → Cache Management)
- Clear any Varnish/CDN/full-page cache
- View page source and confirm the script is present in the
<head> - Check browser console for errors
Script appears but cookies still firing
- Magento extensions may set cookies server-side (before the script loads)
- Run Cookie Manager → Rescan Domain to catalogue all cookies, then categorise them
Conflict with Magento's Cookie Restriction Mode
- Disable it in Stores → Configuration → Web → Default Cookie Settings
Full documentation
For detailed setup help, see the support guide linked in your CookieScan dashboard, or visit our support guides.