Cookie Consent Bar (Privacy & Compliance App) with Microsoft Clarity

Topic summary

A user seeks guidance on integrating Microsoft Clarity with Shopify’s “Privacy and Compliance” app to ensure Clarity only triggers after cookie consent is accepted.

They need help with:

  • A) Where to place the consent-triggered code in their Shopify theme
  • B) Whether Microsoft Clarity’s provided JavaScript will work with this setup

A screenshot showing Microsoft Clarity’s implementation instructions was shared but not described in detail.

Current Status: The original question remains unanswered. A follow-up comment notes that Shopify’s native cookie banner reportedly lacks compatibility with Clarity—possibly due to missing JavaScript API functionality that third-party consent apps provide. The discussion remains open with no confirmed solution.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hello! I want to add a cookie consent bar with the Shopiy App “Privacy and Compliance” to a Shopify site but we also are testing Microsoft Clarity.

Clarity gives instructions on editing code to trigger only when cookie consent has been accepted but I don’t know where to add this in the theme code.

Can anyone help tell me A) where to put the code assuming that the Shopify App Privacy and Compliance has been installed and B) if the Java Script below will work?

Here is what Microsoft Clarity instructs:

1 Like

Looks like you never got a reply to this!

FYI, a Dev I was talking to today said the native Shopify Cookie Banner isn’t compatible with Clarity - you need one of the 3rd-party consent apps. I don’t know why - perhaps having a Javascript API is something only the paid apps have. But it’s a shame Shopify doesn’t make their banner compatible.