Skip to content

CMS · Install guide

Cookie consent for Drupal

Updated

In Drupal, the banner script belongs in your theme as an external library loaded in the header, so it runs before other scripts.

Setup time
About 5 minutes
Coding
None: copy and paste
Laws covered
GDPR, UK GDPR, CCPA, DPDP
Google Consent Mode v2
Built in, basic or advanced

Set up cookie consent on Drupal in 3 steps

  1. Create a free accountAdd your website. Kiescy scans it and finds the trackers that need consent.
  2. Paste one script into DrupalYour banner appears and starts holding back trackers until visitors choose.
  3. Check it worksOpen your site in a private window and run the free check to confirm nothing loads early.

Why Drupal sites need cookie consent

Drupal runs many public-sector, university and enterprise sites, often with strict compliance reviews. Regulators and auditors look for consent before analytics and a record of each choice.

Your options on Drupal

ApproachGood forWatch out for
EU Cookie Compliance moduleSites that want everything in Drupal configRules and records are configured per site; regional behavior is limited
Kiescy as a theme libraryMulti-site and multi-region setupsTheme-level change; deploy with your code

Add your privacy policy

Create a Basic page with the Full HTML text format and paste the embed, then add it to the footer menu.

Basic page, Full HTML
<div data-kiescy-doc="privacy"></div>
<script src="https://script.kiescy.com/embed/policy/YOUR_SITE_KEY.js" async></script>

Check that it works

Open your site in a private window: the banner should appear for a first-time visitor. Then run the free privacy check, which opens your site as a new EU visitor and lists anything that still loads before consent.

Kiescy's monitoring repeats that check on a schedule and emails you if a new script starts tracking before consent.

What your Drupal visitors see

Kiescy detects where each visitor is and shows the version their law requires, so you don't have to choose between the strictest banner for everyone and no banner at all.

GoodEU, UK, India and other opt-in regions: an opt-in banner. Analytics, ad pixels and embeds wait until the visitor agrees; Reject is as easy as Accept. Banner text: We value your privacy. We use cookies to run this site and, with your permission, to measure visits and show relevant ads. Buttons: Accept all, Reject all, Customise.
GoodCalifornia and other US states: an opt-out notice with a "Do Not Sell or Share" link, and Global Privacy Control honoured automatically. Banner text: Your privacy choices. We share some data with advertising partners. You can opt out at any time. Buttons: Do Not Sell or Share My Personal Information, OK.

Trackers Drupal sites usually load

These are the tools that most often need consent on Drupal sites, and how Kiescy treats them. Run a cookie scan to see exactly what yours loads.

ToolCategoryWhat happens
Google Analytics / Google Tag modulesAnalyticsHeld back once your scan finds them
Embedded media (oEmbed YouTube)SocialIframes need a click-to-load approach
Search and feedback widgetsPerformanceCheck what they load

Cookies Drupal sets itself

Besides the tools you add, Drupal sets some cookies of its own. Essential ones don't need consent, but they belong in your cookie policy.

CookiePurposeCategory
SESS* / SSESS*Keeps logged-in users' sessions (SSESS on HTTPS)Essential
Drupal.visitor.*Remembers form values for anonymous users (optional)Functional

Names and lifetimes change over time, so treat this as a guide and rely on your own scan for your cookie policy.

Troubleshooting

The script loads in the footer

Check header: true on the library and clear caches. JS aggregation keeps external libraries external.

BigPipe or caching shows the banner late

The banner runs in the browser, so page caching doesn't affect its logic; make sure the library loads in the header, not via a lazily rendered block.

Compliance checklist for Drupal

  • A consent banner that blocks non-essential trackers until the visitor agrees (opt-in for the EU, UK and India).
  • A "Do Not Sell or Share" option for California visitors, and Global Privacy Control honored.
  • A privacy policy that names the tools above, linked from every page.
  • A cookie policy listing the cookies your scan finds.
  • A way for people to request, correct or delete their data.
  • Records of each consent choice, kept as proof.
  • Privacy policy linked in the footer menu and on user registration.

Guides for Drupal site owners

Questions

Does it work with Drupal 7?

Yes, via drupal_add_js in your theme, but Drupal 7 is end-of-life.

Can I use it across a Drupal multisite?

Yes. Add a website per domain in Kiescy and use each site's key, or one theme library with a per-site key setting.

Official Drupal documentation

Menus move. If a step above doesn't match what you see, Drupal's own docs show the current way to add code.

Get compliant this afternoon, not this quarter.

Set up your policies, banner and request form in one place. Free while Kiescy is in early access.