CookieHub Logo

Implement Clarity Consent API v2

Keep your analytics running smoothly and ensure seamless session recording, heatmaps, and user behavior tracking — all fully consent-aware with CookieHub as your CMP.  

Trusted and used by 30.000+ websites and companies worldwide.

monday.comSemrushDealfrontTixly

Clarity Consent API v2 made easy

As of 31 October, 2025, Clarity will enforce consent signals for traffic from the EEA, UK, and Switzerland. Here’s how you can easily get started by activating Clarity Consent API v2 using CookieHub by enabling the Clarity Consent integration (v2), ensure you have the latest version of CookieHub, and use the built-in CookieHub script to pass consent to Clarity. 

Because CookieHub handles this in your CMP layer, you don’t have to manually handle the logic or timing. 

Cookie Compliance Checker

Use our free cookie scanner to detect all active cookies on your website. Receive a detailed report outlining their types, purposes, and durations to support your privacy compliance efforts.

Why Clarity Consent API v2 matters

Why Clarity Consent API v2 matters

Clarity’s Consent API v2 lets websites explicitly communicate user consent decisions to Microsoft Clarity’s tracking logic — a necessity in privacy‐first environments. 

Valid consent, better data 

Without valid consent, Clarity disables its cookie-based tracking, session linking, and cookie persistence in the EEA, UK, and Switzerland. With granted consent, Clarity can resume full session tracking, heatmaps, funnels, and full analytics features. This ensures that you remain compliant with privacy laws while still gaining insights from user behavior. 

Standardize consent across the Clarity tool with CookieHub  

CookieHub’s integration with the Clarity Consent API standardizes consent and enables accurate tracking in Microsoft Clarity, improving the reliability of your Clarity insights. 

CookieHub CMP: Your Clarity Consent solution + benefits

Clear insights, full compliance with CookieHub and Microsoft Clarity

Connect CookieHub to Microsoft Clarity to respect user consent while unlocking powerful behavior insights. See how visitors interact with your site without compromising privacy or compliance.

FAQ about Clarity Consent API v2

Clarity Consent API is Microsoft’s JavaScript consent interface that replaces the older window.clarity('consent') API. It enables passing explicit, differentiated consent states (for ads and analytics) to Clarity.  

Starting October 31, 2025, Clarity will enforce consent signals for traffic from the EEA, UK, and Switzerland. Without valid calls to consentv2, features like session linking, funnels, and recordings may be disabled.

It operates by listening for the window.clarity('consentv2', …) call with the user’s consent states. When CookieHub triggers that call (based on banner interaction), Clarity adjusts tracking behavior accordingly, either enabling cookies, session linking, and full analytics, or disabling them.  

If your website uses Microsoft Clarity and reaches users in the EEA, UK, or Switzerland, you must implement this API to maintain full Clarity functionality. If not, default Clarity may still work, but session linking and advanced features will degrade.

By preserving session continuity, heatmaps, funnels, and detailed user journey data — now in a privacy-aware way. Even if users withhold ad tracking consent, analytics can still run if granted. 

Clarity Consent API is primarily relevant for the EEA, UK, and Switzerland, where explicit, prior consent is required for non-essential cookies (like analytics and ad storage). Clarity will enforce this in those regions from October 31, 2025.   Even outside those zones, using consent-aware practices improves transparency and future-proofs your setup.

No. While Clarity Consent API v2 helps align Clarity’s behavior with consent signals, compliance requires your overall consent strategy, records, legal notices, and user choices to be sound. CookieHub offers the infrastructure to help assure full compliance — but you still need to manage policy, disclosures, and governance.

If you use Microsoft Clarity in regions with privacy laws (EEA, UK, Switzerland), yes — to maintain full tracking features. If you don’t have users from those regions, it’s still recommended to adopt a consent-aware approach. 

©2025 CookieHub ehf.