Microsoft Clarity collects user session data using a cookie. The cookie tells Clarity how a user accessed your site, the user's location, the user's language preference, and more.
As a website publisher, you might be subject to a law that requires you to obtain consent before collecting users' personal information, such as the European Union's General Data Protection Regulation and ePrivacy Directive. Other laws might require you to give your users the ability to opt-out of your use of cookies.
Instructing Clarity to require consent before placing a cookie
By default, Clarity's tracking code loads immediately, before your user has indicated whether they consent to this.
You need to actively change this setting so that the Clarity tracking code doesn't set cookies by default and instead waits for a signal that indicates that consent was given.
Step 1: Configure Microsoft Clarity to require consent
- Log into Microsoft Clarity.
- Select ⚙ Settings from the top menu.
- Select { } Setup from the menu on the left
- Under Advanced settings toggle off Cookies.
Clarity will notify you that cookies are off.
Clarity cookie setting.
Note
Clarity's recordings won't be linked together into multi-page sessions until you inform Clarity of a visitor's consent. Heat maps and data other than session recordings will continue to be available to you.
Step 2: Passing consent data to Microsoft Clarity
To enable Microsoft Clarity's tracking capabilities, or to disable it when consent is withdrawn you need to add a script to your website's template.
This script will listen for a consent signal from Cookiebot and trigger either an opt-in or an opt-out, depending on whether a visitor has consented to the use of cookies in the "statistics" category.
<script>
window.addEventListener('CookiebotOnConsentReady', () => {
window.clarity('consent', Cookiebot.consent.statistics);
})
</script>
Step 3: Confirming Microsoft Clarity doesn't set cookies
- Clear cookies for your website.
- Navigate to your website.
- Reject statistical cookies.
- Ensure Clarity is loaded.
- Check your browser cookies and observe that there's no entry for
_clck
or_clsk
.
Comments
0 comments
Please sign in to leave a comment.