Platforms

How to set up Microsoft Clarity with Cookiequiet

Since October 31, 2025, Clarity needs a consent signal for visits from the EEA, the UK and Switzerland, and without one it runs without cookies. Clarity reads Google Consent Mode on its own, so the Cookiequiet snippet with data-consent-mode="1" already passes analytics_storage and ad_storage to it. To keep Clarity from loading at all before consent, mark its tag with type="text/plain" and data-cq-category="analytics".
Published 21 October 2026 · By the Cookiequiet team · Markdown

Steps

Turn on Clarity's consent settingIn your Clarity project, open Settings, then Setup, and turn off the cookie setting so Clarity waits for consent before setting cookies. It is already the default for visitors from the EEA, the UK and Switzerland.
Keep Consent Mode on in the snippetCheck that the Cookiequiet snippet carries data-consent-mode="1" and sits before the Clarity tag. Clarity honours the analytics_storage and ad_storage signals Cookiequiet sends.
Choose: load before consent or afterLeave the Clarity tag unmarked to collect cookieless data until consent, or mark it with type="text/plain" and data-cq-category="analytics" so nothing loads before consent.
Optionally call ConsentV2Without Google Consent Mode, pass the choice with window.clarity('consentv2', { ad_Storage, analytics_Storage }) from a cq:consent listener.
Verify the consent stateIn the browser console, run Clarity's metadata check and confirm analytics_storage shows DENIED before a choice and GRANTED after Accept all.
Test with Reject allIn a private window, click Reject all and check that no _clck or _clsk cookie is set. Accept all, reload, and check that both appear.

What does Clarity store, and which category is it?

Microsoft's documentation describes Clarity's cookies as non-essential. They store a pseudonymous ID that links page views into sessions and recordings:

CookieTypePurpose (from Microsoft)
_clckfirst-partyKeeps the Clarity user ID and preferences for your site
_clskfirst-partyConnects page views into one session recording
CLIDthird-partyIdentifies the first time Clarity saw the user on any site using Clarity
MUIDthird-partyIdentifies browsers visiting Microsoft sites, used for advertising, analytics and operations
ANONCHK, MR, SMthird-partyFlags tied to MUID

Clarity records sessions and builds heatmaps, so it goes in the analytics category. If you connect Clarity to Microsoft Advertising, the data it shares there follows ad_storage, which Cookiequiet grants with the marketing category.

What changed on October 31, 2025?

Microsoft announced that from that date Clarity enforces consent signals for visits from the European Economic Area, the United Kingdom and Switzerland: consent mode is on by default for those visitors, and the consent state is denied until you update it. With analytics_storage denied, the tag loads but collects cookieless data only, with a new ID per page view, so features that depend on cookies (recordings across pages, funnels) are limited. With ad_storage denied, Clarity shares nothing with Microsoft Ads. Clarity treats a consent as valid for up to 9 months.

Clarity's documentation says it interprets and honours Google Consent Mode signals such as ad_storage and analytics_storage without extra configuration. Cookiequiet sets those to denied as soon as the snippet runs when it carries data-consent-mode="1" (the default in the dashboard's snippet), and sends an update after every choice:

html
<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
<!-- Microsoft Clarity tag from Settings > Setup, below the snippet -->

One interaction to know: with data-auto-block="1", Cookiequiet's auto-blocker lists clarity.ms under analytics, so when the Clarity script is created after Cookiequiet has run (for example by Tag Manager), Cookiequiet holds it until analytics is granted. In that case Clarity does not load before consent at all, and Consent Mode tells it the state once it does.

Option 2: mark the Clarity tag

To make sure nothing reaches Clarity before consent, including the cookieless data, paste the tag below the snippet and change its opening tag:

html
<script type="text/plain" data-cq-category="analytics">
/* Microsoft Clarity tracking code, unchanged */
</script>

Cookiequiet runs it when analytics is granted and at once on later visits where the stored choice includes it. In Google Tag Manager, use a Custom Event trigger on cq_consent with cq_analytics equals true, firing once per page, as the Tag Manager guide describes.

Option 3: Clarity's ConsentV2 API

Clarity's current consent call is consentv2; the older clarity('consent') call is planned for deprecation. Both parameters are required and their names are case-sensitive. If you do not use Google Consent Mode, forward Cookiequiet's choice with the cq:consent event, which it dispatches on window with the granted categories each time it applies a choice:

html
<script>
window.addEventListener('cq:consent', function (e) {
var c = e.detail.categories;
if (typeof window.clarity !== 'function') return;
window.clarity('consentv2', {
ad_Storage: c.indexOf('marketing') >= 0 ? 'granted' : 'denied',
analytics_Storage: c.indexOf('analytics') >= 0 ? 'granted' : 'denied'
});
});
</script>

When a visitor withdraws consent, Microsoft says Clarity deletes its cookies, ends the session and continues in no-consent mode. window.clarity('consent', false) erases the cookies directly.

Which option should I pick?

Option 1 needs no code and keeps cookieless measurement for visitors who have not chosen yet, unless the auto-blocker holds the script. Option 2 sends nothing before consent. Both leave the cookies out until the visitor accepts analytics. The cookieless analytics guide compares tools that measure without consent.

How do I verify it?

  1. Open the site in a private window. In the console, run Clarity's check from its documentation: clarity('metadata', (d, upgrade, consent) => { console.log('consentStatus:', consent); }, false, true, true); Before a choice, analytics_storage is DENIED.
  2. Click Reject all: no _clck or _clsk cookie.
  3. Clear the cookies, click Accept all, reload: the check shows GRANTED and both cookies are set.
  4. Check the consent log in the Cookiequiet dashboard.

Cookiequiet is free for one website with geo-targeting; Starter is €3 per website per month with unlimited pageviews.

Questions

Microsoft describes Clarity's cookies as non-essential, and since October 31, 2025 Clarity requires a consent signal for visits from the EEA, the UK and Switzerland. Without one it runs in a cookieless mode with limited features.
Yes. Microsoft's documentation says Clarity honours Google Consent Mode signals such as analytics_storage and ad_storage without extra configuration. Cookiequiet sends those signals when the snippet carries data-consent-mode="1".
It is the current call to pass consent: window.clarity('consentv2', { ad_Storage, analytics_Storage }), each set to granted or denied. It replaces the older clarity('consent') call, which Microsoft plans to deprecate.
Analytics, because it records sessions and builds heatmaps. If you share Clarity data with Microsoft Advertising, that sharing follows ad_storage, which Cookiequiet grants with marketing.

Put a quiet banner on your website today

Free for one website with every core feature, no card and no trial clock. Upgrade a website to Starter for $3 a month to match your brand with AI and drop the branding, or to Pro for $9 to design it with the AI agent.