Open workspace

Guide · Microsoft Clarity

Microsoft Clarity and consent, step by step

Clarity records sessions and creates heatmaps of your site. Since October 31, 2025, visits from the EEA, the UK and Switzerland need a valid consent signal for Clarity to work fully. See the three ways to send this signal and the most common mistakes.

  • ✓Based on the official Clarity documentation
  • ✓Ready-to-copy code
  • ✓Read-only scan, no changes to the site
2025year Clarity began requiring the signal, since October 31
3regions with the requirement: EEA, UK and Switzerland
2types of consent read by Clarity: analytics_storage and ad_storage
9months of maximum consent validity, unless changed earlier

What it is

A consent notice for Microsoft's recording tool

Microsoft Clarity is a free behavior analytics tool. It shows heatmaps, session recordings and where visitors click, scroll or give up. Many publishers use Clarity to improve the layout and position of ads.

To do this, Clarity uses its own cookies that link the pages of the same visit. In Europe, setting these cookies requires the visitor's prior consent.

That is why Microsoft created a consent mode in Clarity. Since October 31, 2025, visits from the EEA, the UK and Switzerland need to arrive with a valid consent signal for Clarity to work fully.

Without the signal, Clarity does not stop completely. It keeps loading, but without cookies and with limited features. The problem is that reports become incomplete and sessions appear fragmented.

Checklist

What you need to meet

If the site uses Clarity and receives visits from the EEA, the UK or Switzerland, these points need to be working.

  1. Valid signal for the EEA, the UK and Switzerland

    Since October 31, 2025, visits from these regions must arrive with a valid consent signal. Without it, Clarity does not store cookies and limits features such as recordings and funnels.

  2. Turn on consent mode in the project

    Microsoft requires Clarity's consent mode to be on before using any CMP. Each Clarity project needs its own signal.

  3. Call the API right after the script

    With your own banner, call the consentv2 API right after the Clarity script loads and before any cookie. Both fields are required.

    // Visitante aceitou
    window.clarity('consentv2', {
      ad_Storage: 'granted',
      analytics_Storage: 'granted'
    });
    
    // Visitante recusou
    window.clarity('consentv2', {
      ad_Storage: 'denied',
      analytics_Storage: 'denied'
    });
  4. Clarity cookies as non-essential

    In the banner, the Clarity cookies must be in a non-essential category. That way they are only stored after acceptance.

    Example

    Put _clck and _clsk in the Analytics category of the banner, never in Necessary.

  5. Tell visitors about the cookie

    Microsoft says you must inform visitors about the cookie that Clarity uses.

    Example

    We use Microsoft Clarity, with the cookies _clck and _clsk, to understand how visitors use the site.

  6. Tell Clarity when the visitor opts out

    If the visitor refuses after accepting, send the denied signal. Clarity deletes the cookies it had already stored.

  7. No Clarity for under 18

    Microsoft says Clarity should not be used on sites or apps directed at people under 18.

  8. CMP certified by Google for ads

    For Google personalized ads, the EEA and the UK have required a TCF-certified CMP since January 16, 2024. Switzerland has required it since July 31, 2024.

    Example

    Clarity reads Google's Consent Mode, so the same certified banner can cover both.

In practice

Right and wrong

Official tools

Certified CMPs and official links

Microsoft publishes the list of CMPs that pass the signal to Clarity on their own, and Google keeps the list of CMPs certified for the EEA, the UK and Switzerland.

Who it applies to

Who needs to adjust Clarity

The rule is Microsoft's own and applies to any Clarity project with visits from the three regions.

Sites with Clarity installed

Any site that uses Clarity and receives visits from the EEA, the UK or Switzerland must send the signal.

Those who link Clarity to Microsoft Ads

The ads signal decides whether Clarity can share data with Microsoft Advertising.

Sites with Google Consent Mode

Clarity reads Google Consent Mode signals on its own. For these sites, the adjustment is usually small.

Outside the three regions

Consent mode comes turned on by default only for the EEA, the UK and Switzerland. Local laws, such as the LGPD, still apply.

Definitions

The terms in the Clarity documentation

These names appear in the dashboard, in the code and in Microsoft's guides.

analytics_storage

Consent to store analytics data, such as site usage and interaction patterns. When denied, Clarity collects only cookieless data.

ad_storage

Consent for ad-related data. When denied, Clarity does not share data with Microsoft Ads.

Cookieless mode

Without consent, Clarity creates a new identifier on each page view and does not set cookies to link the visit.

_clck and _clsk cookies

Clarity's own cookies. They are deleted when the visitor declines after having accepted.

consentv2 API

The official command to send both signals from a custom banner or a CMP without integration.

Consent mode in the dashboard

A project setting in which Clarity waits for a valid signal before setting cookies.

With and without a signal

What Clarity does in each case

The difference shows up directly in the recordings and heatmap reports.

Visitor who accepted

Clarity sets the _clck and _clsk cookies, links the pages of the same visit and delivers complete recordings and heatmaps.

  • Whole sessions, from the first to the last click
  • All Clarity features working
  • Integration with Microsoft Ads, if ad_storage was also accepted
  • Depends on the signal arriving right after the script loads

Visitor who declined or did not respond

Clarity loads, but without cookies. Each page view becomes a separate record, and some features do not work.

  • Respects the visitor's choice
  • Still generates some cookieless information
  • Fragmented sessions and incomplete funnels
  • No data shared with Microsoft Ads

The three paths

How to send the signal to Clarity

Microsoft accepts three ways. Use the one that matches what the site already has.

Google Consent Mode

Recommended for sites that already use Google Consent Mode. Clarity recognizes the signals with no extra setup.

