How to Integrate Google Consent Mode V2 with Drupal and Klaro

How to Integrate Google Consent Mode V2 with Drupal and Klaro
Conor Brown on Unsplash

Albert Skibinski documents integrating Google Consent Mode V2 with Drupal using the Klaro module. V2 adds two new consent parameters — ad_user_data and ad_personalization — alongside existing flags controlling analytics, ads, and functional cookie storage. Each consent state is reflected in the gcd parameter, which encodes all seven flags.

Because Klaro 3.0.7 lacked required callbacks for integration, Albert applied a patch from Drupal issue #3484827 (Merge Request #79) to add onInit, onAccept, and onDecline support. He then configured separate Klaro services for Google Tag Manager, Google Analytics, and Google Ads to set default consent, update consent states on acceptance/decline, and trigger GTM events per service. GTM custom events (e.g., klaro-ga-accepted) were used to fire relevant tags.

The guide notes a governance challenge: adding new third-party tags in GTM may bypass Drupal’s consent form. Albert outlines two options — manage all consent within GTM (simpler, but less granular) or enforce a strict policy for adding third-party services (more control, but requires process discipline and audits).

Reference: Google Consent Mode V2 with Drupal + Klaro (7 August 2025)

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related People

Upcoming Events