Skip to content

Microsoft Clarity ​

Microsoft Clarity is a free analytics tool — heatmaps and session recordings. Since 31 October 2025 Clarity enforces a consent signal for visitors from the EEA, UK and Switzerland: without one it runs cookieless there, with no session continuity. CookieWave sends that signal.

Set up ​

  1. In Banner Designer → Consent, turn on Enable Microsoft Clarity Consent.
  2. Install the Clarity tracking snippet from your Clarity project, in the <head> — no changes to it.

The banner then calls Clarity's Consent v2 API with the visitor's choice:

js
window.clarity('consentv2', {
  ad_Storage: 'granted' | 'denied',
  analytics_Storage: 'granted' | 'denied',
})

Capitalisation

Those keys really are ad_Storage and analytics_Storage, with a capital S. That is Microsoft's spelling; Clarity keys on it exactly. CookieWave matches it — you never type it yourself.

Which signal maps to what ​

  • analytics_Storage follows the analytics category — this is the one that matters most for Clarity, an analytics tool.
  • ad_Storage follows the marketing category.

The two are independent: a visitor who accepts analytics but not marketing gets analytics_Storage: granted, ad_Storage: denied, and Clarity tracks with cookies while treating the visit as non-advertising.

When a signal is denied, Clarity operates in no-consent mode: no cookies, a new ID per page view, no session continuity.

A note on timing ​

Unlike Google and UET, CookieWave does not create Clarity's queue — window.clarity is defined by Clarity's own snippet, and calling into a stub of our own would only queue messages nothing ever drains.

So the initial signal is sent when Clarity is there to receive it. CookieWave tries early, in its first moments on the page, and again once the banner's configuration has loaded a few hundred milliseconds later — by which time a snippet that was still loading has usually arrived. Every call carries the whole state rather than a change to it, so sending twice costs nothing and the later one is not a correction.

If Clarity turns up later still, it misses only that initial signal. It defaults to no-consent mode for EEA/UK/CH visitors on its own, which is the safe end to miss on, and the signal for the visitor's actual choice lands whenever they make it. In practice, put the Clarity snippet in the <head> and none of this bites.

Verify ​

Load a page with the Clarity snippet present, then in the console:

js
// Clarity processes the call internally; to observe it during testing,
// stub window.clarity before the banner loads and inspect the arguments:
window.clarity = (...args) => console.log('clarity', args)

Accept only analytics and you should see ['consentv2', { ad_Storage: 'denied', analytics_Storage: 'granted' }].

CookieWave consent management