Skip to main content

Microsoft UET Consent mode

Manon Manso avatar
Written by Manon Manso
Updated over a week ago

If you use Microsoft's Universal Event Tracking (UET) for conversion tracking, you will now be required to set up consent verification through the use of a TCF-compliant cookie banner or via UET's Consent mode.

For Axeptio for Publishers (TCF banner) users:

First of all, you will need to list Microsoft (IAB vendor ID 1126) and Xandr (IAB vendor ID 32) in your cookie banner.

To do so, enter your banner configuration and click on "Select your vendors" :

Then, search and add Microsoft and Xandr in our vendors list :

Now that they're added, you'll have to activate related consent stacks by clicking on "Select stacks" in the top-right corner on the same screen.

The needed stacks for Microsoft and Xandr are stacks 1, 2, 3, 4, 7, 9 and 10.

You can now click "Save and quit", and publish your project and configuration to push your modifications live.

You are now all set up, Microsoft tags will automatically read the consent based on the stacks and vendors you added.

For Axeptio for Brands users:

First, make sure that Microsoft Advertising is listed in your cookie banner.

If it is not, you can add it at the step of your choice: How to add a new Cookie in my tags list ?

Once Microsoft Advertising is listed, you will need to add the Consent mode management code.

Here it is:

<script> 
// Initializing UET Consent Mode
window.uetq = window.uetq || [];
window.uetq.push("consent", "default", { ad_storage: "denied", });

// Updating consent
// Based on choices in the Axeptio banner
void 0 === window._axcb && (window._axcb = []);
window._axcb.push(function (axeptio) {
axeptio.on("cookies:complete", function (choices) {
if (choices.microsoft) {
window.uetq.push("consent", "update", { ad_storage: "granted", });
}
else{
window.uetq.push("consent", "update", { ad_storage: "denied", });
}
});
});
</script>

You can add this code directly in the <head> of your website, or in a custom HTML tag via Google Tag Manager for example, that you can trigger on "Consent Initialization - All Pages".

🚧 For your UET tag to properly take into account Consent mode, it is important that this script is loaded before the UET tag.

Did this answer your question?