Articles on: Integrations

Integrating Microsoft Clarity Consent API Using Pandectes

Microsoft Clarity is a free analytics tool that offers heatmaps and session recordings to help you understand user behavior on your website. However, since Clarity collects behavioral data, using it in the EU requires prior user consent under the GDPR and ePrivacy Directive.


With Pandectes, you can easily integrate Microsoft Clarity into your Shopify store and ensure that data collection only starts after valid user consent is obtained.



Prerequisites


Before you start:


  • You must have a Microsoft Clarity account.
  • Your Shopify store should have the Pandectes GDPR Compliance app installed and configured.
  • Make sure you have enabled the Microsoft Clarity integration inside the app.




The Clarity Consent API lets you delay Clarity tracking until the user has provided valid consent. This helps you stay compliant with GDPR and prevents unauthorized tracking.


When appropriately integrated, Clarity will only activate if the user has accepted the necessary cookies through the Pandectes consent banner.


How the Integration Works


When the integration is enabled:


  1. The Clarity script is not activated immediately.
  2. Pandectes waits for the user’s consent.
  3. Once the user accepts Performance cookies, the app will trigger the Clarity Consent API with the correct values.
  4. Microsoft Clarity then begins tracking in accordance with user consent.


Enable Microsoft Clarity in Pandectes


Follow these steps:


  1. Log in to your Shopify store and access Pandectes app.
  2. Go to Settings > Integrations.
  3. Scroll to Microsoft Clarity.
  4. Toggle the switch to enable the integration.
  5. Paste your Clarity Project ID if you want to load the snippet from Pandectes.



Once enabled, Pandectes will handle the logic for firing the Clarity Consent API based on the user’s selection.


Updated on: 30/07/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!