Skip to main content

Google Consent Mode v2

Google Consent Mode v2 is required if you use Google Tag Manager. It is also a requirement for sites that are used by European Economic Area (EEA) or UK users to ensure that Google tags read the user's consent. Practically speaking, it's a set of fields that need to be updated when a user interacts with the Cookie Management Platform on a site.

The relevance to Dreamdata is that our script is aligned with Google Consent Mode v2 requirements. Therefore our script looks for the field update in analytics_storage to know when to fire the standard tracking script vs. cookieless tracking. This field needs to be correctly updated by user interaction with the cookie banner from your cookie management platform (CMP). Google Consent Mode v2 should be enabled for all Dreamdata customers who are using our analytics, regardless of region, as it's the easiest way to ensure seamless interaction between your cookie banner and our script.

The expected behavior is:

  • It should be true after user accepts cookies, triggering the standard script.
  • It should be false or undefined if the user rejects cookies, we expect the same behavior in both cases, which is that the cookieless script fires.

You can see the documentation on how to enable Google Consent Mode v2 in this list:

  • CookieBot - Google Consent Mode implementation
  • CookieYes - Consent Mode with CookieYes
  • OneTrust - Google Consent Mode v2 setup
  • Osano - Consent Mode v2 configuration
  • HubSpot - Google Consent Mode v2 setup
  • Cookie Information now supports Google Consent Mode v2 by default. However, if you have an older implementation of the banner you can follow this guide to enable it.
  • Framer cookie banner is compliant with Google Consent Mode v2 by default.
  • Klaro - Google Consent Mode v2 setup

If your Cookie Management Platform is not included in this list, you can search for it online to find instructions on enabling Google Consent Mode v2.

This field is update in analytics_storage. You can find this on your site by logging window.google_tag_data in the console, and looking inside the ics > entries > analytics_storage > update object.