Google Consent Mode v2

Hi @ all

Google wants us to implement Consent Mode v2 on the website.
What do I need to implement this in a RW Classic project and how much effort will it require?

You can use Consent Mode v2 in RapidWeaver Classic by combining a Consent Management Platform (CMP) that supports Consent Mode with either direct gtag integration or Google Tag Manager, then inserting the needed scripts into RW’s global code areas and blocking all Google tags until consent is given.[1][2][3]

What Consent Mode v2 Needs

Google Consent Mode v2 adds two signals on top of the old ones, so your setup must handle at least these four parameters:[1][2]

  • ad_storage
  • analytics_storage
  • ad_user_data
  • ad_personalization

These parameters are set via gtag('consent', 'default', {...}) before anything Google-related runs and updated once the user accepts or rejects via your CMP or banner.[1][2]

Recommended Architecture for RapidWeaver

In a RapidWeaver Classic site, the simplest robust path is:

  • Use a CMP that explicitly supports Google Consent Mode v2 (e.g. Cookiebot, CookieYes, Real Cookie Banner, Complianz, Borlabs, Silktide, etc.).[4][2][5][3][6]
  • Integrate Google Tag Manager (GTM) once, and let the CMP send the consent state to GTM/gtag; then configure GA4, Ads, etc. inside GTM with consent checks.[7][8][5][9]

This avoids hand-coding consent logic into each page, which is error‑prone, especially with v2’s extra signals.[10][2]

Where to Put the Code in RapidWeaver

Typical RapidWeaver Classic structure for this setup:

  • In RW “Settings → Code → Head” add:
    • The CMP’s main script snippet (so the banner loads early).
    • The Consent Mode “default” command (often the CMP injects this automatically; if not, paste the gtag default consent block here, with all four parameters set to denied).[1][3]
  • In RW “Settings → Code → Body” (top) add:
    • The GTM container snippet (using the Consent Initialization trigger in GTM to establish default consent before any tags fire).[7][8][5]

Do not paste GA4 or Ads code directly into RW; use GTM exclusively and let CMP + Consent Mode control everything.[10][7][8]

CMP + GTM Configuration (High Level)

Once the snippets are in RW, configure the tools:

  • In the CMP backend, enable “Google Consent Mode v2” and map its consent categories to Google’s four parameters; most CMPs have a dedicated toggle or mapping screen for this.[4][2][3][6]
  • In GTM “Admin → Container Settings → Consent Overview”, enable consent mode and assign required consent types for each tag (e.g. GA4 requires analytics_storage, Ads needs ad_storage and typically ad_user_data/ad_personalization).[7][8][5][9]
  • Ensure your GA4 and Ads tags use consent-aware triggers (e.g. wait for “consent granted” events from CMP or for GTM’s built‑in consent checks) so no Google tags fire before consent on EU traffic.[1][10][2]

Practical Tips for Your RW Projects

For your typical small‑business RW sites:

  • Pick one CMP that has a documented Consent Mode v2 + GTM recipe (CookieYes, Cookiebot, Real Cookie Banner + GTM, or Borlabs + GA4/Ads are popular in the German‑speaking space).[4][2][3][6]
  • Create a RW project template with the CMP + GTM snippets already set in global Head/Body, so you only swap IDs per client.
  • If you prefer stacks, a privacy/cookie stack such as “Privacy Center” can manage the banner, but ensure the stack or its CMP integration explicitly supports Consent Mode v2 and passes all four parameters to Google.[11][2]

If you tell which CMP you use (Cookiebot, Real Cookie Banner, Borlabs, etc.) and whether you already run GTM on these RW sites, a step‑by‑step snippet layout for your exact setup can be outlined.

Quellen
[1] Set up consent mode on websites | Tag Platform Set up consent mode on websites  |  Tag Platform  |  Google for Developers
[2] What is Google Consent Mode V2? How to Implement It? - CookieYes What is Google Consent Mode V2? How to Implement It?
[3] Implementing Google consent mode - Cookiebot Support https://support.cookiebot.com/hc/en-us/articles/360016047000-Implementing-Google-consent-mode
[4] Google Consent Mode v2 - Borlabs Google Consent Mode v2
[5] Free Cookie Banner with Google Consent V2 - Silktide Free Cookie Banner with Google Consent V2 - Silktide
[6] Google Consent Mode V2 mit Real Cookie Banner - datenversiert https://datenversiert.de/blog/google-consent-mode-v2-mit-real-cookie-banner/
[7] Google Consent Mode v2 einrichten – Schritt für Schritt [2024] Google Consent Mode v2 einrichten – Schritt für Schritt [2024]
[8] Tag Manager consent mode support - Google Help Tag Manager consent mode support - Tag Manager Help
[9] Google Consent Mode v2 mit GTM Anleitung und Erklärung (+ … Google Consent Mode v2 mit GTM Anleitung und Erklärung (+ CCM19) - HosonoDE
[10] Consent Mode V2 For Google Tags | Simo Ahava’s blog Consent Mode V2 For Google Tags | Simo Ahava's blog
[11] Privacy Center - { rwProDev } - Addons for RapidWeaver Privacy Center
[12] Google Consent Mode v2: Alle Informationen + Anleitungen Google Consent Mode v2: Alle Informationen + Anleitungen
[13] Simplified Guide to Google Consent Mode v2 - Complianz Simplified Guide to Google Consent Mode v2 - Complianz
[14] How to add custom html in head only on particular page How to add custom html in head only on particular page - Content & Markdown - Grav Community Forum
[15] Implement a GDPR compliant cookie banner compatible with … Implement a GDPR compliant cookie banner compatible with Google Consent Mode
[16] One addon to put custom HTML in head tag AND ALSO in body tag? One addon to put custom HTML in head tag AND ALSO in body tag? - Looking for a module or a theme - PrestaShop Forums
[17] Google Consent Mode V2 - Stape.io Google Consent Mode V2 | Stape
[18] Google Einwilligungsmodus v2 und Google Tag Manager https://support.cookiefirst.com/hc/de/articles/4410412855441-Google-Einwilligungsmodus-v2-und-Google-Tag-Manager
[19] Create and Publish with RapidWeaver 8 - YouTube https://www.youtube.com/watch?v=7fkixYHM4nI
[20] Custom HTML components on the same page - Elements Custom HTML components on the same page

Thank you very much for your detailed reply, Jan.

The following link provides an very interesting paper on this topic, although it is in German:

Thanks, I know this article quite well, but the risks are quite low if you use one of the existing tools. Nevertheless this is one of the reasons my sites do not use any cookie banner at all. To create a cookie banner ourselves would also be a time consuming task. To put it in German „Einen Tod musst Du sterben“

1 Like

My sites don’t use cookies either. The problem in this case is that the customer in question has Google campaigns running. And Google tells me that we therefore have to set up the consent tool. Failure to implement it apparently leads to significant restrictions in terms of target groups and campaign optimisation.

But maybe I should ask the guys at Google again if there’s any way we can get around this pointless operation, despite the ongoing campaigns.