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".Steps
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:
| Cookie | Type | Purpose (from Microsoft) |
|---|---|---|
_clck | first-party | Keeps the Clarity user ID and preferences for your site |
_clsk | first-party | Connects page views into one session recording |
CLID | third-party | Identifies the first time Clarity saw the user on any site using Clarity |
MUID | third-party | Identifies browsers visiting Microsoft sites, used for advertising, analytics and operations |
ANONCHK, MR, SM | third-party | Flags 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.
Option 1: Google Consent Mode (no code)
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?
- 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_storageisDENIED. - Click Reject all: no
_clckor_clskcookie. - Clear the cookies, click Accept all, reload: the check shows
GRANTEDand both cookies are set. - 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.