Compatible CMP

Several CMPs, such as Cookiebot, CookieYes, Usercentrics and Axeptio, send the signal to Clarity on their own. You need to turn on consent mode in the project.

consentv2 API

For custom banners or CMPs without integration. The site calls the API right after the Clarity script loads.

How to implement

Sending consent with the consentv2 API

  1. Turn on consent modeIn the Clarity project, open Settings and then Setup and turn off cookie recording by default, so Clarity waits for the signal.
  2. Call the API right after the scriptMicrosoft advises calling the consent API right after the Clarity script loads and before any cookie is set.
  3. Send both signalsBoth fields are required: ad_Storage and analytics_Storage, each with granted or denied, according to the choice in the banner.
  4. Repeat when the choice changesIf the visitor declines after accepting, send again with denied. Clarity deletes the cookies and restarts cookieless collection.
  5. Check the resultThe documentation includes a metadata command that shows in the console the consent state read by Clarity.
Example based on the official consentv2 API documentation
// Visitante aceitou tudo
window.clarity('consentv2', {
  ad_Storage: 'granted',
  analytics_Storage: 'granted'
});

// Visitante recusou tudo
window.clarity('consentv2', {
  ad_Storage: 'denied',
  analytics_Storage: 'denied'
});

Visitor rights

Withdrawing consent and how long it lasts

While the visitor has not responded, Clarity treats consent as denied. Only after a granted signal does it start setting cookies.

Consent lasts up to 9 months, unless the visitor changes the choice earlier or local settings call for a shorter period. After that, the site must ask again.

If the visitor accepts and then changes their mind, the site must tell Clarity. On receiving the refusal, Clarity deletes the cookies it had already set, ends the current session and goes back to collecting without cookies.

The old consent API still works, but Microsoft says it will be discontinued and should no longer be used in new implementations. The current path is consentv2.

Enforcement and AdSense

Who enforces and how Clarity coexists with Google

Technical enforcement is Microsoft's own. Without a valid signal, Clarity limits features for visits from the EEA, the UK and Switzerland. The documentation does not mention a fine: the effect is having incomplete data for that traffic.

Legal enforcement is by European data protection authorities. Setting analytics cookies without consent, on a site with European visitors, can be challenged by them like any other non-essential cookie.

For those with AdSense or Ad Manager, the good news is that Google Consent Mode, sent by the certified CMP, is also read by Clarity. A single well-configured banner can serve Google and Clarity at the same time.

Note: Clarity and the Microsoft Advertising UET tag are different tools. Clarity's signal does not replace the signal that UET needs to receive.

Common errors

What makes Clarity lose data or record without permission

The mistakes show up on both sides: a signal that does not arrive and a cookie set too early.

Consent mode turned off

The project keeps setting cookies by default. Clarity does not wait for the signal before setting them.

API called too late

The signal is only sent long after the script loads. Part of the visit goes out without consent.

Only one of the two signals

The site sends analytics_Storage and forgets ad_Storage, or the other way around. The API asks for both.

Refusal not passed on

The visitor changes their mind in the banner, but Clarity does not receive the refusal and keeps the cookies.

Old API in use

The site still uses the old consent command, which Microsoft plans to discontinue.

Clarity before the CMP

The Clarity script loads before the CMP exists on the page, and no signal arrives in time.

In practice

What is and is not allowed with Clarity

Practical examples for publishers who use Clarity to improve layout and ads.

Allowed

  • Letting Clarity collect without cookies while the visitor has not responded
  • Using the Google Consent Mode the CMP already sends
  • Using a CMP compatible with automatic sending to Clarity
  • Calling consentv2 with both signals right after the script
  • Asking again after 9 months

Not allowed

  • Setting _clck and _clsk before the click on the banner
  • Keeping the cookies after a refusal
  • Sending only one of the two consentv2 signals
  • Using the old API in new implementations
  • Thinking Clarity's signal covers the UET ads tag

In ConsentMode

What the audit checks about Clarity

  • Detects the Clarity script and opens the site as a visitor from Europe and from outside it.
  • Checks whether the _clck and _clsk cookies appear before the click on the banner.
  • Looks in the code for the consentv2 call or the Google Consent Mode that Clarity reads.
  • Checks whether a refusal in the banner deletes the Clarity cookies.
  • Delivers screenshots and the adjustment to make in the CMP, in the Clarity dashboard or in the code.

Frequently asked questions

Does Clarity stop working without consent?

No. It loads and collects cookieless data. But sessions become fragmented and some features do not work for visits from the three regions.

My site is Brazilian. Do I need this?

Clarity's requirement applies to visits from the EEA, the UK and Switzerland. For the Brazilian audience, the LGPD also asks for transparency about cookies in the privacy policy.

If I already have Google Consent Mode, do I need to do anything else?

According to Microsoft, Clarity reads Google Consent Mode signals with no extra change. Check anyway that cookies only appear after acceptance.

Can Clarity be used without a banner?

Outside the three regions, Microsoft does not require the signal. For European visitors, without a banner Clarity stays in cookieless mode and recordings lose continuity.

Are Clarity and UET the same thing?

No. Clarity is an analytics tool. UET is the Microsoft Advertising conversion tag. Each one needs its own signal.

How do I check the consent state?

The Clarity documentation includes a metadata command that shows the state in the console. Or run a ConsentMode audit, which checks the cookies before and after the click.

Library

Official sources

This guide was written from these official pages. Read them directly at the source:

Find out whether Clarity respects your visitors' choices

The audit opens the site as a European visitor and shows what Clarity records before and after the banner.

Start the audit