TL;DR
CookieBeam's Clarity bridge sends two signals through Microsoft's consentv2 API: ad_Storage (from your marketing category) and analytics_Storage (from your analytics category). Both update in real time when the visitor accepts, rejects, or withdraws consent. Watch the capitalization: Clarity uses ad_Storage with a capital S, which differs from Google's lowercase ad_storage.
Which Microsoft consent guide do you need?
- This guide: how CookieBeam's Clarity bridge sends
ad_Storageandanalytics_Storagesignals automatically. - Clarity consentv2 API: manual Clarity consent implementation and the October 2025 deadline.
- CookieBeam UET bridge: how CookieBeam sends UET
ad_storagesignals. - UET consent mode explained: the May 2025 deadline and how it differs from Google.
- Clarity and Bing Ads together: combined setup for both tools.
What the Clarity Consent Bridge Does
The CookieBeam Clarity consent bridge is the component that translates your cookie banner's marketing and analytics categories into the two consent signals Microsoft Clarity's consentv2 API expects: ad_Storage (capital S) for advertising data sharing and analytics_Storage (capital S) for behavioral analytics like session recordings and heatmaps. Unlike UET, which uses a single ad_storage signal, Clarity needs both because it serves dual purposes: recording visitor behavior (analytics) and feeding that data to Microsoft Advertising for audience building (advertising). Since October 31, 2025, Clarity enforces these consent requirements for EEA, UK, and Swiss visitors. CookieBeam's bridge sends both signals from a single visitor decision, mapping your analytics category to analytics_Storage and your marketing category to ad_Storage. For the manual API setup, see the Clarity consent mode guide.
Two Signals, One Decision
Clarity's consentv2 API accepts two consent types. analytics_Storage (capital S) controls whether Clarity can store cookies for session recordings and heatmaps. ad_Storage (capital S) controls whether Clarity can share data with advertising platforms like Microsoft Advertising.
CookieBeam maps these from the resolved Consent Mode v2 state:
analytics_Storagereads fromanalytics_storagein the consent mode state, which corresponds to your banner's analytics category.ad_Storagereads from a combination ofad_storage,ad_user_data, andad_personalization. If any of those isgranted(all three come from the marketing category),ad_Storageis sent asgranted.
This means a visitor who accepts analytics but rejects marketing will have Clarity record sessions (analytics allowed) without sharing that data with Microsoft Advertising (ad sharing denied).
| CookieBeam Category | Consent Mode Source | Clarity Signal Sent | What It Controls |
|---|---|---|---|
| analytics (accepted) | analytics_storage: granted | analytics_Storage: granted | Session recordings, heatmaps, user behavior tracking |
| analytics (rejected) | analytics_storage: denied | analytics_Storage: denied | Clarity collects nothing |
| marketing (accepted) | ad_storage: granted | ad_Storage: granted | Data sharing with Microsoft Advertising |
| marketing (rejected) | ad_storage: denied | ad_Storage: denied | No advertising data sharing |
The Capital S Matters
Clarity's API uses ad_Storage and analytics_Storage with a capital S. Google Consent Mode v2 uses ad_storage and analytics_storage in all lowercase. CookieBeam's bridge handles this translation automatically. If you're building manual integrations alongside the bridge, mixing up the casing will silently break consent signaling because the Clarity API won't recognize lowercase keys.
What Fires and When
The bridge fires on the cookiebeam:consentUpdate event, the same event that triggers Google and Microsoft Advertising consent updates. Here's the sequence:
- Visitor arrives. Clarity loads with its own defaults (denied for EEA, UK, and Swiss visitors since October 2025).
- Visitor accepts analytics and marketing. CookieBeam fires
cookiebeam:consentUpdatewithanalytics_storage: 'granted'andad_storage: 'granted'. - The bridge calls
window.clarity('consentv2', { 'ad_Storage': 'granted', 'analytics_Storage': 'granted' }). Clarity begins recording sessions and can share data with advertising. - If the visitor later withdraws just marketing, the bridge sends
ad_Storage: 'denied'while keepinganalytics_Storage: 'granted'. Clarity continues recording but stops advertising data sharing.
Queue Handling
Clarity's JavaScript snippet uses a queue pattern similar to Google's gtag. If window.clarity doesn't exist when the bridge runs, the bridge creates a queue stub: a function that pushes arguments to window.clarity.q. When Clarity's actual script loads later, it processes the queue and picks up the consent signal.
There's a guard for a specific edge case. If window.clarity exists but isn't a function (which can happen if another script partially initialized it), the bridge exits rather than overwriting it. This prevents breaking Clarity's initialization in rare script-loading scenarios.
Returning Visitors
On later page views, the runtime re-announces the stored explicit choice as cookiebeam:consentRestored, and the bridge sends the matching consentv2 call, so Clarity knows immediately whether it can record. If the stored consent includes analytics but not marketing, Clarity records sessions without advertising data sharing from the first page view. Machine-written defaults (such as US opt-out auto-grants) are not restated. A consent change on the current page fires cookiebeam:consentUpdate. This restatement ships with the runtime release that includes the vendor bridge fix.
How to Verify in the Browser
Clear cookies and localStorage
Open your site in Chrome and clear all site data for the domain.
Check the Clarity queue before consent
Load a page running Clarity. Open DevTools > Console and type window.clarity.q. Confirm that no consentv2 call with granted values has been pushed.
Accept analytics and marketing
Accept both categories in the banner. Check the queue again. A consentv2 entry with both analytics_Storage: 'granted' and ad_Storage: 'granted' should appear.
Verify Clarity cookies
In DevTools > Application > Cookies, confirm that _clck and _clsk are now present with real values.
Withdraw analytics consent
Reopen the banner and switch off analytics. Check that another consentv2 entry appears with analytics_Storage: 'denied'. Clarity should stop recording.
Cross-check in the Clarity dashboard
Open Microsoft Clarity for your project and verify that session recordings match the consent state: no recordings from visitors who rejected analytics.
Why Both Signals Matter for Session Recordings
Session recordings capture everything a visitor does on the page: clicks, scrolls, form interactions, mouse movements. Under GDPR, this is personal data processing that requires consent. The analytics_Storage signal controls whether Clarity can collect this data at all.
The ad_Storage signal matters when Clarity is connected to Microsoft Advertising. With the connection active, Clarity's behavioral data enriches ad targeting and audience segments. A visitor might be comfortable with heatmaps (analytics accepted) but not with that data flowing into advertising (marketing rejected). The two-signal design lets them make that distinction.
For a deeper look at privacy implications of session recording tools, see session replay and consent.
Frequently Asked Questions
Does the Clarity bridge fire separately from the UET bridge?
Yes. They're independent bridges that listen to the same consent event. The UET bridge sends ad_storage to Microsoft Advertising's queue. The Clarity bridge sends ad_Storage and analytics_Storage to Clarity's consentv2 API. Disabling one doesn't affect the other.
Why does Clarity use different capitalization than Google?
Clarity's consentv2 API was designed independently from Google Consent Mode v2. The capital S in ad_Storage and analytics_Storage is Clarity's convention. CookieBeam's bridge handles the translation, so you don't need to think about it unless you're building additional manual integrations.
What if I only enable analytics but not marketing in my banner?
The bridge sends analytics_Storage: 'granted' and ad_Storage: 'denied'. Clarity records sessions and generates heatmaps but won't share that data with Microsoft Advertising. This is a valid and common configuration for sites that want behavioral analytics without advertising use.
Can I use Clarity without the CookieBeam consent bridge?
You can disable the bridge in CookieBeam's vendor consent signals settings and manage Clarity's consent manually through the consentv2 API. Running both the bridge and manual consent commands risks conflicting signals. Pick one approach.
Is the bridge compatible with Clarity's older consent API?
The bridge uses consentv2, which is Clarity's current API supporting the two-signal model. If your site has legacy window.clarity('consent') calls from a previous setup, remove them to avoid conflicts. Only consentv2 signals are respected under the October 2025 enforcement.
For all vendor bridges, see the consent mode integrations overview. For the UET side, see the CookieBeam UET bridge. Microsoft's official documentation covers the Clarity consent configuration and the Clarity API reference.