# 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".

Source: https://cookiequiet.com/platforms/microsoft-clarity
Published: 2026-10-21
Publisher: Cookiequiet

## Steps

1. **Turn on Clarity's consent setting** In 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.
2. **Keep Consent Mode on in the snippet** Check 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.
3. **Choose: load before consent or after** Leave 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.
4. **Optionally call ConsentV2** Without Google Consent Mode, pass the choice with window.clarity('consentv2', { ad_Storage, analytics_Storage }) from a cq:consent listener.
5. **Verify the consent state** In the browser console, run Clarity's metadata check and confirm analytics_storage shows DENIED before a choice and GRANTED after Accept all.
6. **Test with Reject all** In 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:

| 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](/platforms/google-tag-manager) 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](/guides/cookieless-analytics-options) 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

### Does Microsoft Clarity need cookie consent?

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.

### Does Clarity read Google Consent Mode?

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".

### What is Clarity's ConsentV2 API?

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.

### Which category should Clarity be in?

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.

## Sources

- [Microsoft Learn: Clarity Consent Mode](https://learn.microsoft.com/en-us/clarity/setup-and-installation/consent-mode)
- [Microsoft Learn: Clarity Cookie Consent API, ConsentV2](https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-consent-api-v2)
- [Microsoft Learn: Clarity consent management](https://learn.microsoft.com/en-us/clarity/setup-and-installation/consent-management)
- [Microsoft Learn: Support for Google Consent Mode in Clarity](https://learn.microsoft.com/en-us/clarity/setup-and-installation/cookie-gcm)
- [Microsoft Learn: Clarity cookies](https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-cookies)
