Skip to main content
Back to Guides
Compliance9 min readBy Armin Zaribaf

Microsoft Consent Mode: Setting Up Clarity and Bing Ads Together

Set up Microsoft Consent Mode for both Clarity and Bing Ads in one go. Covers how consent signals work, what happens when visitors decline, and how CookieBeam handles it automatically alongside Google Consent Mode v2.

Microsoft Consent Mode is a consent signaling framework that tells Microsoft products (Clarity and Bing Ads) whether a visitor has granted or denied permission for analytics and advertising cookies. It works the same way Google Consent Mode v2 does for GA4 and Google Ads: your consent banner collects the visitor's choice, and the tags on your site adjust their behavior based on that choice.

Without consent mode, you have two options when a visitor declines cookies: either fire the tags anyway (and violate privacy regulations) or block them entirely (and lose all data for that visitor). Consent mode gives you a third option: the tags still load, but they operate in a restricted way that doesn't set cookies or collect personal data.

Microsoft rolled out consent mode support in phases. Clarity added it first, and Bing Ads UET (Universal Event Tracking) followed. Both now accept consent signals, each through its own API, so one banner decision can drive both.

Clarity is a session recording and heatmap tool. When it runs without consent, it captures mouse movements, clicks, scroll depth, and page content, including form field interactions. That's personal data under GDPR and most other privacy laws.

With consent mode enabled, Clarity checks the analytics_Storage signal it receives through its consentv2 API before it starts recording. If the visitor hasn't consented:

  • No session recording starts
  • No heatmap data is collected
  • No cookies are set by Clarity
  • The Clarity script still loads (so it can start immediately if consent is later granted) but it doesn't do anything observable

Once the visitor grants analytics consent, Clarity begins recording from that point forward. It won't retroactively capture what happened before consent was given.

If you're using Clarity's integration with Bing Ads, the advertising signals matter too. Clarity can feed behavioral data into your Bing Ads campaigns for audience building, but that pathway requires ad_Storage consent as well.

Bing Ads uses Universal Event Tracking (UET) to measure conversions and build remarketing audiences. UET takes a single consent signal, ad_storage, through its own queue: window.uetq.push('consent', 'default' | 'update', { 'ad_storage': 'granted' | 'denied' }). When ad_storage is denied, UET won't write or read advertising cookies for conversion tracking or remarketing.

In practice, most consent banners map the "advertising" or "marketing" category to this signal. If a visitor declines marketing cookies, UET receives ad_storage: 'denied'.

When the signal is denied, UET operates in a limited mode. It can still send pings to Microsoft's servers with basic page information, but those pings won't be associated with a cookie identifier. Microsoft uses this data for aggregate conversion modeling, similar to how Google uses cookieless pings for conversion modeling in Google Ads.

