Home > Docs > Implementing Google Consent Mode v2

Implementing Google Consent Mode v2

Last updated on November 29, 2024

In the rapidly evolving landscape of data privacy and user consent, the integration between WebToffee’s GDPR Cookie Consent Plugin and Google Consent Mode v2 marks a significant milestone. With the recent rollout of Google’s updated framework, web developers and site administrators are presented with a refined approach to managing user consent for data collection and usage. This updated version emphasizes personalized advertising and analytics, reflecting a commitment to enhanced user privacy and compliance with regulatory standards. This article details implementing the more stringent Google Consent Mode v2 using the GDPR Cookie Consent plugin.

Google Consent Mode is a feature offered by Google that helps website owners manage user consent for tracking and analytics cookies. It allows websites to adjust how they use Google Analytics and other Google services based on the level of consent users give for data collection and processing. This means that if a user hasn’t given consent for tracking cookies, Google Consent Mode can adjust the way Google Analytics works to provide some level of data still while respecting the user’s privacy preferences.

Google Consent Mode operates by dynamically adjusting the behavior of Google Analytics and other Google services based on the user’s consent status for cookies. Here’s how it typically works:

  1. Consent Status Detection: When a user visits a website, the website’s consent management platform (CMP) determines the user’s consent status regarding cookies, including Google’s tracking and analytics cookies.
  2. Google Analytics Initialization: Based on the consent status, the website initializes Google Analytics with specific configuration settings. If the user consents, Google Analytics operates as usual, collecting data for analysis. If the user has not consented, Google Analytics is configured to work in a restricted mode.
  3. Restricted Mode: In restricted mode, Google Consent Mode instructs Google Analytics to limit data collection and processing. This may involve:
    • Anonymizing IP addresses to ensure user privacy.
    • Reducing the data retention period for collected information.
    • Restricting the use of cookies for personalized advertising and cross-device tracking.
  4. Data Processing: Google Consent Mode ensures that any data collected in restricted mode complies with the user’s consent preferences and applicable privacy regulations. This helps website owners maintain transparency and respect user privacy while gathering essential analytics data.
  5. Consent Updates: Google Consent Mode continuously monitors the user’s consent status. Suppose the user updates their consent preferences during visits or in subsequent sessions. In that case, Google Analytics adjusts its behavior accordingly, enabling or restricting data collection per the updated consent.

Overall, Google Consent Mode provides a flexible approach for website owners to balance the need for analytics and advertising insights with user privacy preferences and regulatory compliance.

Google Consent Mode V2, launched in late November 2023, represents a significant advancement over its predecessor. It mandates explicit user consent for cookies and data usage, specifically focusing on personalized ads and analytics. Notably, the update introduces two additional consent states related to advertising: ad_user_data and ad_personalization. The new Google Consent Mode is more a requirement than an option for websites that want to accurately track conversions and effectively optimize their advertising spend moving forward.

In short, starting in March 2024, Google Consent Mode v2 will mandate the transmission of four distinct signals to activate personalized advertising for new users in the European Economic Area (EEA). If consent is denied for one or more parameters, the relevant tags adjust their behavior or remain entirely blocked. The consent type parameters and their intentions are discussed below:

  • ad_storage – New addition to GCM V2. This parameter manages advertisement cookies.
  • analytics_storage – New addition to GCM V2. This parameter manages analytics cookies.
  • ad_user_data – This parameter shows whether users agree to share their data with Google for ads. It’s vital for gathering data used in targeted ads.
  • ad_personalization – This parameter decides if personalized ads, like remarketing campaigns, can be turned on. It follows user preferences on customized ads based on the consent given or denied via your site’s cookie banner.
  • functionality_storage – This parameter is related to the functionality of the website or app, such as language settings.
  • personalization_storage – This parameter is related to personalization, such as video recommendation.
  • security_storage – This parameter is related to security, such as authentication and fraud prevention.

Follow the below-mentioned steps to activate GCM v2:

Users who have enabled Google Consent Mode V2 through the custom code snippet, kindly remove the code snippet from your site and then follow the steps discussed.

  1. From the dashboard, click on Cookie Consent > Google consent mode tab.
  2. At the top left of the page, toggle the Google Consent Mode(GCM) button.
  3. After enabling GCM, Head to the General section and alter the Google tag behavior option to set how the Google tags must behave.
    • Advanced mode – In advanced consent mode, Google tags load as soon as a user visits the website or app. Initially, consent is set to “denied” by default, and tags send cookieless pings until the user interacts with the consent banner. Once the user grants consent, Google tags send full measurement data.
    • Basic mode – When you use basic consent mode, Google tags don’t load until the user interacts with the consent banner. No data is sent to Google before the user provides consent, and once consent is given, Google tags load and share consent states. If the user doesn’t consent, no data is sent, and Google tags are fully blocked.

To learn how to set up consent mode in basic and advanced modes, please refer to the article by Google: Set up consent mode on websites.

Enable Google Consent Mode - GDPR Cookie Consent
Enable Google Consent Mode – GDPR Cookie Consent

Other options that can be configured to enhance the performance of Google Consent Mode are:

  • Allow URL data to passthrough – When enabled, data can be passed between webpages for tracking.
  • Enable debug mode – When enabled, the status of the consent parameters is shown in the browser console. This mode allows us to know whether the consent mode is configured correctly. When there is an error in the configuration, the browser console throws an appropriate error message.
Debug mode - Google Consent Mode (GCM)
Debug mode – Google Consent Mode (GCM)
  • Redact ads dataWhen the consent for the advertisement category is withdrawn, the ads data stored previously are removed.

This section allows the default consent to be set by region. By default, the Necessary category is enabled, and all other categories are denied. To modify the behavior:

  1. click on the Add new button.
  2. Select a region under Region.
  3. Set the default consent states for the necessary consent parameters and update the settings.
Default consent states - Google consent modes
Default consent states – Google consent modes