NOTE: Microsoft Clarity offers the ability to collect website analytics without tracking users as they navigate between pages. In other words, it will record single page sessions of user activity for users the 'deny' the Microsoft Clarity Service. When users click 'accept all', Microsoft Clarity will place a cookie on the users browser, allowing Microsoft to combine the entire website visitor session (meaning one recording will contain all page visits that a website visitor made).  The instructions below outline how to set up compatibility with this Microsoft feature.  



NOTE: If you are using Google Tag Manager to load the Microsoft Clarity script, you must first set up compatibility with Google Consent Mode.



Instructing Clarity to require consent before placing a cookie




Step 1: Configure Microsoft Clarity to require consent


  1. Log into Microsoft Clarity.

  2. Select ⚙ Settings from the top menu.

  3. Select { } Setup from the menu on the left

  4. Under Advanced settings toggle off Cookies.

  5. Clarity will notify you that cookies are off.




Step 2: Passing consent data to Microsoft Clarity


  1. Log into your Termageddon account

  2. Click into your respective license

  3. Click ‘edit’ for the Cookie Policy and Consent Tool

  4. Towards the bottom of this page, select the option to Enable Microsoft Clarity Compatibility

  1. Click “Next” to save

  2. Paste this code directly below your Usecentrics V3 script (from step #1 above): 


<script>

  window.addEventListener('ucClarityConsent', function (event) {

    window.clarity('consent', event.detail['Microsoft Clarity']);

  });

</script>

(if you are using the Termageddon WordPress plugin, you can add this code via the 'Additional Scripts" area)

(this is the code that is for Usercentrics V2, which the vast majority of Termageddon customers use. If you use usercentrics V3, use this code instead).



That’s it. Now, cookies will be off by default for Microsoft Clarity and multi-page session recordings will only occur after a user provides proper consent. 



Testing:


In the video guide above, we show how to test to ensure Microsoft Clarity is properly responding to user consent choices.  


Additionally, Microsoft discloses in this article how to test to ensure consent is being captured. 



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.



Sources
1. Usercentrics: https://support.usercentrics.com/hc/en-us/articles/17540715282332-Setting-up-Microsoft-Clarity-to-require-consent


2. Microsoft Clarity: https://learn.microsoft.com/en-us/clarity/setup-and-installation/cookie-consent#:~:text=%2C%20false)-,Steps%20to%20confirm%20Clarity%20isn%27t%20writing%20cookies,-Note