Skip to Content

Google Consent Mode v2

Google Consent Mode v2 allows Google services such as Google Analytics, Google Ads, and Floodlight to adjust their behavior based on user consent choices. It helps website owners comply with data protection laws by informing Google how to operate before and after a user makes a consent decision.

CookieHub integrates with Consent Mode v2 automatically and sets all required consent signals based on the user’s preferences.


Consent Mode v2 sets parameters that determine how Google tags behave depending on user consent. These parameters are passed directly to Google through the 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
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 automatically maps these parameters to the appropriate cookie categories in your configuration.


CookieHub integration

CookieHub fully supports Consent Mode v2 and sets the required parameters automatically based on user consent.

  • No manual configuration of the gtag is needed.
  • Consent signals are passed to Google automatically.
  • Works in both HTML and Google Tag Manager (GTM) implementations.

Implementation methods

HTML implementation

When CookieHub is installed directly in your site’s HTML (using the embed script in the <head>), Google Consent Mode is fully supported. Parameters are set automatically before any Google tags execute.

No further setup is needed if tags are placed after the CookieHub script.


Google Tag Manager (GTM) implementation

If you’re using GTM, CookieHub provides a built-in GTM template that enables full Consent Mode support.

To enable it:

  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 that Consent Mode is initialized before any tags run, and user preferences are respected.

You must configure additional consent control manually for non-Google tags that do not support Consent Mode. See Installation: Additional Consent.


Parameter mapping

CookieHub maps internal cookie categories to Consent Mode parameters as follows:

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

These parameters are updated automatically when the user gives or withdraws consent.


Consent Mode v2 is required if:

  • You use Google Ads, AdSense, or Google Analytics in the EU, UK, or Switzerland
  • You are subject to the Google EU User Consent Policy
  • You want to collect analytics or conversion data in compliance with privacy laws

Summary

FeatureCookieHub Support
Consent Mode v2 integration✅ Yes
HTML script integration✅ Yes
GTM integration with template✅ Yes
Parameter mapping to categories✅ Yes

Last updated on