Joomla gives you two reliable ways to install CookieScan: editing your template's index.php file directly, or using a custom code plugin. This guide covers both.
Before you start
You will need:
- An active CookieScan subscription (view plans)
- Your banner installation code from the CookieScan dashboard (Cookie Banner → Install Code)
- Super User access to your Joomla admin
- For Method 2: a plugin like Sourcerer or JavaScript Framework Plugin
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: Edit your template's index.php (recommended)
Step 1 – Open Template Manager
- Log into your Joomla admin (
/administrator) - Go to System → Site Templates (Joomla 4/5) or Extensions → Templates (Joomla 3)
- Find your default (active) template and click to edit it
Step 2 – Open index.php
- In the left sidebar, open html → then find index.php at the root of the template
- Click to open it in the code editor
Tip: Before editing, create a copy of the template first via Copy Template so you have a backup and to avoid losing changes on template updates.
Step 3 – Add the CookieScan script
Find the opening <head> tag or the <jdoc:include type="head" /> line. Add your CookieScan script immediately after the head tag or after the jdoc:include line:
<head>
<jdoc:include type="head" />
<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
...rest of your head content...
</head>
Step 4 – Save and verify
- Click Save
- Clear your Joomla cache: System → Clear Cache
- Visit your site in a new incognito window
Method 2: Use a plugin
If you'd rather not edit template files, use a custom code plugin.
Option A: Sourcerer (free extension)
- Install Sourcerer from the Joomla Extensions Directory
- Create a new Custom Module in Content → Site Modules
- Assign the module to the head position
- In the content, add your CookieScan script using Sourcerer tags
- Publish the module, assign to All pages
- Clear cache
Option B: JCH Optimize or similar
Many Joomla performance/SEO plugins have a custom code field for head injection. If you use one, paste your CookieScan script there.
Method 3: Install via Google Tag Manager
If GTM is already installed on your Joomla site:
- 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 Joomla's built-in Privacy Consent plugin (if enabled)
Joomla has a basic Privacy Consent feature. If enabled, you may want to let CookieScan handle consent instead:
- Go to System → Manage → Plugins
- Search for Privacy – Consent
- Disable or adjust as needed based on your compliance requirements
Verify the installation
- Visit your site in a new incognito window
- The CookieScan banner should appear
- Open DevTools (F12) → Network tab → filter by
cookiescan - Confirm
banner.cookiescan.comloads successfully
Use Verify Installation in your CookieScan dashboard for a final check.
What happens next
Once installed, CookieScan handles everything automatically:
- Scans your Joomla site and detects all cookies (including those from third-party extensions)
- New cookies appear in Cookie Manager → Unclassified – categorise them
- Blocks cookies until user consents
- Logs every consent decision
Troubleshooting
Banner not appearing
- Clear Joomla cache (System → Clear Cache)
- Clear any server-side cache (Varnish, CDN)
- View page source and search for
cookiescanto confirm the script is in the<head> - Check if a caching plugin is minifying/stripping the script
Changes lost after template update
- Use a template override/copy (created via Copy Template) so updates don't overwrite your changes
- Or switch to Method 2 (plugin-based install)
Cookies still loading before consent
- Some Joomla extensions load cookies server-side or very early
- Run Cookie Manager → Rescan Domain in CookieScan to catalogue them
- Categorise any new ones found so the banner can block them
Full documentation
For detailed setup help, see the support guide linked in your CookieScan dashboard, or visit our support guides.