How to Integrate Google Consent Mode V2 with Drupal and Klaro
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).


