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).
Osano’s Consent Management Platform (CMP) is set up on your website.
Microsoft UET tracking tags are already implemented on your website.
Execution Order on Your Website:
Osano.js – Manages consent changes and updates.
The UET Consent Default– Sets default consent.
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.
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.
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>Ensure that the UET tag is implemented on your website, with the pixel_id properly set to your unique tracking ID.
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.
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.
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.