> For the complete documentation index, see [llms.txt](https://docs.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didomi.io/regulations-manager/frameworks/microsoft-consent-mode/microsoft-consent-mode-advanced.md). Agents can also search and read this documentation through its [MCP server](https://docs.didomi.io/~gitbook/mcp).

# Microsoft Consent Mode (Advanced)

{% hint style="success" %}
**Access Type**: Regulations Manager - Editor
{% endhint %}

Microsoft Consent Mode is a framework that ensures Microsoft Advertising Universal Event Tracking (UET) tags comply with an end-user's consent choices. In this article, we will cover:

* [Microsoft Consent Mode (Advanced) overview](#microsoft-consent-mode-advanced-overview)
* [Implement Microsoft Consent Mode (Advanced)](#implement-microsoft-consent-mode-advanced)
* [Test Microsoft Consent Mode (Advanced)](#test-microsoft-consent-mode-advanced)

{% hint style="warning" %}
**Note**: Didomi only supports adding Microsoft Consent Mode (Advanced) as a framework to regulations that utilize vendor as a data collection scope and for websites only.
{% endhint %}

***

### Microsoft Consent Mode (Advanced) overview

In the advanced version of Microsoft Consent Mode, the Universal Event Tracking (UET) tag will still load when an end-user accesses your website (unlike the basic version) and do the following:

* Set default consent status for `ad_storage`. By default, the consent status is set to `denied` unless otherwise configured by your organization. While consent is `denied`, first-party UET cookies are not read and third-party cookies are only read for fraud and spam prevention.
* Wait for end-user interaction with the widget and update consent status of `ad_storage` accordingly. Only when an end-user grants consent to data collection, will first and third-party cookies be read and written for the UET tag.

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FntDsh3IVm6a3sIVAIoeX%2Fmicrosoft-uet-consent-mode-advanced-setup.jpg?alt=media&amp;token=b7b0f8dc-2ee1-4ec3-a316-696f9acb139d" alt=""><figcaption></figcaption></figure>

### Implement Microsoft Consent Mode (Advanced)

In order to successfully implement Microsoft Consent Mode (Advanced) for the regulation, your organization must configure the following:

* [Enable Microsoft Consent Mode (Advanced) for regulation](#enable-microsoft-consent-mode-advanced-for-regulation)
* [Configure UET tag](#configure-uet-tag)

{% hint style="info" %}
[Click here](https://docs.didomi.io/regulations-manager/frameworks/microsoft-consent-mode/microsoft-consent-mode-tcf.md) for more information if your organization plans to utilize Microsoft Consent Mode's integration with the IAB TCF.&#x20;
{% endhint %}

#### Enable Microsoft Consent Mode (Advanced) for regulation

Click **Regulations Manager** on the left-hand panel.&#x20;

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2F1KJmegU3PNHxYs5LL50W%2FScreenshot%202026-09-28%20at%2012.52.45%E2%80%AFPM.png?alt=media&amp;token=e8075a8a-69c6-4686-a7d4-6b840a877bf0" alt="" width="563"><figcaption></figcaption></figure>

Navigate to a regulation that utilizes a data collection scope by vendor on the subsequent table and click the **Edit** icon inline with the regulation name.&#x20;

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FlNcEMAmC8rYph2L3x7hC%2FScreenshot%202026-09-28%20at%201.08.53%E2%80%AFPM.png?alt=media&amp;token=44c900f3-ad63-40a1-bd51-6bc1671d759c" alt="" width="563"><figcaption></figcaption></figure>

Navigate to the **Frameworks** card on the **Global Settings** page. Ensure that **Microsoft Consent Mode** is enabled.

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FqOqnCaRXJTYzOTc5xAo1%2FScreenshot%202026-09-28%20at%202.46.50%E2%80%AFPM.png?alt=media&amp;token=4dbf5be2-ceec-44d1-be3c-88f32c0de29e" alt="" width="563"><figcaption></figcaption></figure>

By enabling the Microsoft Consent Mode framework for the regulation, Didomi will automatically add the following vendor to the regulation:

* Microsoft Advertising (API ID: `microsoft-6zPzfpLt`)

Navigate to the **Vendors & Purposes** tab and use the provided vendor x purpose matrix to configure processing rules, remove one of the purposes, etc... for Microsoft Advertising (API ID: `microsoft-6zPzfpLt`). See [Configure regulation (by vendor)](https://docs.didomi.io/regulations-manager/manage-regulations/configure-regulation-by-vendor.md#vendors-and-purposes) for more information.

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FhLloWzse2OJX07Btnpvz%2FScreenshot%202026-09-29%20at%206.52.45%E2%80%AFAM.png?alt=media&amp;token=f58e22a1-951f-4e60-97d3-1e2cce9dc139" alt="" width="563"><figcaption></figcaption></figure>

Finally, navigate to the **Frameworks** tab and expand the **Microsoft Consent Mode** accordion to configure any details of the framework.

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FB6Cc3RYr9EV8vbJg8scF%2FScreenshot%202026-09-29%20at%206.58.18%E2%80%AFAM.png?alt=media&amp;token=0e3d383d-3f80-47bd-b214-b676a8dd787e" alt="" width="563"><figcaption></figcaption></figure>

Review the table below for information on each toggle in the integration configuration:

<table><thead><tr><th width="295.0001220703125">Toggle</th><th>Description</th></tr></thead><tbody><tr><td>Set the default status of Microsoft Consent mode when page loads</td><td><p>Will set a default consent status for <code>ad_storage</code> prior to the end-user making a consent choice. Unless otherwise configured, the default of this setting is <code>denied</code>.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>Ensure this toggle is <strong>activated</strong> to ensure a default status is set for the basic version.</p></div></td></tr><tr><td>Enable <code>ad_storage</code> before user gives consent</td><td>Will set the default of <code>ad_storage</code> to <code>granted</code> before end-user provides consent choice. </td></tr><tr><td>Enable IAB TCF integration with Microsoft Consent Mode</td><td><a href="https://docs.didomi.io/regulations-manager/frameworks/microsoft-consent-mode/microsoft-consent-mode-tcf.md">Click here</a> for more information on leveraging Microsoft Consent Mode with the IAB TCF.</td></tr></tbody></table>

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FAFQrkk1HEYUfCZ1DN24R%2FScreenshot%202026-10-01%20at%202.26.49%E2%80%AFPM.png?alt=media&amp;token=d6170571-f9c8-4f9f-b942-607c25ec6154" alt="" width="563"><figcaption></figcaption></figure>

Click **Save** when finished to confirm the edits to the regulation.

#### Configure UET tag

Didomi offers multiple ways your organization can implement Microsoft Consent Mode (Advanced) on your website so that your UET tag fires only after an end-user has consented to the Microsoft Advertising vendor. Please see the tabs below for the method that best suits your organization's needs:

{% tabs %}
{% tab title="Direct on-page" %}
In accordance with a Microsoft Consent Mode (Advanced) setup, UET tags will still load when an end-user accesses the website. By default, the consent state for `ad_storage` will be `denied` unless configured otherwise. Only when an end-user grants consent to data collection, will first and third-party cookies be read and written for the UET tag.

In order to ensure UET tags are loaded (and the default status for `ad_storage` exposed) your organization must configure each UET tag to load only once the Didomi SDK is ready and Microsoft Consent Mode is set.

{% hint style="info" %}
Ensure the Didomi script is placed above the UET tag on your page.
{% endhint %}

Utilize the [Didomi `<script>` tag attributes ](https://developers.didomi.io/cmp/web-sdk/third-parties/no-tag-manager)to edit the UET tags on your website to include `type="didomi/javascript"` .

<pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;!-- Didomi -->
&#x3C;script>...&#x3C;/script>

&#x3C;!-- Demo Microsoft UET tag -->
<strong>&#x3C;script type="didomi/javascript">
</strong>  (function (w, d, t, r, u) {
    var f, n, i;
    w[u] = w[u] || [], f = function () {
      var o = { ti: "YOUR_UET_TAG_ID", enableAutoSpaTracking: true };
      o.q = w[u], w[u] = new UET(o), w[u].push("pageLoad");
    }, n = d.createElement(t), n.src = r, n.async = 1, n.onload = n.onreadystatechange = function () {
      var s = this.readyState;
      s &#x26;&#x26; s !== "loaded" &#x26;&#x26; s !== "complete" || (f(), n.onload = n.onreadystatechange = null);
    }, i = d.getElementsByTagName(t)[0], i.parentNode.insertBefore(n, i);
  })(window, document, "script", "//bat.bing.com/bat.js", "uetq");
&#x3C;/script>
</code></pre>

{% endtab %}

{% tab title="Google Tag Manager" %}
{% hint style="warning" %}
**Note**: This section assumes that your organization has already embedded the Google Tag Manager tag onto your website.
{% endhint %}

In order to ensure UET tags are loaded (and the default status for `ad_storage` exposed) your organization must configure UET tags to load once the Didomi SDK is ready and Microsoft Consent Mode is set.

From your organization's Google Tag Manager workspace, navigate to your UET tag and edit the trigger.

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FhvLRGjJQeOa1rwZDQcAD%2FScreenshot%202026-10-01%20at%2011.32.56%E2%80%AFAM.png?alt=media&amp;token=4dbbe353-4095-45d1-9090-8962a8aeea97" alt="" width="563"><figcaption></figcaption></figure>

Use the Google Tag Manager workflow to configure a new trigger for the UET tag with the following fields:

<table><thead><tr><th width="202">Field</th><th>Value</th></tr></thead><tbody><tr><td>Trigger Type</td><td>Custom Event</td></tr><tr><td>Event name</td><td><a href="https://developers.didomi.io/cmp/web-sdk/third-parties/tags-management/events-and-variables"><code>didomi-ready</code></a></td></tr><tr><td>This trigger fires on</td><td>All Custom Events</td></tr></tbody></table>

<figure><img src="https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2FR7wQrS4NvOT8EtGzPGp0%2FScreenshot%202026-07-29%20at%2011.54.17%E2%80%AFAM.png?alt=media&amp;token=0e4ea705-9328-42d2-981e-c29708ff8c98" alt="" width="563"><figcaption></figcaption></figure>

When finished, **Save** the trigger and tag setup. **Submit** your Google Tag Manager container changes aligned with your organization's policies.
{% endtab %}
{% endtabs %}

### Test Microsoft Consent Mode (Advanced)

When successfully and appropriately configured, a Microsoft Consent Mode (Advanced) implementation will trigger UET tags but with the consent state of `ad_storage` defaulted to `denied` unless otherwise configured.&#x20;

When testing the Microsoft Consent Mode (Advanced) implementation, your organization will want to confirm three actions :

* UET tags load with `ad_storage` defaulted to `denied` unless configured otherwise
* UET tags update to show `ad_storage` set to `denied` due to end-user choice
* UET tags update to show `ad_storage` set to `granted` due to end-user choice

How your organization tests that UET tag(s) are triggering as expected of a Microsoft Consent Mode (Advanced) setup is dependent on how you configured the implementation on the regulation:

Review the tabs below for how to test your Microsoft Consent Mode implementation based on the tools available to your organization:

{% tabs %}
{% tab title="Browser console" %}
Navigate to the **Console** tab of your browser's Developer Tools and utilize `window.uetq` to check the firing of UET tags and that the `ad_storage` value is appropriately set in alignment with end-user choices.
{% endtab %}

{% tab title="UET Tag Helper" %}
{% hint style="info" %}
[Click here](https://help.ads.microsoft.com/apex/index/3/en/60119) for additional information on utilizing UET Tag Helper to validate your organization's Microsoft Consent Mode implementation.
{% endhint %}

Download UET Tag Helper extension on your choice of browser and use the extension to inspect the `asc` parameter within UET events. This parameter indicates the consent status of the end-user.
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.didomi.io/regulations-manager/frameworks/microsoft-consent-mode/microsoft-consent-mode-advanced.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
