Integrating Microsoft Clarity Consent API Using CookieYes
Last updated on March 14, 2025
Overview
This document explains how to integrate and manage Microsoft Clarity and CookieYes for website analytics and compliance. While the GDPR and ePrivacy Directive already mandate explicit consent for non-essential cookies in the European Economic Area (EEA), the United Kingdom and Switzerland, Microsoft Clarity will start enforcing this requirement in early 2025.
To comply with Clarity’s enforcement, websites will need to call the Clarity Consent API to pass user consent signals directly to Clarity’s scripts. Without explicit consent, Clarity cookies cannot be used, which means certain functionalities like funnel tracking and session recordings may be impacted. Integrating CookieYes with Clarity ensures that user tracking permissions are managed effectively, helping websites comply with both data privacy regulations and Clarity’s requirements.
Prerequisites
Before integrating Microsoft Clarity Consent API using CookieYes, ensure you meet the following prerequisites. You must have a registered Microsoft Clarity account to obtain the tracking code required for website integration. A CookieYes account is also necessary to manage cookie consent effectively and ensure compliance with data privacy regulations. Setting up both accounts in advance will streamline the implementation process and help you configure tracking and consent management seamlessly.
What is Microsoft Clarity?
Microsoft Clarity is a behavioral analytics tool that helps website owners observe and understand user interactions. It offers advanced features such as heatmaps, which visually represent user clicks and scroll behaviour, enabling site owners to identify engagement patterns and session recordings, allowing owners to visualise user journeys in real time. Clarity also includes advanced insights and filtering options, allowing segmentation based on user behaviours for targeted analysis.
How Microsoft Clarity Works with CookieYes?
Microsoft Clarity and CookieYes work together to ensure that website analytics and tracking adhere to global data privacy regulations. CookieYes, as a consent management platform, allows websites to obtain, record and manage user consent before activating Microsoft Clarity’s tracking capabilities.
By integrating with the Clarity Consent API, CookieYes automatically communicates user consent preferences, ensuring that tracking scripts categorized under analytics or performance cookies activate only with user consent. If a user opts out of these categories, CookieYes prevents Clarity from placing cookies or tracking interactions, thereby maintaining legal compliance. This integration allows businesses to utilise behavioural analytics while respecting user privacy rights, which are upheld according to local and global data privacy regulations.
How to enable Microsoft Clarity in CookieYes?
By default, Microsoft Clarity Consent API integration remains enabled, but if you disable it, follow these steps to turn it back on:
- Log in to your CookieYes web app account.
- From your dashboard, navigate to Advanced Settings.
- In Advanced Settings, toggle the button (to the right) labelled Microsoft Clarity Consent API integration under the Microsoft consent mode & Clarity API integration section.

Conclusion
Integrating Microsoft Clarity Consent API using CookieYes ensures that websites comply with data privacy regulations while leveraging valuable user behaviour insights. The Clarity Consent API lets businesses manage user tracking permissions and enable analytics only with consent. This seamless integration not only helps maintain legal compliance in the EEA, UK, and Switzerland but also builds user trust by prioritizing transparency and privacy.