Overview
This guide explains how to integrate the Microsoft Clarity Consent API with your Shopify store using the CookieYes app. Once integrated, Clarity respects the consent choices visitors make on your CookieYes cookie banner and only sets cookies after they give consent.
How the integration works
CookieYes passes visitors' consent choices to Microsoft Clarity through the Consent API. Clarity sets cookies only after visitors accept analytics cookies.
Note
Clarity continues to record sessions when visitors reject cookies, but without setting cookies.
Prerequisites
- The CookieYes app installed on your Shopify store with the cookie banner active. For setup steps, see Shopify setup guide.
Steps to integrate Microsoft Clarity Consent API with Shopify via CookieYes
Step 1: Enable Consent API Integration in CookieYes
The Microsoft Clarity Consent API integration is on by default. To check it or turn it on:
- In your Shopify admin, go to CookieYes > Integrations.
- On the Microsoft Clarity card, click Configure.
- Turn on Microsoft Clarity Consent API.
Step 2: Install the Microsoft Clarity app
- In your Shopify dashboard, go to Apps.

- Search for Microsoft Clarity, then select it from the results.

- Click Install.

- Review the data access permissions and click Install.

After installation, you're redirected to your Shopify admin.
- In your Shopify admin, open the Microsoft Clarity app.
- In the side panel, select Setup.
- Under Advanced settings, turn on Cookies.
- Go to your Clarity dashboard to view session data.
Session data can take a few hours to appear in your Clarity dashboard.
Step 4: Verify consent-based tracking
To confirm that Clarity respects visitor consent:
- Open your Shopify store in an incognito window.
- Reject analytics cookies. In your browser's developer tools, confirm that no Clarity cookies (such as
_clck and _clsk) are set. - Accept analytics cookies and confirm that the Clarity cookies are set.
- Check your Clarity dashboard to confirm that sessions are recorded.
Conclusion
Your Shopify store now shares visitors' consent choices with Microsoft Clarity, so Clarity only sets cookies after visitors give consent.