6 Minutes Of Reading
September 11, 2025

How to Set Up Cookie Consent for Microsoft Clarity


Microsoft Clarity Cookie Consent Setup

Microsoft Clarity is a free analytics and session recording tool that helps you see how users interact with your website. It captures data such as heatmaps, funnels, and user sessions. These features rely on cookies that are considered non-essential. Privacy regulations such as GDPR and the UK Data Protection Act require you to obtain consent before setting these cookies.

From October 31, 2025, Microsoft will enforce this requirement for visitors in the European Economic Area, the UK, and Switzerland. If you do not set up consent correctly, Clarity will run in a limited mode, and your analytics will lose accuracy.

What Is Consent for Microsoft Clarity

Consent for Clarity means that a visitor has explicitly agreed to allow Clarity to set cookies like _clck and _clsk. These cookies are used to stitch user sessions together, measure returning visitors, and build accurate behavior reports.

If no consent is given, Clarity will still run in a limited mode but every page load will be treated as a new session. This breaks user journey tracking and reduces the accuracy of your reports.

Why Is Consent Important

  • Legal compliance: Laws like GDPR and CCPA requirements require websites to obtain consent before setting non-essential cookies. Without it, you risk fines or enforcement actions.
  • Accurate analytics: With consent, Clarity can set cookies to maintain proper session tracking. Without it, your funnels, heatmaps, and user journeys may become fragmented.
  • User trust: Respecting consent shows transparency. It signals to visitors that you value their privacy, which improves credibility and trust in your brand.

How to Set Up Microsoft Clarity Cookie Consent Step by Step

Below is a clear, actionable process for setting up Microsoft Clarity with cookie consent. Follow these five steps to stay compliant and keep your analytics accurate.

Step 1: Disable Automatic Cookie Setting in Microsoft Clarity

By default, Clarity sets cookies as soon as the script loads. To make your setup compliant, you need to stop this behavior until the visitor grants permission.

Before you start, make sure you know how to find your Microsoft Clarity ID. Log in to your Clarity project, go to Settings → Setup → Advanced, and turn off the option for automatic cookie setting. This ensures Clarity does not drop cookies before a choice is made.

Step 2: Pass Consent Using the Microsoft Clarity Consent V2 API

Once a visitor makes a decision, you need to send that signal to Clarity. Use the Consent V2 API, which is the recommended method:

window.clarity('consentv2', {
  ad_Storage: 'granted',
  analytics_Storage: 'granted'
});

If the visitor declines, send:

window.clarity('consentv2', {
  ad_Storage: 'denied',
  analytics_Storage: 'denied'
});

This tells Clarity whether it can enable full tracking or must remain in limited mode.

<script>
  window.addEventListener("CookiebotOnConsentReady", () => {
    if ("clarity" in window) {
      window.clarity("consentv2", {
        analytics_Storage: Cookiebot.consent.statistics ? 'granted' : 'denied'
      });
    }
  });
</script>

Step 4: Test Microsoft Clarity Cookie Consent Setup

Once everything is in place, test your implementation. Clear browser cookies and load your site. Decline consent and confirm that Clarity cookies such as _clck and _clsk are not created. Then accept consent and check that cookies are stored correctly.

You can also run this command in the console:

clarity('metadata', (d, u, consent) => console.log('consentStatus:', consent), false, true, true);

Step 5: Monitor the Impact When Users Deny Consent

When visitors do not provide consent, Clarity works in a limited mode. Each page view is treated as a separate session, returning visitors are not recognized, funnels show higher drop-offs, and reporting becomes less reliable. The good news is you don’t have to accept this data loss. With Conversios’ server-side tracking solution, you can capture more accurate first-party data while staying fully compliant.

This will not break your site, but it reduces the depth of insights you get from Clarity. From October 31, 2025, Microsoft will enforce this behavior automatically for all visitors from the EEA, the UK, and Switzerland, so now is the right time to combine Clarity with server-side tagging

Upcoming Integration with Google Consent Mode

showing Microsoft Clarity cookie consent granted versus denied. Left side displays gray faded analytics for denied consent, right side shows colorful charts and heatmaps for granted consent with a toggle switch in the middle.

Microsoft has announced that Clarity will soon integrate directly with Google Consent Mode. This update is expected in September 2025. For websites that already use Google Consent Mode, this means you will not need to configure Clarity separately. Clarity will automatically respect the same consent signals for analytics_storage and ad_storage.

This integration is especially helpful if you manage multiple tracking tools, since a single consent setup will work across both Google and Microsoft. It reduces complexity, ensures consistency, and helps you stay compliant with regional privacy requirements.

Final Thoughts

Cookie consent for Microsoft Clarity is now a requirement rather than an option. By disabling automatic cookies, passing user decisions through the Consent V2 API, and testing your implementation, you can make sure Clarity runs correctly and within legal boundaries.

If users do not consent, Clarity will still function, but the reports will be fragmented and less reliable. From October 31, 2025, Microsoft will enforce this automatically for all traffic from the EEA, the UK, and Switzerland.

Taking action now will protect your compliance status, maintain accurate analytics, and build trust with your visitors. You can also improve first-party data tracking by pairing Clarity consent setup with server-side tagging strategies.

Frequently Asked Questions

Q. Do I need cookie consent for Microsoft Clarity?

Yes. Clarity uses non-essential cookies such as _clck and _clsk to link user sessions and recognize returning visitors. Under GDPR and similar privacy laws, you must ask for consent before setting these cookies.

Q. What happens if I do not enable consent for Clarity?

Clarity will still work but in a limited mode. Every page load will be treated as a new session, returning visitors will not be recognized, funnels will show higher drop-offs, and overall analytics accuracy will decline.

Q. What is the Clarity Consent V2 API?

The Consent V2 API is Microsoft’s recommended way to pass user consent signals. It lets you tell Clarity whether analytics and ad storage have been granted or denied, so Clarity knows whether to use cookies or stay in limited mode.

Q. Can I use a Consent Management Platform (CMP) with Clarity?

Yes. CMPs like CookieYes, Cookiebot, and OneTrust can block Clarity until the user makes a choice, then trigger the Consent V2 API with the correct consent status.

Q. When will Microsoft enforce consent for Clarity?

From October 31, 2025, Microsoft will require consent signals for all visitors from the European Economic Area, the UK, and Switzerland. If no consent is provided, Clarity will automatically run in limited mode for those regions.

Q. How can I reduce data loss when users deny consent in Clarity?

 No analytics tool can override a user’s choice, but you can reduce the gaps by implementing server-side tracking. Conversios provides a ready-made server-side tracking solution for Shopify and WooCommerce stores, which captures more reliable first-party data and keeps your reports accurate even when browser cookies are blocked.

Switch to Conversios

Get accurate, code-free server-side tracking for your store.

Start For Woocommerce Start For Shopify

Maulik Shah

Product Growth Manager

Maulik is a Product Growth Manager at Conversios, specializing in backend architecture, event tracking systems, and eCommerce automation. With a strong grasp of both engineering and analytics, he builds scalable platforms that power data-driven growth for Shopify and WooCommerce merchants.

Scroll to Top