Skip to main content
Google and Microsoft both introduced a framework called Consent Mode. It acts like a translator between your cookie banner and their tracking tools, adjusting what data gets collected based on the user’s consent. This guide shows how to implement Consent Mode when using Converge.
This guide describes how to implement Google and Microsoft Consent Mode. Converge has additional tools for handling consent for all your destinations that you can read about here.

Consent Mode allows you to respect users’ privacy preferences while still collecting meaningful data for analytics and advertising. Without it, you risk either violating privacy laws or losing valuable insights and attribution information.
Even though both frameworks are called “Consent Mode” and work similarly, they’re separate. If you use products from both companies, you’ll need to implement both frameworks. Google and Microsoft Consent Mode have the same basic requirements:
  1. Default: Set a default consent status for all users before they interact with your cookie banner. You can customize defaults per country.
  2. Update: When a user makes a choice on your cookie banner, update the Consent Mode status to match.
Consent Mode requires you to set statuses for different types of consent. These affect how tracking behaves.
Consent typeDescriptionRequired by GoogleRequired by Microsoft
ad_storageAllows storage (like cookies) for advertisingYesYes
ad_user_dataSets consent for sending user data related to adsYesNo
ad_personalizationSets consent for personalized adsYesNo
analytics_storageAllows storage (like cookies) for analyticsYesNo
Microsoft currently only requires ad_storage. You can still set the others in case they expand support later.
You can extend Consent Types, but Google and Microsoft tracking tools won’t use them. Examples: functionality_storage, personalization_storage, security_storage. These add no value for tracking today.
When you’ve implemented Consent Mode correctly, the tracking products from Google and Microsoft will automatically adjust their tracking behavior based on the consent that has been given. A few examples are:
  • analytics_storage granted: GA4 web tracking will place cookies and process IP addresses.
  • analytics_storage denied: GA4 web tracking won’t use cookies or process IP addresses but will send cookieless pings used in behavioral modeling.
  • ad_storage granted: Google Ads web tracking will place cookies and process click IDs in the URL.
  • ad_storage denied: Google Ads web tracking won’t use cookies or process click IDs in the URL but will send cookieless pings used in conversion modeling.
For a full description on how Consent Mode impacts tracking behavior, you can read this documentation for Google Consent Mode
and this documentation about Microsoft Consent Mode
.
As Google Consent Mode and Microsoft Consent Mode will impact behavior of its tracking based on the users’ consent, you don’t have to set up additional consent settings in Converge. It’s best practice to always load Google and Microsoft destinations from Converge, regardless of consent given. Read more about it here.
If you implement Consent Mode after previously tracking users without it, you may see a drop in tracked users or conversions in your Google or Microsoft products.

The Google and Microsoft destinations in Converge (like GA4, Google Ads, Microsoft Ads) respect Consent Mode settings automatically, but Converge doesn’t set them for you. You have two options:
  • Consent Management Platform (CMP): Many CMPs (like Cookiebot, CookieYes, OneTrust) offer Consent Mode support out of the box.
  • Custom implementation: You can implement Consent Mode manually with developer help.

Key requirements

For Converge to work with your Consent Mode setup:
  1. Set the default consent mode before the Converge JavaScript pixel loads.
  2. Set the update consent mode (if the user already gave consent) after the default but still before the Converge pixel loads.

Examples

You can use the following examples to implement Consent Mode for Converge.
Cookiebot has built-in support for Consent Mode but you need to set a default consent status yourself, prior to implementing Cookiebot and Converge.Add this code before the Converge pixel in the <head> of your website. It:
  • Sets different default statuses for NL, EU, and non-EU countries for Google Consent Mode and Microsoft Consent Mode.
  • Adds the Cookiebot script to handle updates when a user gives consent or has done so previously.
<script data-cookieconsent="ignore">
    //Set default Google Consent Mode status
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "granted",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
        region: ['NL']
    });
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "denied",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
        region: ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','PL','PT','RO','SK','SI','ES','SE','NO','IS','LI']
    });
    gtag("consent", "default", {
        ad_personalization: "granted",
        ad_storage: "granted",
        ad_user_data: "granted",
        analytics_storage: "granted",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
    });
    gtag("set", "ads_data_redaction", false);
    gtag("set", "url_passthrough", true);

    //Set default Microsoft Consent Mode status
    window.uetq = window.uetq || [];
    window.uetq.push('consent', 'default', {
        'ad_storage': 'denied',
        'wait_for_update': 500
    });
