Upgrade your plan

  • Network analysis
  • Unlimited Data retention
  • Up to 15 websites
  • API
  • Custom properties
  • Up to 15 users team

Subscribe to our social networks

arrow icon All Post

How to configure GA4 for Consent Mode V2 using Google Tag Manager

Mar 19, 2024 | Author: Info Publytics

How to configure GA4 for Consent Mode V2 using Google Tag Manager

In this article, we will discuss the key points of Consent Mode v2 and what you have to configure in GA4 (using Google Tag Manager).

Consent Mode v2 is a powerful feature in Google Analytics 4 (GA4) that allows websites and apps to better understand and track user behavior even when users decline consent for analytics cookies. Here's the details:

  1. Behavioral Modeling for Consent Mode:

    When you implement a consent banner or widget on your website or app, Analytics may miss data from users who opt out. Behavioral modeling for consent mode uses machine learning to estimate the behavior of users who decline analytics cookies based on the behavior of similar users who accept them.This modeled data helps you gain insights from your Analytics reports while respecting user privacy. For instance, it estimates data based on user metrics like daily active users, conversion rates, and user journeys.
  2. Observable Data vs. Modeled Data:

    Observable data comes from users who have given Analytics permission to observe their behavior. When  a user doesn’t grant consent, events are not associated with a persistent user identifier.
    Behavioral modeling estimates the behavior of non-consenting users based on similar consenting users. It bridges the gap when identifiers like cookies or user IDs are not fully available.
  3. Google’s Approach:

    Google’s behavioral modeling follows best practices:
    Accuracy and Changes: Holdback validation ensures model accuracy. Google communicates significant changes that impact your data.
    Rigorous Reporting: Behavioral modeling is included only when there’s high confidence in model quality. If there’s insufficient consented traffic, events triggered by users who decline consent aren’t reported.
  4. Why Configure GA4 to Consent Mode v2?:

    Data Continuity: Even when users decline consent, behavioral modeling provides insights, allowing you to optimize conversions and analytics.Google Ads Integration: To integrate GA4 data with Google Ads, Consent Mode v2 is essential. It influences how Google Ads and audiences operate.

How to configure GA4 for Consent Mode:

1. Access Google Tag Manager: Log in to your Google Tag Manager account.

2. Enable Consent Overview: Go to 'Container Settings' from the Admin dashboard and enable Consent Overview in Additional Settings.

3. Configure Tags: In the Tags section, click on the Consent Icon and configure your tags under 'Consent Not Configured' and 'Consent Configured' sections.

4. Import Container: We suggest to import a preconfigured container, like the one from LoveData, so go to Admin, select Import Container, and import it.

5. Choose Workspace: Select your Default Workspace and choose to overwrite conflicting tags, triggers, and variables.

6. Modify Tracking Tags: Go to 'Tags', modify the GA4 configuration tag by setting 'Require Additional Consent For Tag To Fire', than enter ‘analytics_storage’ in the blank field. You may use this process for any tag that you feel requires user consent.
You can copy this code and inject it into the GTM container above its default code:

<script>
  window.dataLayer = window.dataLayer ||[];
  function gtag()
  gtag('consent','default',{
  'ad_storage':'denied',
  'analytics_storage':'denied',
  'personalization_storage':'denied'
  });
  gtag("set", "ads_data_redaction", true);
</script>  

7. Test Setup: Enter Preview Mode to test if the cookie banner loads, and verify tag status in Google Tag Manager after giving consent on the website.

Nowdays, compliance with regulations and respecting user autonomy are no longer optional but essential. Implementing measures like consent mode not only builds trust with visitors but also helps mitigate risks associated with non-compliance. If you need a cookieless and privacy-friendly web analytics tool to stay ahead of future changes on this regulations we suggest to try Publytics.

 


Posted: 9 months ago
Author: Info Publytics

Recent Posts

bg img

    Are you looking for a complete tool to measure your website's progresses? Get deep into Publytics with our 14 Days of free trial!

  • Try it for free