CMP for Drupal: managing cookies and third-party services

Drupal is frequently used for institutional websites, large editorial projects and digital services with relatively rich architectures.

The logic of a CMP nevertheless remains simple: services requiring consent need to be identified and prevented from operating until the required choice has been obtained.

The main difficulty comes less from Drupal itself than from the way modules, themes and external integrations build the final page.

Start by inventorying services

Before choosing a module or adding a banner, you need to know what the website actually loads.

Analytics, videos, maps, captcha, social networks, advertising and support tools may be added by the theme, a module or a tag manager.

The CMP can only correctly control what has been identified and integrated into its operation.

A technical inventory therefore remains the first step.

The Drupal module is only an installation method

A CMP does not need to be entirely developed as a Drupal module to work on Drupal.

A module may simplify adding the required tag, while the main functionality can remain entirely in JavaScript.

This distinction matters: the CMS places the CMP correctly, while the CMP subsequently controls services in the browser.

The essential criterion therefore remains the execution order obtained in the final page.

The CMP needs to arrive before relevant services

If a Drupal module injects Google Analytics before the CMP loads, the first request may already have been sent when the banner appears.

The CMP cannot retrospectively undo that transmission.

The marker therefore needs to be positioned early enough when automatic detection is used.

This rule is explained in my article about loading order.

Manual mode provides very explicit control

With tarteaucitron open source, services can be declared manually.

The provider’s direct script is removed and tarteaucitron becomes responsible for loading it after the appropriate choice.

This architecture is particularly clear when a technical team controls the project’s theme and modules.

In return, the configuration needs to be maintained when new services are added.

Automatic detection can reduce modifications

With tarteaucitron Pro, many supported services can be detected directly within the page.

This can reduce the modifications required in an existing Drupal architecture.

The Pro marker still needs to load before the services being controlled.

A custom or unknown service may also still require manual integration.

Caching should not distract from the browser

Drupal has a powerful caching ecosystem and may also sit behind various caching or reverse proxy layers.

These mechanisms change how HTML is generated or delivered, but consent is ultimately enforced in the visitor’s browser.

You therefore still need to inspect the page actually received and executed by the browser.

A configuration that looks correct in the administration does not guarantee the final script order.

Pay attention to tag managers

A Drupal website may also use Google Tag Manager to centralize some of its services.

In that situation, the container needs to be distinguished from the services it loads.

Allowing GTM does not automatically mean allowing GA4, Meta Pixel, YouTube or other tags contained in the manager.

I explain this issue in my article about cascading consent with GTM.

Editorial content can introduce external services

On an editorial CMS, trackers do not only come from global configuration.

A contributor may embed a video, map or external content directly within a page.

These integrations also need to be considered when they generate requests or trackers requiring consent.

A visually hidden iframe is not blocked if its external content has already loaded.

Accessibility deserves particular attention

Drupal is frequently used for institutional and public websites where digital accessibility is an important criterion.

The banner and preference panel therefore need to remain keyboard accessible, provide visible focus and work with assistive technologies.

Theme customizations also need to preserve these properties.

The main tests are explained in my article about accessible cookie banners.

Test with a clean session

To verify the implementation, I start with a session containing no previous consent choice.

I open Network before loading the page and search for known third-party services.

I repeat the process after global rejection and then after acceptance.

This method directly verifies the result produced by the entire combination of Drupal, modules, theme, caching, CMP and external services.

Test several page types

A home page is not enough.

Some services may only appear on a particular content type, section, form or page containing embedded external media.

A representative sample of the different structures used by the website should therefore be tested.

On a large project, this verification can easily become part of the acceptance testing process.

Drupal does not change the fundamentals

A good Drupal CMP implementation ultimately follows the same principles as any other CMS.

Identify services, load the consent mechanism early enough, distinguish necessary cookies from optional trackers and verify the result in the browser.

The CMS changes how scripts arrive on the page. It does not change how the browser behaves once they are there.

This is precisely why a JavaScript CMP can remain independent from the technology used on the server side.

Want to configure tarteaucitron.io for your website?
Access your dashboard and configure your consent management directly.
Open my dashboard