π Integrate Hoppy Cookie with Microsoft Clarity
Microsoft Clarity records session replays and heatmaps of how visitors use your store. Because it can collect visitor behavior, it should only run after a visitor gives permission.
The Microsoft Clarity integration in GDPR EU Cookie Banner loads the Clarity script only after consent is given and keeps Clarity informed of every consent choice the visitor makes.
β οΈ Before You Begin
Make sure:
- GDPR EU Cookie Banner is installed, the App Embed is enabled, and your banner is published
- You have a Microsoft Clarity project and know its project ID
β οΈ Important: This integration works only if Clarity is set up through the banner. If Clarity is already installed through a theme, another app, or a custom script, remove it first. Otherwise Clarity can load before consent or run twice.
π Step 1 β Find Your Clarity Project ID
β‘οΈ Sign in to Microsoft Clarity
β‘οΈ Open your project's Settings
β‘οΈ Copy the project ID (a short code made of letters and numbers, for example abc123def456)
β οΈ Copy only the ID. Do not paste a full script, a URL, or extra spaces.
π οΈ Step 2 β Open the Integration
β‘οΈ Open GDPR EU Cookie Banner
β‘οΈ Click Integrations in the left menu
β‘οΈ Open the Microsoft Clarity card
βοΈ Step 3 β Enter the ID and Enable
β‘οΈ Paste your ID into Microsoft Clarity ID
(help text: Enter your Microsoft Clarity project ID)
β‘οΈ Click Enable so the status reads Microsoft Clarity is currently Enabled
β‘οΈ Click Save in the save bar
The integration only runs when it is enabled and an ID is entered.
π How It Works
When a visitor accepts
If the visitor accepts Marketing or Analytics cookies:
- The Clarity script is loaded
- Clarity is told which types of storage are allowed
Consent signals sent to Clarity
- Ad storage is granted when the visitor accepts Marketing, otherwise denied
- Analytics storage is granted when the visitor accepts Analytics, otherwise denied
The signal is updated every time the visitor changes their choices.
When a visitor declines both
The Clarity script is not loaded, and the consent signal is sent as denied.
β οΈ With the Decline only banner type, all cookies are allowed by default, so Clarity loads before the visitor makes a choice. If the visitor then declines, Clarity is sent a denied signal.
π§ͺ Step 4 β Test the Integration
You can also open View guide under Step 2: Test if integration with Microsoft Clarity works successfully inside the integration page.
Test with Accept
β‘οΈ Open your storefront in an Incognito or Private window
β‘οΈ Open the browser console (press F12)
β‘οΈ Click the accept button in the banner (default text: Accept)
β‘οΈ Type window.hoppyClarityLoaded and press Enter
Expected result: true
Test with Decline
β‘οΈ Open a fresh Incognito or Private window
β‘οΈ Decline marketing and analytics cookies
β‘οΈ Type window.hoppyClarityLoaded in the console
Expected result: undefined or false
You can also check the Network tab. A request to clarity.ms should appear only after consent is given.
π οΈ Troubleshooting
Clarity loads before consent
Clarity is installed somewhere else, such as theme code or another app. Remove it from there and let the banner manage it.
Clarity does not load after accepting
- Check that the status is Enabled and you clicked Save
- Check the ID has no extra spaces or characters
- Check that the visitor accepted Marketing or Analytics
- Check that the visitor is in a region where your banner is shown. Visitors outside your selected regions are not managed by the banner, so the integration does not load Clarity for them
No recordings appear in Clarity
Confirm the project ID matches the Clarity project you are checking, and that visitors accepted Marketing or Analytics.
Clarity ran twice
Remove any other Clarity installation.
β οΈ Important Notes
- Changing consent later updates the signal sent to Clarity
- The integration does not need theme code changes
- Keep your privacy policy up to date to mention session recording
π Final Result
β Clarity loads only after Marketing or Analytics consent
β Clarity always receives the visitor's latest consent choices
β No theme edits are needed
Updated on: 27/11/2026
Thank you!