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

MODX Platform

3 min read

MODX is a flexible content management platform that uses Templates and Chunks to structure pages. Adding CookieScan means editing your Template (or a Chunk that's included in it) to add the script to the <head>.

Before you start

You will need:

  1. An active CookieScan subscription (view plans)
  2. Your banner installation code from the CookieScan dashboard (Cookie Banner → Install Code)
  3. Administrator access to your MODX manager

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: Add to your Template (recommended)

Step 1 – Open your main Template

  1. Log into your MODX Manager
  2. In the left tree, click Elements
  3. Expand Templates
  4. Click your site's main Template (often called BaseTemplate or similar)

Step 2 – Add the CookieScan script

  1. In the Template code, find the opening <head> tag
  2. Add your CookieScan script immediately after it:
<head>
  <script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
  ...rest of your head content...
</head>

Step 3 – Save and clear cache

  1. Click Save
  2. Go to Manage → Clear Cache
  3. Visit your site in a new incognito window

Tip: If your site uses multiple Templates for different page types, add the script to all of them, or put it in a shared Chunk (see Method 2).

Method 2: Use a Chunk (for multi-template sites)

A Chunk is a reusable content block. Put your CookieScan script in a Chunk and include it in every Template.

Step 1 – Create the Chunk

  1. Go to Elements → Chunks
  2. Click Create new Chunk
  3. Name it CookieScanBanner
  4. In the content, add:
    <script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
  5. Save

Step 2 – Include the Chunk in your Template(s)

In each Template, add this tag inside the <head>:

<head>
  [[$CookieScanBanner]]
  ...rest of your head content...
</head>

Step 3 – Clear cache

Go to Manage → Clear Cache and visit your site to verify.

Method 3: Install via Google Tag Manager

If GTM is already installed on your MODX site:

  1. In CookieScan, open Cookie Banner → Install Code and switch to the Google Tag Manager Install tab
  2. Copy your CookieScan ID
  3. In GTM, go to Templates → Search Gallery and add the CookieScan template
  4. Create a tag using the template, paste your ID
  5. Trigger: Consent Initialization – All Pages
  6. Submit and publish

Verify the installation

  1. Visit your site in a new incognito window
  2. The CookieScan banner should appear
  3. Open DevTools (F12) → Network tab → filter by cookiescan
  4. Confirm banner.cookiescan.com loaded

What happens next

  • CookieScan scans your MODX site and detects all cookies
  • New cookies appear in Cookie Manager → Unclassified – categorise them
  • The banner blocks cookies until user consents
  • Every decision is logged in Consent Log

Troubleshooting

Banner not appearing

  • Clear MODX cache: Manage → Clear Cache
  • Clear any server-side cache (Varnish, CDN)
  • View page source and confirm the script is in the <head>
  • Check the right Template is being used for the page you're viewing

Banner shows on some pages but not others

  • Different page types may use different Templates
  • Use the Chunk approach (Method 2) to include the script in all of them easily

MODX Cache stripping the script

  • Some MODX minification extras (e.g. Gzip) may merge or strip inline tags
  • Check the extras settings and add cookiescan to any exclusion list

Full documentation

For detailed setup help, see the support guide linked in your CookieScan dashboard, or visit our support guides.