Drupal is a registered trademark of Dries Buytaert

cookies

Security covered
View on drupal.org

User consent management module for Drupal.

The module enables existing third-party-integration modules continued to be used in compliance with the GDPR (of course without manipulating their code). It solves the basic problem that when using third-party-integration modules, the user must agree to the use of cookies (according to GDPR) before they are installed.

IMPORTANT: No liability is assumed regarding compliance with the GDPR.

The COOKiES module provides (in conjunction with Cookies JSR) a fully configurable user interface for user decisions. It also supports out-of-the-box key third-party integration modules for:

Recommendation

If you are looking for the best-supported solution for a consent privacy system recommended by the Drupal community, please also consider the Klaro module (https://www.drupal.org/project/klaro), which is integrated into the Drupal CMS stack.

This "COOKiES" module has roughly the same range of features, is being further developed, and is not outdated. At least for the module's maintainers, it will definitly continue to be used and will receive all security and core-release updates in the coming years. With upcoming version 2.0, the JavaScript frontend will be freely available for customization. Additional features are not currently planned, but are possible.

2.x release

  • Uses new cookiesjsr 2.x library completely rebuilt using Svelte. Only ~40 kb in size. This library is open source, fully customizable, un-branded and under GPL 3 licence.
  • Deprecates "COOKiES Google Analytics" (cookies_ga) in favor of "COOKiES Google Tag Manager (cookies_gtag).
  • If you are upgrading from 1.x and have advanced custom style changes, you should expect to update some of these. Essentially, class names have been changed to bring us closer to Drupal best practices.

Features

1. Full responsive design.
2. Full translatable by Drupal UI
3. Full accessibility
4. Customizable styling.
4.1. Light: Use CSS-vars to customize colors and some params as described here.
4.2. Heavy: Disable original CSS in the config and start to customize from scatch - or with original SCSS download here)

Installation

1. Require the module via composer require 'drupal/cookies'. This will automatically require the jfeltkamp/cookiesjsr library as well.
2. Add the "COOKiES UI" block in the block configuration at Admin>Structure>Blocks (/admin/structure/block). Simply place the block anywhere.
3. Activate submodules for third party module support (e.g. cookies_gtag to support Google Tag Manager).

Configuration

1. Configure the COOKiES module under Admin>Config>System>COOKiES (/admin/config/cookies/config)
2. Users may want to change their cookie preferences. For this reason, a "Cookies settings" link in the tools menu is created. Move the link to the menu, where you want to place it. (You can create a custom Link very easy with <a href="#editCookieSettings">cookies</a>)
3. You can also add a "Cookies Documentation" block at Admin>Structure>Blocks (/admin/structure/block). This block will display the cookie documentation of each cookies service provided (which can be changed manually).

Important Note

For reasons of performance and in order not to influence the first impression of the page with the cookie banner, a scroll limit is set by default. If your website is not scrollable or your homepage is very short, you should set the sroll limit to zero so that the banner loads immediately.

Other third party modules / submodules

  • COOKiES Module Handler: covers the handling of Javascript (disable/enable depending on users consent)
  • COOKiES Filter (Submodule): Covers the handling of 3rd party code snippets pasted to the text editor.
  • COOKiES Etracker (Submodule of etracker):COOKiES compatibility with etracker
  • COOKiES Posthog (Submodule of posthog):COOKiES compatibility with posthog

Possible alternatives

Activity

Total releases
10
First release
Dec 2024
Latest release
1 month ago
Release cadence
43 days
Stability
30% stable

Release Timeline

Releases

Version Type Release date
2.0.0-rc1 Pre-release Jan 5, 2026
2.0.0-beta1 Pre-release Nov 17, 2025
1.2.16 Stable Jul 23, 2025
2.0.0-alpha5 Pre-release Jul 23, 2025
2.0.0-alpha4 Pre-release Jun 14, 2025
2.0.0-alpha3 Pre-release May 28, 2025
1.2.15 Stable May 28, 2025
2.0.0-alpha2 Pre-release May 5, 2025
1.2.14 Stable May 5, 2025
2.0.0-alpha1 Pre-release Dec 11, 2024