- Microsoft Clarity is a free behaviour analytics tool: session recordings, heatmaps and frustration signals such as rage clicks.
- Pasting the Clarity tag into a Shopify theme gets recordings running, but Clarity then knows nothing about product views, cart adds, checkouts or campaigns.
- Sending Shopify events as Clarity custom events, and tagging sessions with the cart and the campaign, lets you filter recordings to the moments that cost sales.
- Install the Clarity tag once only, and check Microsoft's rules on consent and sensitive sites before you turn it on.
Microsoft Clarity on Shopify works in two layers. The Clarity tag records sessions and builds heatmaps as soon as it is on your store. To make those recordings useful for ecommerce, you also send Clarity your store's events (product viewed, added to cart, checkout started, purchase) and tag each session with its cart and campaign, so you can filter straight to, say, visitors from a paid campaign who added to cart and then left.
What is Microsoft Clarity?
Clarity is a free behaviour analytics tool from Microsoft. Where GA4 and Shopify reports tell you how many people did something, Clarity shows how they did it. Its core features:
- Session recordings: replays of real visits, with clicks, scrolls and page changes.
- Heatmaps: where visitors click and how far they scroll on each page.
- Frustration signals: rage clicks (repeated clicking in one spot), dead clicks (clicks that do nothing), quick backs (leaving a page right after arriving) and JavaScript errors.
Why it helps a Shopify store
Numbers tell you that a product page converts badly; recordings often show why. Typical findings: the add-to-cart button sits below a long image gallery on phones, a size selector does not respond, a discount field sends people off to search for codes, or a pop-up hides the checkout button. Clarity does not limit the number of sessions it records on its free plan, which makes it practical for stores of any size.
What the default install misses
Most stores add Clarity by pasting its tag into the theme or through an app. That starts recordings, but leaves four gaps:
| Gap | What it means |
|---|---|
| No ecommerce events | Clarity does not know when someone viewed a product, added to cart, started checkout or bought, so you cannot filter recordings on those moments. |
| No link to marketing | You cannot see how visitors from one campaign or ad platform behave compared with others. |
| Fragile placement | A tag pasted into theme code can disappear in a theme update or run twice after a second install. |
| No way to find one cart | You cannot jump from an abandoned cart to the session in which it was abandoned. |
How to set up Clarity on Shopify
- Create a Clarity project
Sign in at clarity.microsoft.com, add a project for your store's domain and copy the tracking code or project id.
- Install the tag once
Use Clarity's own Shopify app, or add the tag through one tool you already manage (a tag manager or an app embed). Do not combine two methods: the tag would run twice and every session would be counted double.
- Handle consent
Clarity records behaviour on your site. In regions that require it, load it only after consent, or pass the consent choice to Clarity through its consent API. Since 31 October 2025 Clarity needs a valid consent signal for visits from the EEA, the UK and Switzerland to work fully.
- Send ecommerce events and tags
Send Shopify events (view_item, add_to_cart, begin_checkout, purchase) as Clarity custom events, and set custom tags such as the cart id and the campaign.
- Check it after theme changes
Open the store, then the live view in Clarity, and confirm that sessions and events arrive. Repeat after a theme switch or a big app change.
The custom part comes down to two calls in Clarity's client API:
// What a Shopify-aware setup adds on top of the Clarity tag (Clarity client API)
clarity('event', 'add_to_cart'); // a custom event you can filter recordings on
clarity('set', 'cart_id', '<cart token>'); // a custom tag: find the sessions of one abandoned cart
clarity('set', 'utm_campaign', 'spring-sale'); // a custom tag: compare behaviour per campaignWhat to expect once it runs
With ecommerce events in Clarity, you can filter recordings and heatmaps on the steps that matter:
- product views and product lists;
- add to cart and remove from cart;
- cart views and checkout starts;
- purchases;
- searches and wishlist adds;
- 404 pages, to see how visitors react to a dead end.
Abandoned carts by cart id
With the cart's id set as a Clarity tag, you can take a cart that was abandoned in your store data, filter Clarity on that id and watch what happened just before the visitor left: a surprise shipping cost, a missing payment method, an error message.
- Watch random sessions
- Guess which ones contain a cart add
- No way to compare campaigns
- Filter: add_to_cart, no purchase
- Filter: campaign = spring-sale
- Jump to one abandoned cart
Clarity and ROASaurus
ROASaurus does not install Clarity: you keep your own Clarity tag. When it is on the page, the ROASaurus storefront script sends every event it tracks for a visitor who allowed tracking, except page views, to Clarity as a custom event under its GA4 name (such as view_item, add_to_cart, begin_checkout and page_not_found), and sets the cart's token as the Clarity tag cart_id. There is nothing to switch on: it starts when both tags are on the page. Only event names and the cart token go to Clarity, never ids of people, order values or contact details. The same events go to Hotjar when its tag is on the page. On Shopify the checkout and thank-you page run outside the theme, so purchases are not among them.
If you also connect Clarity under Connections › Channels with a token from Clarity's data export, ROASaurus tags sessions of visitors who consented with the ad platform and campaign (roasaurus_source, utm_campaign), and reads Clarity's daily export back: scroll depth, engagement time, rage clicks, dead clicks, quick backs and script errors per landing page and per campaign appear in Website › Visitors, next to sessions, conversion rate and revenue.

The Funnel page shows where in the steps from product view to purchase each campaign loses visitors; Clarity's recordings, filtered on the same campaign tag, show why.
Next step
Sources
- Microsoft Clarity: Client API (events and custom tags)
- Microsoft Clarity: Consent Mode
- Hotjar: Events API