</script>
//Add Cookiebot script
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="[REPLACE WITH YOUR COOKIEBOT ID]"  type="text/javascript"></script>
CookieYes has built-in support for Consent Mode but you need to set a default consent status yourself, prior to implementing CookieYes and Converge.Add this code before the Converge pixel in the <head> of your website. It:
  • Sets different default statuses for NL, EU, and non-EU countries for Google Consent Mode and Microsoft Consent Mode.
  • Adds the CookieYes script to handle updates when a user gives consent or has done so previously.
<script>
    //Set default Google Consent Mode status
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "granted",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
        region: ['NL']
    });
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "denied",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
        region: ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','PL','PT','RO','SK','SI','ES','SE','NO','IS','LI']
    });
    gtag("consent", "default", {
        ad_personalization: "granted",
        ad_storage: "granted",
        ad_user_data: "granted",
        analytics_storage: "granted",
        functionality_storage: "granted",
        personalization_storage: "granted",
        security_storage: "granted",
        wait_for_update: 500,
    });
    gtag("set", "ads_data_redaction", false);
    gtag("set", "url_passthrough", true);

    //Set default Microsoft Consent Mode status
    window.uetq = window.uetq || [];
    window.uetq.push('consent', 'default', {
        'ad_storage': 'denied',
        'wait_for_update': 500
    });
</script>
//Add CookieYes script
<script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/[REPLACE WITH YOUR COOKIEYES WEBSITE KEY]/script.js" ></script>
You can use this code as a basis for your custom implementation. It does not integrate with any cookie banner and it is not set up to process an update with different values for the Consent Types.Add this code before the Converge pixel in the <head> of your website. It:
  • Sets default consent statuses for Google Consent Mode and Microsoft Consent Mode.
  • Includes an updateConsent function to call when a user accepts all cookies or has done previously.
<script data-cookieconsent="ignore">
    //Set default Google Consent Mode status
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "granted",
        wait_for_update: 500,
        region: ['NL']
    });
    gtag("consent", "default", {
        ad_personalization: "denied",
        ad_storage: "denied",
        ad_user_data: "denied",
        analytics_storage: "denied",
        wait_for_update: 500,
        region: ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','PL','PT','RO','SK','SI','ES','SE','NO','IS','LI']
    });
    gtag("consent", "default", {
        ad_personalization: "granted",
        ad_storage: "granted",
        ad_user_data: "granted",
        analytics_storage: "granted",
        wait_for_update: 500,
    });
    gtag("set", "ads_data_redaction", false);
    gtag("set", "url_passthrough", true);

    //Set default Microsoft Consent Mode status
    window.uetq = window.uetq || [];
    window.uetq.push('consent', 'default', {
        'ad_storage': 'denied',
        'wait_for_update': 500
    });

    function updateConsent(){
        gtag("consent", "default", {
            ad_personalization: "granted",
            ad_storage: "granted",
            ad_user_data: "granted",
            analytics_storage: "granted",
        });
        
        window.uetq.push('consent', 'update', {
            'ad_storage': 'granted'
        });
    }
</script>
If you want to always enable full tracking features in Google and Microsoft tracking you can set a default consent status that sets all Consent Types to granted. As all Consent Types are set to granted by default, you don’t have to sent an update.Add this code before the Converge pixel in the <head> of your website. It:
  • Sets default consent statuses for Google Consent Mode and Microsoft Consent Mode with all Consent Types as granted.
<script data-cookieconsent="ignore">
    //Set default Google Consent Mode status
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }
    gtag("consent", "default", {
        ad_personalization: "granted",
        ad_storage: "granted",
        ad_user_data: "granted",
        analytics_storage: "granted",
    });
    gtag("set", "ads_data_redaction", false);
    gtag("set", "url_passthrough", true);

    //Set default Microsoft Consent Mode status
    window.uetq = window.uetq || [];
    window.uetq.push('consent', 'default', {
        'ad_storage': 'granted',
        'wait_for_update': 500
    });
</script>

You can also configure which destinations in Converge will load by using the Consent settings for each destinations. Since Consent Mode is already handling how products from Google and Microsoft will behave based on consent given by the user, it is best practice to not enable any additional restrictions in Converge. For the best results, you configure consent as follows:
  • Choose the Analytics or Marketing category based on the type of destination.
  • Set the Consent mode setting to Off.
img

Verify your implementation

You can validate your Google Consent Mode implementation by following these docs. You can validate your Microsoft Consent Mode implementation by following these docs.
Disclaimer: This guide provides general information. It is not intended as legal advice, and readers should consult with qualified counsel for advice regarding their specific circumstances. Converge disclaims any liability for actions taken based on the information provided in this post.
I