Overview
Microsoft Clarity enables businesses to prioritize user privacy while collecting valuable behavioral analytics for website optimization. It is designed to comply with data protection regulations such as GDPR, ensuring responsible data handling.
Key features include:
- Tailoring data collection: Adjust how Clarity tracks user interactions based on their consent preferences.
- Controlling cookie access: Manage cookie usage to ensure compliance with user permissions using simple consent controls.
- Collecting limited data: When full consent is not provided, Clarity can still gather anonymized data to provide insights into user behavior without compromising privacy.
Technical Implementation
How it works
Consent Mode in Microsoft Clarity is managed through direct commands to enable or disable tracking and cookie usage. The two primary commands are:
Command | Description |
window.clarity("consent") | Enables Clarity to read and write first- and third-party cookies for analytics purposes. This is the default behavior if no consent setting is specified. |
window.clarity("stop") | Disables Clarity from reading or writing first-party cookies. Third-party cookies are not written and are read-only for fraud detection purposes, not analytics. |
Clarity uses a JavaScript function called clarity
on the window
object. Unlike Microsoft UET consent mode, it does not rely on a property like ad_storage
, but instead uses the consent
and stop
keywords to control tracking behavior.
A default consent state is typically set on each page load before capturing user consent:
- GDPR-regulated regions (e.g., EU): Use
stop
as default. - Non-GDPR regions (e.g., most U.S. states): Use
consent
as default.
Cookie blocking
Clarity manages cookies by enabling or disabling them based on the consent state. When the Clarity framework is enabled and consent is denied, Microsoft cookies are not blocked outright but are restricted. Affected cookies include:
_clck
_clsk
CLID
MR
Steps to enable Microsoft Clarity via Secure Privacy:
To start using Microsoft Clarity with Secure Privacy, follow these simple steps:
- Navigate to Domain Settings:
Log in to your Secure Privacy dashboard and head over to Domain Settings. - Access the Advanced Tab:
Under the Domain Settings, you will see an Advanced tab. Click on it. - Enable the Toggle:
Within the Advanced tab, you will find a toggle specifically for Microsoft Clarity Mode. Simply enable it, and you are all set!
Test Your Implementation:
Use browser developer tools or Secure Privacyโs debug mode to ensure that:
- The Clarity script loads only when appropriate.
- Consent-based commands (
stop
orconsent
) are correctly executed.
Secure Privacy handles consent storage and synchronization, ensuring that once a user grants or denies consent, Microsoft Clarity behaves accordingly without additional manual coding.