/ /

Microsoft UET Consent Mode

Updated 4 months ago

Overview

Microsoft's Universal Event Tracking (UET) Consent Mode allows businesses to track user interactions while ensuring compliance with privacy laws like GDPR and CCPA. This guide explains how to implement UET Consent Mode using Osano’s Consent Management Platform (CMP).

Prerequisites

  • Osano’s Consent Management Platform (CMP) is set up on your website.

  • Microsoft UET tracking tags are already implemented on your website.

Set up Workflow & Best Practices

Execution Order on Your Website:

  1. Osano.js – Manages consent changes and updates.

  2. The UET Consent Default– Sets default consent.

  3. Your Microsoft Container(s) – Ensures Microsoft responds appropriately to consent changes.

IMPORTANT: If you are using Google Tag Manager and Google Consent Mode, the following behavior can be set up using Google Consent Mode rather than any additional custom coding. Refer to Example 3 in the Microsoft documentation. Osano's Google Consent Mode docs can be found HERE. 

Stand-alone Steps to Implement UET Consent Mode with Osano

1. Load the Osano.js

After creating and publishing your configuration in Osano, the Get Code button will be available. This provides the osano.js code needed to install Osano on your website.

image.png

2. Install the following Script to set defaults below the Osano script

Start by setting the default consent state to "denied" for tracking purposes. This ensures that no tracking takes place unless the user explicitly grants consent.

<script>  
// Osano Script Initialization  
(function(w, o, d) {  
w[o] = w[o] || function() { w[o][d].push(arguments) };  
w[o][d] = w[o][d] || [];  
})(window, 'Osano', 'data');  
  
// UET Consent Mode Script  
window.uetq = window.uetq || [];  
window.uetq.push('consent', 'default', { ad_storage: 'denied' });  
  
window.Osano('onConsentSaved', function(consent) {  
if (consent.MARKETING === 'ACCEPT') {  
window.uetq.push('consent', 'update', { ad_storage: 'granted' });  
} else {  
window.uetq.push('consent', 'update', { ad_storage: 'denied' });  
}  
});  
</script>

3. Embed UET Tag

Ensure that the UET tag is implemented on your website, with the pixel_id properly set to your unique tracking ID.

4. Test the Implementation

Once the UET Consent Mode integration is complete, test to ensure that consent preferences are being respected. You can use tools like the browser console or UET Tag Helper to verify that the tags are firing correctly based on the user’s consent.


Testing

After implementing the script, verify that the UET tag fires based on user consent. You can use the UET Tag Helper or browser console to check that the appropriate consent values are being set and respected.


Important: Choose Between Consent Mode and IAB TCF

Customers must choose between Consent Mode or IAB TCF for handling user consent signals. Both should not be used simultaneously.

  • Consent Mode for UET or IAB TCF can be implemented, but only one should be used at a time.

This ensures compliance with privacy regulations, such as GDPR, while allowing for continued ad tracking.

Was this article helpful?
Subscribe to receive updates on this article