Google Consent Mode V2 GTM Magento 2

In today’s privacy-focused world, ensuring user consent for data collection is crucial. Google Tag Manager (GTM) offers a powerful tool to navigate this landscape: Consent Mode. This post dives into how you can leverage GTM Consent Mode within Magento to manage user consent effectively and comply with relevant regulations. Google enforces Consent Mode v2 for specific websites and apps starting March 2024.

GTM Consent Mode empowers you to control how your Google tags (e.g., Google Analytics, Google Ads) interact with user consent. It provides two levels of control:

  • Basic Mode: Tags only fire when users grant consent.
  • Advanced Mode:
    • Collects additional signals from users who deny consent for data collection.
    • Utilizes these signals for conversion modeling in Google Ads and visitor behavior analysis in Google Analytics 4.
    • Offers advanced features like setting data sharing preferences and region-specific behavior.
  • Compliance: Ensures compliance with various data privacy regulations like GDPR and CCPA.
  • Transparency: Empowers users with control over their data by respecting their consent choices.
  • Enhanced Data Modeling: In Advanced Mode, even without direct consent, you can gain valuable insights through conversion modeling and behavior analysis.
  1. Enable Consent Mode: Navigate to Admin > Container Settings > Additional settings and enable “Enable consent overview.”
  2. Configure Consent Tags: Set up tags to collect user consent preferences (e.g., using a consent management platform).
  3. Define Consent Conditions: In your GTM tags, use triggers that fire only when specific consent conditions are met.
  4. Advanced Configuration (Optional): Explore advanced features like consent signals for non-consenting users and data redaction functionalities.
Enable Consent Overview in GTM
Click to set consent mode setting for all your tags based on customer selection

This template simplifies the process of implementing Consent Mode v2 in GTM. It includes features like:

  • Sending default consent commands to set initial consent states.
  • Updating consent states based on user interaction with a consent management platform (CMP).
  • Defining granular consent configurations for different regions.

This template offers a more basic approach to Consent Mode. It allows you to:

  • Set default consent states for various consent types (e.g., ad storage, analytics storage).
  • Choose whether to send a default command (setting initial consent) or an update command (based on user interaction).

This template is provided by Commanders Actuate, a Consent Management Platform (CMP). It offers a comprehensive solution for managing user consent in GTM, including features like:

  • Sending default consent commands to set initial consent states.
  • Updating consent states based on user interaction with the Commanders Actuate CMP.
  • Defining granular consent configurations for different regions.
  • Managing consent withdrawals and preferences over time.

This template is provided by OneTrust, another leading CMP provider. It allows you to integrate your OneTrust CMP with GTM for seamless consent management, including:

  • Sending consent signals from OneTrust to GTM based on user choices.
  • Firing tags only when specific consent conditions are met.
  • Accessing advanced consent features like preference centers and consent logging.

This template is provided by Usercentrics, a CMP that helps businesses comply with global privacy regulations. It enables you to:

  • Capture user consent preferences through the Usercentrics CMP.
  • Send consent signals to GTM for tag firing control.
  • Leverage features like purpose-specific consent and data retention controls.
  • Enable Consent Mode: Navigate to GTM > Admin > Container Settings > Additional settings and enable “Enable consent overview.”
  • Install Cookie Popup Extension or third party tools like Cookie Bot
  • Add Tag Template Navigate to GTM > Templates > Tag Templates > and addConsent Mode Google Tag” template
  • Add Variable Template Navigate to GTM > Templates > Variable Templates > and add “GTM Consent State” template
  • Setup cookies on the frontend of your website based on the following categories
Consent Type Description
ad_storage Enables storage (such as cookies) related to advertising.
ad_user_data Sets consent for sending user data related to advertising to Google.
ad_personalization Sets consent for personalized advertising.
analytics_storage Enables storage (such as cookies) related to analytics e.g. visit duration.

In addition to the consent mode parameters, there are the following privacy parameters:

Storage Type Description
functionality_storage Enables storage that supports the functionality of the website or app e.g. language settings.
personalization_storage Enables storage related to personalization e.g. video recommendations
security_storage Enables storage related to security such as authentication functionality, fraud prevention, and other user protection.
Cookies on the frontend of the website

Once the customer has given consent for each category it will create cookies based on the customer selection which can be read within GTM as 1st party cookie variable

  • Create 1st party cookie variable for each category: Example shown below for creating 1st party cookie variable for marketing cookie but you need to do this for each category
  • Now create custom javascript variable for each category: This should return either granted or denied based on user selection on the frontend. Example shown below for custom javascript variable for marketing cookie but you need to do this for each category
  • Create “Consent Mode Google Tag”: Create “Consent Mode (Google Tag)” under tags and choose our newly created custom javascript variables as shown below.
  • Associate user consent with tags: Now associate user consent with each tag depending on whether they marketing tags or statistic tags. Example shown below for GA4 tag

Preview Mode

First time everything will be denied as shown below unless customer chooses to accept each categories of the cookies

When they accept cookies for each category on the frontend then everything will be granted as shown below

Pass Through URLs

Similarly, if analytics_storage is set to denied, URL passthrough can be used to send event and session-based analytics (including conversions) without cookies across pages.

The following conditions must be met in order to use URL passthrough:

However, if ad_storage is set to denied, this information will not be stored locally. To improve ad click measurement quality when ad_storage is denied, you can optionally elect to pass information about ad clicks through URL parameters across pages using URL passthrough.

When a user lands on your website after clicking an ad, information about the ad may be appended to your landing page URLs as a query parameter. In order to improve conversion accuracy, this information is usually stored in first-party cookies on your domain.

  • Your Google tag is consent-aware and present on the page.
  • The advertiser has enabled the URL passthrough feature.
  • Consent mode is implemented on the page.
  • The outgoing link refers to the same domain as the current page’s domain.
  • A GCLID or DCLID is present in the URL (Google Ads and Floodlight tags only)

Redact Ads Data

When ad_storage is denied, no new cookies are set for advertising purposes. Additionally, third-party cookies previously set on google.com and doubleclick.net won’t be used. Data sent to Google will still include the full page URL, including any ad click information in the URL parameters.

To further redact your ads data when ad_storage is denied, set ads_data_redaction to true.

When ads_data_redaction is true and ad_storage is denied, ad click identifiers sent in network requests by Google Ads and Floodlight tags will be redacted.

In conclusion, our Magento 2 GTM pro / Magento 1 GTM pro and Magento 2 GDPR / Magento 1 GDPR modules provide a complete solution for managing consent mode within GTM, ensuring a smooth user experience and regulatory compliance. These modules are ready to use as soon as you purchase them. They configure themselves automatically which no manual intervention apart from importing GA4 json file in your GTM container, just like plug and play. Allows you to respect the consent and preferences of your customers and comply with the GDPR and ePrivacy regulations, while enhancing the customer experience and performance of your website.

Similar Posts