This module helps you integrate Cookiebot and Google Tag Manager to ensure scripts and cookies are only placed after user consent. It allows for per-language configuration of the cookie banner and Google Tag Manager IDs, and provides a page to view enabled and available cookies.
Cookiebot + GTM
Cookiebot + GTM loads
Cookiebot and
Google Tag Manager on the
same page in the order Google requires, so GTM-managed tags only fire
after the visitor has consented through the Cookiebot banner.
Create a Cookiebot profile and a GTM container, paste their IDs on the
configuration page, and the module takes care of the script tags, the
<noscript> iframe, Google Consent Mode defaults and a
/cookie-declaration page rendered from your Cookiebot
profile.
Features
- Correct loading order – Google Tag Manager
is attached before the Cookiebot script, so Cookiebot can block or
allow GTM tags once consent is known. - Google Consent Mode support – Optional
gtag("consent", "default", ...)tag with per-category
defaults (ad personalization, ad storage, ad user data, analytics,
functionality, personalization), updated by Cookiebot as the visitor
chooses. - Multilingual – Optional language-specific
Cookiebot banner, and a GTM container ID per language with a
fall-back to the general ID for languages added later. - Server-side tagging – Configure a custom GTM
hostname so the loader points at your tagging server. - GTM environments – Optional environment ID
and token for loading a non-live GTM environment on staging sites. - Cookie declaration page – Ready-made
/cookie-declarationroute that embeds Cookiebot's
hosted declaration based on your CBID. - Admin-aware – The scripts and the noscript
iframe are suppressed on admin routes so GTM does not track the
editorial workflow.
Why use this module?
Loading GTM and a Consent Management Platform together is easy to get
wrong: the script order determines whether Consent Mode works at all,
the noscript iframe needs the same visibility rules as the script, and
server-side tagging and GTM environments add parameters that have to
land in both tags. This module encodes those decisions once and exposes
only the fields you actually need to fill in.
Comparison with related modules
Module Approach Best for Cookiebot + GTM Loads Cookiebot and GTM together, in the right order, withConsent Mode defaults and a cookie-declaration page. Sites that use Cookiebot as their CMP and want GTM to respect
it out of the box. Google Tag Dedicated Google Tag Manager / Google tag integration with
container, snippet and insertion-condition management. Projects that only need GTM and handle consent elsewhere
(or not at all). EU Cookie Compliance Self-hosted cookie banner with per-category consent, rendered
by Drupal itself – no third-party CMP account required. Sites that prefer to keep consent in-house rather than relying
on a hosted CMP. Klaro Integrates the open-source Klaro! consent manager, with
per-service consent and script blocking driven from Drupal
configuration. Teams that want an open-source CMP with per-service control
and self-hosting. COOKiES Consent Management Modular consent manager with its own service and UI plugins,
and dedicated sub-modules for Google Tag Manager, Matomo and
others. Projects that want a plugin-based CMP and are not tied to
Cookiebot. Cookie Content Blocker Blocks embedded third-party content (YouTube, Twitter,
…) in rendered output until the visitor accepts cookies. Complementary – use alongside Cookiebot + GTM to cover
inline embeds that GTM does not inject.
💪 Built by humans
This module is built by humans maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully
reviewed by the maintainers to ensure that quality and security
standards are met.
Requirements
- A Cookiebot account with a
Domain Group ID (CBID). - A Google Tag Manager
account with a container ID (GTM-XXXXXXXX).
Ask your assistant about Cookiebot + GTM
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.1.0 | Stable | 11 | Oct 30, 2026 | ||
| 1.0.20 | Stable | 8–11 | Jul 25, 2025 | ||
| 1.0.19 | Stable | 8–11 | Jan 3, 2025 | ||
| 1.0.18 | Stable | 8–11 | Oct 29, 2024 | ||
| 1.0.17 | Stable | 8–11 | Apr 26, 2024 | ||
| 1.0.16 | Stable | 8–11 | Mar 29, 2024 | ||
| 1.0.15 | Stable | 8–10 | Sep 29, 2023 | ||
| 1.0.14 | Stable | 8–10 | Sep 29, 2023 | ||
| 1.0.13 | Stable | 8–10 | Sep 29, 2023 | ||
| 1.0.12 | Stable | 8–9 | Aug 16, 2023 |