Consent signal behavior by product
SignalClarity behavior when deniedBing Ads UET behavior when denied
analytics_storage (Clarity: analytics_Storage)No session recording, no heatmaps, no cookiesNo effect (UET doesn't use this signal)
ad_storage (Clarity: ad_Storage)Audience data not shared with Bing AdsNo cookies set, limited-mode pings only
ad_personalizationNo effect (Clarity doesn't use this signal)No effect (UET reads only ad_storage)

Like Google Consent Mode v2, Microsoft Consent Mode expects you to set a default consent state before any tags fire. This tells the Microsoft tags how to behave in the gap between page load and the moment the visitor makes a choice on your banner.

For visitors in the EEA, the default should deny everything. Each product needs its own default call, and the visitor's choice then goes to each product's own API. This snippet does both:

microsoft-consent.html

Bing Ads UET does not read Google's gtag('consent', ...) state. Its default and updates go through its own uetq queue, and the default push has to be queued before the UET tag loads, because UET treats ad_storage as granted until it is told otherwise. Clarity has its own consentv2 API with capital-S keys (ad_Storage, analytics_Storage). The older clarity('consent', true/false) call carries only one signal, so use consentv2.

The listener reads event.detail.categories from two CookieBeam events: cookiebeam:consentUpdate (a choice made on this page) and cookiebeam:consentRestored (a stored choice re-announced on a later page view). It maps the marketing category to ad_storage and ad_Storage, and the analytics category to analytics_Storage. Without the restored listener, a returning visitor's choice reaches Microsoft only on the page where it was made.

This is the key difference from Google: Google and Microsoft need separate consent calls. One banner decision can drive both, but a gtag consent update alone leaves UET and Clarity on their own defaults.

If you're using CookieBeam as your consent management platform, its vendor consent bridges send the Microsoft calls for you. Here's what happens behind the scenes:

  1. Page loads: CookieBeam sets the Google Consent Mode default through gtag. With the Microsoft Ads (UET) signal on, it also queues uetq.push('consent', 'default', { 'ad_storage': ... }) for the visitor's region before UET loads. Clarity gets no default from CookieBeam and keeps its own regional default until the first consentv2 call.
  2. Banner appears: The visitor sees your cookie banner with category choices (necessary, analytics, marketing, preferences).
  3. Visitor chooses: When they accept or customize their preferences, CookieBeam fires cookiebeam:consentUpdate with each signal set to granted or denied.
  4. Bridges react: The UET bridge pushes uetq.push('consent', 'update', { 'ad_storage': ... }). The Clarity bridge calls clarity('consentv2', { 'ad_Storage': ..., 'analytics_Storage': ... }). On later page views, the stored choice is sent again through cookiebeam:consentRestored.

You don't need to write any custom JavaScript for this, as long as Microsoft Ads (UET) and Microsoft Clarity are switched on under Vendor Consent Signals in your banner's App Integrations (both are on by default). CookieBeam maps its cookie categories to consent signals like this:

CookieBeam category to consent signal mapping
CookieBeam categoryConsent signals set to 'granted'
Necessaryfunctionality_storage, security_storage
Analyticsanalytics_storage
Marketingad_storage, ad_user_data, ad_personalization
Preferencespersonalization_storage

Setup steps

1

Install CookieBeam on your site

Add the CookieBeam script to your site's <head> section. It should load before any Microsoft or Google tags. See the banner setup guide for detailed instructions.

2

Check the Microsoft vendor consent signals

In the CookieBeam dashboard, open your banner's App Integrations and check that Microsoft Ads (UET) and Microsoft Clarity are switched on under Vendor Consent Signals. These are separate from Google Consent Mode v2: Google's gtag consent state doesn't reach UET or Clarity.

3

Add your Clarity project

Install Clarity's tracking script after the CookieBeam script. CookieBeam's Clarity bridge sends consentv2 calls, and if Clarity hasn't loaded yet it queues them for Clarity to replay. Don't add your own clarity('consent', ...) calls alongside the bridge.

4

Add your Bing Ads UET tag

Install UET the same way. If you're using Google Tag Manager, add the UET tag with a consent trigger. If you're using the script directly, place it after the CookieBeam script. CookieBeam's UET bridge pushes its consent commands to the same window.uetq queue the UET tag reads, so you don't need to change the UET snippet.

5

Test the integration

Clear your cookies and reload. The banner should appear. Before you interact with it, open your browser's Network tab and verify that Clarity isn't sending recording data and UET isn't setting cookies. Then accept all cookies and confirm both tools start working.

Most websites run both Google and Microsoft tags. The signal names match (ad_storage, analytics_storage), but the APIs don't: Google tags read gtag('consent', ...), UET reads uetq.push('consent', ...), and Clarity reads clarity('consentv2', ...).

CookieBeam drives all three from one visitor decision: Google Consent Mode through gtag, and the Microsoft bridges through their own APIs, all from the same cookiebeam:consentUpdate event. You don't need separate consent flows for each vendor.

The thing to watch out for: if Google Tag Manager or your own code also sends Microsoft consent commands, they can conflict with the bridges. Use either the bridges or your own calls, not both.

Verifying Your Setup

After implementation, verify that consent mode is working correctly:

  • Clarity dashboard: Check your Clarity project's settings page. It should show "Consent Mode: Active" if it's detecting the consent signals.
  • Browser DevTools: In the Network tab, filter for requests to clarity.ms. Before consent, you should see the initial script load but no recording data. After consent, recording payloads should start flowing.
  • Bing Ads: In the UET tag helper browser extension, verify the tag shows the correct consent state. It should display "Consent: Denied" before banner interaction and update after the visitor consents.
  • CookieBeam dashboard: Check your consent analytics. The consent rate for the analytics and marketing categories tells you what percentage of visitors are opting in to Clarity and Bing Ads tracking respectively.

Frequently Asked Questions

Does Microsoft Consent Mode work the same as Google Consent Mode v2?

The signals are similar, but the APIs are separate. Google tags read gtag('consent', ...). UET reads uetq.push('consent', ...) with a single ad_storage signal. Clarity reads clarity('consentv2', ...) with ad_Storage and analytics_Storage. If you're using a CMP like CookieBeam that supports all three, one banner decision is sent to each.

Do I need Microsoft Consent Mode if I'm only using Clarity (not Bing Ads)?

Yes. Clarity records session data including mouse movements, clicks, and page content. Under GDPR and similar laws, that's personal data processing that requires consent. Without consent mode, you'd need to completely block Clarity for non-consenting visitors, losing all data. With consent mode, the script stays loaded and starts recording the moment consent is granted.

What data does Bing Ads still collect when consent is denied?

In limited mode, UET sends basic pings without cookie identifiers. Microsoft uses these for aggregate conversion modeling, which helps preserve some campaign measurement even for visitors who decline cookies. No personal data or cross-site tracking occurs in this mode.

Can I use Microsoft Consent Mode without Google Consent Mode v2?

Yes. UET and Clarity take their own consent calls, so they work without gtag. In CookieBeam, Microsoft Ads (UET) and Microsoft Clarity are separate vendor consent signal toggles from Google Consent Mode v2.

Next Steps

Once your Microsoft Consent Mode setup is working, consider these follow-ups:

7 min read

GPP, MSPA & US State Signals: A Publisher's Guide

The US Privacy String you built for CCPA was deprecated in January 2024. GPP, the US National string, and the MSPA replaced it, and getting the signal wrong can be a misrepresentation. Here's how the new US privacy signals move through the ad stack.

5 min read

Building a TCF CMP That Passes IAB Validation

What it takes for a Consent Management Platform to pass IAB Europe's TCF checks: a registered CMP ID, a cleanly decodable TC String, event-listener delivery, and encoding against the right GVL version.

9 min read

How to Migrate Your CMP Without Losing Existing Consent Records

A step-by-step technical guide to switching consent management platforms without losing consent records, triggering mass re-consent, or breaking Consent Mode. Covers export, category mapping, parallel runs, and zero-downtime migration patterns.