Skip to Content
Compliance & frameworksIntegrationsGoogle Consent Mode v2

Google Consent Mode v2

Google Consent Mode v2 lets Google services such as Google Analytics, Google Ads and Floodlight adjust their behavior based on your visitors’ consent choices. It tells Google how its tags should operate before and after a visitor makes a consent decision.

CookieHub integrates with Consent Mode v2 automatically and sets the required signals for you. It can be enabled under Integrations in the Settings tab of your CookieHub dashboard, and it is enabled by default for new domains.


Consent Mode v2 sets parameters that determine how Google tags behave depending on the visitor’s consent. They are passed to Google through gtag or Google Tag Manager (GTM).

The following parameters are used:

ParameterPurpose
ad_storageControls storage of advertising cookies
analytics_storageControls storage of analytics cookies
functionality_storageControls storage for non-essential functional features
personalization_storageControls storage for personalized content, such as recommendations
security_storageControls security-related cookie storage
ad_user_dataControls whether user data can be sent to Google for advertising
ad_personalizationControls whether ads can be personalized

CookieHub integration

  • No manual gtag setup is needed.
  • Signals are sent to Google automatically.
  • Works with both HTML and Google Tag Manager (GTM) implementations.

When Google Consent Mode v2 is enabled, you can choose how Google tags behave before a visitor answers:

  • Advanced consent mode (recommended): Google tags load straight away and send limited, cookieless pings until the visitor consents. Full data is sent once they do. This is the default.
  • Basic consent mode: No data is sent to Google until the visitor has interacted with the consent dialog.

Implementation methods

HTML implementation

  1. Add the CookieHub script to the <head> of your website.
  2. Enable Google Consent Mode v2 under Integrations in your domain’s Settings tab, and click Save & publish.

Consent Mode is initialized before any Google tags run. No extra setup is needed if your Google tags load after CookieHub.

Google Tag Manager (GTM) implementation

  1. Go to your GTM container.
  2. Add a new tag and choose the CookieHub CMP from the Community Template Gallery.
  3. Enter your CookieHub domain code.
  4. Set the trigger to Consent Initialization - All Pages.
  5. Save and publish.

This ensures Consent Mode is applied before any tags run.

Tags that do not support Consent Mode need additional consent checks in GTM. See Additional consent.


Parameter mapping

CookieHub CategoryConsent Mode Parameters
Marketingad_storage, ad_user_data, ad_personalization
Analyticsanalytics_storage
Preferencesfunctionality_storage, personalization_storage
Necessarysecurity_storage (always allowed)

Parameters update automatically when the visitor’s consent changes. In regions using IAB TCF, the parameters follow the TCF purposes the visitor has agreed to instead. See the IAB TCF purpose mapping.


Google Consent Mode v2 is required if:

  • You run Google Ads, AdSense or Google Analytics for visitors in the EU, UK or Switzerland
  • You must comply with Google’s EU User Consent Policy
  • You need analytics or conversion data under privacy laws

Summary

FeatureCookieHub Support
Consent Mode v2 integration✅ Yes
HTML script integration✅ Yes
GTM integration with template✅ Yes
Advanced and Basic consent mode✅ Yes
Parameter mapping to categories✅ Yes
Parameter mapping to TCF purposes✅ Yes

Last updated on