Google Consent Mode v2
When Enable Google Consent Mode v2 is on in Settings (it is on by default for new installs), CookieRay outputs browser-side JavaScript consent signals for the Google tags you have already installed on your site. Those tags then adjust their behavior based on the visitor’s consent.
What CookieRay does
With this setting on, CookieRay emits consent signals that work with:
- GA4 (Google Analytics 4)
- Google Ads
- Google Tag Manager (GTM)
The signals are delivered browser-side, in JavaScript. As the visitor makes choices, the consent state updates and your Google tags react accordingly.
What CookieRay does not do
It’s important to be clear about the boundaries:
- CookieRay does not make server-side calls to Google.
- CookieRay does not install Google tags for you.
In other words, Consent Mode v2 in CookieRay is the signaling layer. The Google tags themselves must already be present on your site. CookieRay tells them about consent; it does not deploy them.
Default and updated consent state
Before a visitor chooses, CookieRay sets a default state: advertising, analytics, user-data, and personalization signals are denied, while functionality and security storage are granted as Necessary. When the visitor chooses, CookieRay sends an update based on the categories they allowed. For the full mapping and a verification checklist, see Set up Consent Mode v2 with GA4 and GTM.
When it runs
The consent signals are output only on pages where CookieRay loads. That means the banner must be switched on, and the page must not be excluded by the cookieray_should_load_banner filter or, with Pro, by Geo Targeting. With the banner off, no Consent Mode output is added even if the toggle is on.
In Strict mode, CookieRay also holds known Google scripts until the visitor allows the matching category, so a visitor who declines does not load them at all.
How it fits together
- You install your Google tags (GA4, Google Ads, or GTM) on your site as usual.
- You make sure Google Consent Mode v2 is enabled in CookieRay’s Settings.
- CookieRay outputs the consent signals in the browser.
- Your Google tags read those signals and adjust their behavior based on consent.
Learn more
For details on how Google tags respond to these consent signals, see Google’s documentation: