How to add Microsoft Clarity to Shopify, in short: install Microsoft's free Microsoft Clarity: AI
Insights app from the Shopify App Store, turn on Clarity JS in the app settings and save. Then switch
on Shopify's own cookie banner (Settings > Customer privacy > Cookie banner) so UK and EU visitors can give
consent, which Clarity picks up automatically. If you'd rather not use the app, you can paste Clarity's code into your theme's
theme.liquid file (or load it through Google Tag Manager), but then you have to pass consent to Clarity yourself.
How to add Microsoft Clarity to any other website: create a project at clarity.microsoft.com, go to
Settings > Setup, and either pick your platform (WordPress, Wix, Squarespace and others), connect Google Tag
Manager, or click Get tracking code and paste it into the <head> of every page. Then pass your
cookie banner's decision to Clarity, or recordings from UK and EU visitors break into one-page fragments.
Clarity is the tool I install when a client says "people visit but nobody buys, and I don't know why". It shows you heatmaps and session recordings of real visitors, it's free, and it takes ten minutes to set up. The part most guides skip is consent: since late 2025 Microsoft enforces a consent signal for visitors from the UK, the EEA and Switzerland, and without one you lose most of what makes Clarity useful. This guide covers the setup for Shopify and for everything else, the consent piece, privacy settings, and what to look at once the data arrives.
What Microsoft Clarity is, and what it costs
Clarity is Microsoft's behaviour analytics tool. Where Google Analytics counts things (visits, sources, add-to-carts, revenue), Clarity shows you how people actually use each page:
- Session recordings: replays of real visits, with mouse movement, taps, clicks and scrolling
- Heatmaps: click maps, scroll maps, area maps, attention maps and, for online shops, conversion maps
- A dashboard of frustration signals: rage clicks, dead clicks, excessive scrolling, quick backs and JavaScript errors
- Smart events and funnels: actions such as Add to Cart or Purchase, set up without code
- Copilot in Clarity: generative AI summaries of recordings and heatmaps, plus a chat box for questions about your data
Cost: Microsoft says Clarity is free forever, with no traffic limits, no sampling of your traffic and no paid upgrade. There are practical caps worth knowing, though. Clarity keeps up to 100,000 recordings per project per day (beyond that it samples), a heatmap is built from up to 100,000 page views, and recordings are kept for 30 days. Heatmap and click data, and any recordings you favourite or label, are kept for 9 months.
What it doesn't do: it isn't a replacement for GA4. It won't give you revenue by channel or proper eCommerce
reporting, so keep (or set up) GA4 on Shopify alongside it. Clarity can't see inside
<canvas> elements or third-party iframes, and Microsoft says it shouldn't be used on sites aimed at under-18s.
What it records about people: by default Clarity masks sensitive content. Text typed into input boxes and dropdown choices are masked in every mode, and masked content is never uploaded. More on the settings below.
Step 1: create a Clarity project
- Go to clarity.microsoft.com and click Sign up (or sign in), then choose a sign-up method and follow the steps.
- On the Projects page, click New project.
- Enter a name and your website address, then click Add new project.
- Clarity takes you to the setup screen, where you choose how to install it.
Use one project per website. Each project has its own tracking code, and Microsoft recommends a separate project for each domain. If you're on Shopify, you can skip this step: the Shopify app can create the project for you.
How to add Microsoft Clarity to Shopify
There are four ways people add Clarity to a Shopify store. For most stores the app is the one to use, two others work if you're willing to do some extra wiring, and one doesn't work at all.
| Method | Verdict | Why |
|---|---|---|
| Microsoft Clarity: AI Insights app | Use this | Microsoft's own app, free, picks up Shopify's cookie banner, and adds Shopify purchase data to the dashboard |
Tracking code in theme.liquid | Works, with extra wiring | Runs on storefront pages only, a theme change can remove it, and you have to pass consent to Clarity yourself. Steps below |
Google Tag Manager, loaded in theme.liquid | Works, with extra wiring | Sensible if you already run GTM on your theme. Same limits as theme code: storefront only, and consent is up to you |
| Custom pixel (Settings > Customer events) | Don't | Shopify's pixel sandbox can't read the page, track scrolling or record clicks for heatmaps, which is exactly what Clarity needs |
The custom pixel point catches people out, because it's the right answer for the Meta Pixel and for GA4. Shopify's own help centre lists what pixel sandboxes can't do, including page scrolling, DOM scraping and "clicks and mouse movement to create heatmaps". Clarity is built on exactly those things, so leave it out of Customer events.
Installing the Shopify app (new installation)
- In the Shopify App Store, search for Microsoft Clarity: AI Insights (the developer is Microsoft Clarity) and click Install.
- Review the data access permissions in the pop-up and click Install.
- The app asks How would you like to set up Clarity? Choose Clarity only for heatmaps, recordings and insights, or Clarity with Brand Agents, which adds Microsoft's AI shopping assistant on your store and means agreeing to its separate terms. Click Continue.
- On Set up Clarity, click Go to theme settings to have the app create a new Clarity project, or Link my existing Clarity project if you already have one.
- The theme editor opens in a new tab at App embeds, with Clarity JS listed. Make sure it's switched on and click Save (top right). Close the tab and go back to the app.
- The app's page should refresh on its own. If it doesn't, click Refresh.
That's it. Microsoft says to allow a few hours for the dashboard to fill. You can open Clarity's dashboard, recordings and heatmaps from inside the Shopify admin, and pinning the app keeps it one click away.
If Clarity was already on your store
If you or a developer previously pasted the Clarity code into your theme, the app asks you to connect that existing project instead.
Click Connect Project, and Clarity emails the project admin. Follow the link in the email, sign in to Clarity to
connect it, then go back to the app and refresh. Microsoft says the app migrates theme installs without any code changes. Once it's
connected, check your theme.liquid for a leftover Clarity snippet anyway: old code left in themes is part of
the hidden cost of cheap Shopify themes, and you only want Clarity loading once.
One quirk from Microsoft's FAQ: the app connects using your store owner's credentials, so it may create a new Clarity account and project. To use an existing project from a different account, add the store owner's email address as a member of that project.
What the app adds for Shopify stores
Clarity has eCommerce features that only work on Shopify. Every Shopify project gets a Purchases card and filter, so you can watch only sessions that bought (or didn't). Checkout abandonment, broken down by contact information, shipping, payment and "other", is Shopify Plus only, and Microsoft notes that checkout and post-checkout pages are tracked through Shopify's pixel for Plus stores. Microsoft doesn't document checkout tracking on other plans, so expect Clarity to see your storefront, not your checkout. Product filters (price, brand, availability, rating) come from Product JSON-LD, which most themes output; if yours is patchy, this is why Shopify schema breaks.
The consent piece on Shopify
Microsoft's guidance is that Clarity detects consent automatically once Shopify's cookie banner is turned on. To set it up:
- Make sure you've published a privacy policy (Shopify requires one before the banner can be used).
- In the Shopify admin, go to Settings > Customer privacy and click Cookie banner.
- In Regions and content, turn on the automated settings, or click Edit to choose regions and wording yourself, then Save.
- Set the appearance and position, save, and use Preview (top right) to see it on your store.
Two catches. Shopify's automated settings only configure the banner for the UK and EEA if you have active markets there, so check the regions rather than assuming. And if you use a third-party cookie banner app instead of Shopify's, it has to feed Shopify's customer privacy settings; if its regions don't match, Shopify warns that data can be processed before a visitor consents.
Installing Clarity on Shopify without the app
Microsoft's app is the route it documents for Shopify, and it's the one I'd pick for most stores. But you don't have to use it. There are two ways to run Clarity from your theme instead, and both need one extra job the app does for you: passing your cookie banner's decision to Clarity.
Option 1: paste the tracking code into theme.liquid
- In Clarity, go to Settings > Setup, click Install manually, then Get tracking code and copy it.
- In the Shopify admin, go to Online Store > Themes.
- Next to your current theme, click the ... button, then Edit code. (It's worth clicking Duplicate in the same menu first, so you have a backup.)
- In the Layout folder, open
theme.liquid. - Find the closing
</head>tag and paste the Clarity code on the line just above it. - Click Save (or press Ctrl+S).
Three things to know about theme code:
- It lives in that one theme. Publish a different theme and Clarity stops, because the new theme doesn't have the code. When you update your theme, Shopify tries to carry your code edits across, but if they conflict with the update it tells you "code edits could not be included" and you have to copy them over yourself. Check after every theme change or update.
- It doesn't reach checkout. Shopify's checkout doesn't use your theme's layout.
checkout.liquid, the old Plus-only way to add code there, is no longer supported for the checkout steps, and Shopify switched off additional scripts on the Thank you and Order status pages (from 28 August 2025 for Plus stores and 26 August 2026 for everyone else). Tracking on those pages now goes through Shopify's pixels (which is how the app gets checkout data for Plus stores), and theme code can't get there. So theme code covers your storefront: home, collections, products, cart and content pages. - Consent isn't passed automatically. See passing consent without the app below. Without it, UK and EU visits break into one-page fragments.
Option 2: Google Tag Manager, loaded from theme.liquid
If you already use GTM, you can load Clarity as a tag inside your container. Add GTM's container snippet to theme.liquid
the same way (GTM gives you a <head> part, which goes just above </head>, and a
<body> part, which goes just after the opening <body> tag), then add the Clarity tag in GTM
using any of the routes in Method 2: Google Tag Manager further down. The same limits apply: storefront only,
re-check after theme changes, and you wire consent yourself.
Be aware that Shopify's own GTM guide sets up GTM as a custom pixel in Settings > Customer events, not in your theme. Shopify says tag managers loaded that way have "the same restrictions as any other pixels", so a Clarity tag inside a pixel-based GTM container can't record sessions or build heatmaps, for the reason in the table above. If Clarity is going through GTM, that GTM container has to be loaded from your theme.
Passing consent to Clarity without the app
The app reads Shopify's cookie banner and tells Clarity what the visitor chose. Theme code doesn't. To do it yourself, keep
Shopify's cookie banner switched on (as above) and add a small script that reads Shopify's Customer Privacy API and
passes the answer to Clarity's Consent API. Paste this into theme.liquid just below the Clarity (or GTM)
code, still above </head>:
<script>
// Queue Clarity calls until Clarity has loaded (the same line Clarity's own code uses)
window.clarity = window.clarity || function () {
(window.clarity.q = window.clarity.q || []).push(arguments);
};
function sendClarityConsent(analytics, marketing) {
window.clarity('consentv2', {
ad_Storage: marketing ? 'granted' : 'denied',
analytics_Storage: analytics ? 'granted' : 'denied'
});
}
// Visitors who already said yes on an earlier page
if (window.Shopify && window.Shopify.loadFeatures) {
window.Shopify.loadFeatures(
[{ name: 'consent-tracking-api', version: '1.0' }],
function (error) {
if (error) return;
var privacy = window.Shopify.customerPrivacy;
if (privacy.analyticsProcessingAllowed()) {
sendClarityConsent(true, privacy.marketingAllowed());
}
}
);
}
// Visitors who make or change their choice on this page
document.addEventListener('visitorConsentCollected', function (event) {
sendClarityConsent(event.detail.analyticsAllowed, event.detail.marketingAllowed);
});
</script>
How it works:
Shopify.loadFeaturesloads Shopify's consent API, after which it's available aswindow.Shopify.customerPrivacy.analyticsProcessingAllowed()returns true if the visitor has allowed analytics, andmarketingAllowed()does the same for marketing. On page load the script only tells Clarity about a yes; Microsoft says that if a visitor declines, you don't need to do anything.- Shopify fires the
visitorConsentCollectedevent when a visitor's consent changes (not on every page), withanalyticsAllowedandmarketingAllowedinevent.detail. If someone withdraws consent, the script sendsdenied, and Microsoft says Clarity then deletes its cookies and carries on in no-consent mode. consentv2takes two values,ad_Storageandanalytics_Storage, each"granted"or"denied". Mapping Shopify's analytics choice toanalytics_Storageand its marketing choice toad_Storageis the closest fit.
Then run the console check in Checking consent is working below, before and after accepting the banner. If the
values don't change from DENIED to GRANTED, the script isn't running.
App or no app?
Going without the app makes sense if you already manage your tags in GTM and want Clarity in the same place, or you want every tracking script on the store set up and consent-gated the same way, by hand, where you can see it. The downsides are real, though: you wire and test consent yourself, a theme change or a conflicting update can silently remove the code, and you lose what the app brings on Shopify, such as the Clarity dashboard inside your admin and the automatic pickup of Shopify's cookie banner. Microsoft only describes its Shopify Plus checkout tracking in the context of the app, so don't expect that from theme code either. If none of the reasons to skip it apply to you, use the app.
How to add Microsoft Clarity to any other website
In your Clarity project, go to Settings > Setup. You'll see three installation methods: install on a third-party platform, install manually, or install with npm. There's also Share code, which emails the code and instructions to a developer.
Method 1: paste the tracking code into the head
- Click Install manually, then Get tracking code.
- Copy the code exactly as shown (Microsoft warns against pasting it through a text editor first).
- Paste it into the
<head>section of every page you want tracked. On most sites that means one shared layout or header template; on an ASP.NET Core site like this one, it's_Layout.cshtml.
The same code works across subdomains of one site. If you build with a JavaScript framework, Microsoft also publishes an official
npm package, @microsoft/clarity, which does the same job from your code.
Method 2: Google Tag Manager
Microsoft documents three routes. The first is the one it recommends:
- Connect from Clarity: in Settings > Setup > Google Tag Manager, click Finish setup, sign in with Google and click Allow, choose your GTM account and container, then click Create and publish. Clarity creates and publishes the tag for you.
- Clarity's GTM template: in GTM, click New Tag, open Tag Configuration, choose Discover more tags in the Community Template Library, search for Clarity and pick Microsoft Clarity - Official, then Add to workspace. Enter your Clarity project ID (it's in the project's URL:
clarity.microsoft.com/projects/view/<project ID>/), set the trigger to All pages, save, then Submit and Publish. - Custom HTML: create a Custom HTML tag, paste the tracking code from Get tracking code, add the All pages trigger and save.
You can only link one GTM tag to a Clarity project at a time, so don't add the template and a Custom HTML tag.
Method 3: WordPress (and WooCommerce)
- In your WordPress dashboard, go to Plugins > Add new plugin.
- Search for Microsoft Clarity, then install and activate it.
- Open the Clarity plugin from the menu and click Sign in.
- Choose an existing project and click Continue, or click New project to create one.
Clarity's dashboard, recordings and heatmaps then appear inside WordPress. Microsoft's steps cover WooCommerce sites too.
Other platforms
- Wix: Apps > App Market, search for Microsoft Clarity, Add to site, then sign in and connect or create a project. Microsoft notes it only works on Wix sites with a registered domain.
- Squarespace: Settings > Advanced > Code Injection, paste the tracking code into the Header field and save. You need a Squarespace plan that allows custom JavaScript.
- Everything else: Clarity's setup screen lists more platforms under View all platforms (Webflow, Joomla, Weebly, HubSpot and others). If yours isn't there, use the manual tag.
Consent: the part that decides whether Clarity is any use
Microsoft's rule: since 31 October 2025, Clarity enforces a consent signal for page visits from the EEA, the UK and Switzerland. Consent Mode is on by default for those visitors, and Clarity works out where they are from their IP address. Where you're based doesn't matter; where your visitors are does.
Without a consent signal, Clarity still runs but sets no cookies and treats every page view as a new session. In practice that means pages per session is always 1, quick backs are always 0, funnels show a full drop-off at every step, every visitor counts as new, and you can't follow anyone's journey from product page to cart. For a UK shop, that's most of the value gone.
Does UK law require consent for Clarity? I'm a developer, not a lawyer, so check with your own adviser, but this is how the rules read on 1 December 2026. Under PECR, non-essential cookies normally need consent. The Data (Use and Access) Act 2025 added a "statistical purposes" exception, in force since 5 February 2026. The ICO's guidance says it covers only aggregate statistics used to improve your site, and that "logs or recordings of individual visitors to your website and the actions they took" still need consent (unless they're for security). It also expects any analytics provider to use the data only to improve your service. Session recordings are individual recordings, so treat Clarity as needing consent. Microsoft requires the consent signal for full functionality either way.
How to pass consent to Clarity
Pick whichever matches your site:
- Shopify: turn on Shopify's cookie banner (above). If you use Microsoft's app, Microsoft says no further action is needed. If you installed Clarity through theme code or GTM, add the consent script above as well.
- Wix: turn on the Wix cookie banner and Clarity detects consent automatically.
- WordPress: Microsoft points to the CookieYes plugin, which passes consent to Clarity once configured.
- Google Consent Mode: Microsoft's Google Consent Mode page says Clarity reads
ad_storageandanalytics_storagesignals from Google Consent Mode automatically. (One older answer in its FAQ still says this is "coming soon", so test it with the check below.) - A supported consent platform: Microsoft names CookieYes and lists others on its CMP page.
- Your own banner: call Clarity's Consent API (version 2) when the visitor makes a choice.
The Consent API call, from Microsoft's docs, looks like this when a visitor accepts:
window.clarity('consentv2', {
ad_Storage: "granted",
analytics_Storage: "granted"
});
If they decline, you don't need to do anything: Clarity sets no cookies. If someone withdraws consent later, call
window.clarity('consent', false), which clears Clarity's cookies and stops tracking until consent is given again. Use consentv2 rather than the old consent API for granting, which Microsoft plans to retire.
Cookies for everyone, or only after consent?
In Settings > Setup, under advanced settings, there's a Cookies toggle. Turned off, Clarity waits for consent from every visitor, wherever they are, which is the cautious choice if your audience is mostly UK and EU anyway. The same screen has Bot detection, which is on by default and keeps bot sessions out of your numbers.
Checking consent is working
Open your site, open the browser's developer tools (Ctrl+Shift+I on Windows), go to the Console tab and run Microsoft's check:
clarity('metadata', (d, upgrade, consent) => {
console.log('consentStatus:', consent);
}, false, true, true);
Before you accept cookies, both values should read DENIED. Accept on your banner, run it again, and they should change
to GRANTED. You can also clear your cookies, decline, and confirm there's no _clck or _clsk
cookie while Clarity's collect requests still go out.
Your privacy policy should mention Clarity too: Microsoft's FAQ says you need to tell visitors about the cookies it uses.
Connecting Clarity to GA4
The GA4 integration pulls your Google Analytics data into Clarity so you can jump from a traffic source or popular page straight to the matching recordings and heatmaps.
- Finish installing Clarity first: the integration needs the tracking code running.
- In Clarity, go to Settings > Setup and click Get Started under Google Analytics integration.
- Sign in with a Google account that has access to your Analytics property.
- Select the web property you want Clarity to pull data from and click Save.
Afterwards, Dashboards > Google Analytics shows an audience overview, acquisition report, popular pages, and sessions by country and device, each linking to filtered recordings and heatmaps. Limits to know: one Analytics property per Clarity project, GA segments don't work with GA4, and Microsoft says Clarity doesn't send its playback URL into GA4, so don't expect Clarity links inside your GA4 reports. The data flows from GA4 to Clarity, not back.
Privacy settings: masking and excluding your own visits
Masking
Go to Settings > Masking and choose a mode:
- Strict: all content is masked.
- Balanced (the default): only content Clarity classes as sensitive, which means numbers and email addresses.
- Relaxed: nothing is masked except input boxes and dropdowns, which are masked in every mode.
Under Mask by element you can add CSS selectors to mask or unmask specific parts of the page, or add
data-clarity-mask="true" or data-clarity-unmask="true" to the HTML. Changes take up to an hour and only
apply to new recordings. Leave Balanced on unless you have a reason; if your pages show customer details (an account area, order
lookup or a B2B price list), add those sections as masked elements. Clarity doesn't mask content inside stylesheets, so keep anything
sensitive out of your CSS.
Excluding your own visits
Go to Settings > IP blocking, click Block IP address, give it a name, and tick
Block my current IP or enter addresses (CIDR ranges such as 203.0.113.0/24 work). It takes about 15
minutes. Clarity only supports IPv4, and phones on mobile data don't have stable addresses, so this covers your office or home
connection, not your mobile. To confirm, open your site from the blocked connection and look for the console message saying data
from the session isn't being collected.
Checking Clarity works, and how long data takes
- Straight away: once the code is live, Clarity's live view shows current visitors. Open your own site in another browser and click Watch now.
- In the browser: in developer tools, open the Network tab and look for POST requests to
clarity.ms/collectas you click around. - Dashboard and heatmaps: Microsoft says it takes a few hours for data to appear in the dashboard, and the Shopify app says the same. Don't judge anything on day one.
What to look at first
Clarity gives you more than you can watch. With a fortnight of data, this is where I start on a client's store:
- The dashboard's frustration signals. Microsoft defines a rage click as several rapid clicks in one area, a dead click as a click that gets no visible response, a quick back as leaving for a page and returning quickly, and excessive scrolling as scrolling well beyond the expected average. Each card links to the pages where it happens.
- Recordings filtered by those signals. In Recordings, open Filters > User actions > Insights and choose Rage clicks or Dead clicks, then add a Device filter for mobile. Watch ten. Patterns show up fast: a product image people expect to zoom, a size chart link that does nothing, a "sold out" variant that still looks clickable.
- Click maps on your top product and collection pages. In Heatmaps, enter the page URL and switch between all clicks, dead clicks and rage clicks. Then check the scroll map: if half your visitors never reach your reviews or delivery information, move them up.
- On Shopify: filter recordings by Purchases: No for sessions that reached the cart, and (on Plus) by checkout abandonment step.
- JavaScript errors and click errors. An error that fires on the add-to-cart button is a bug costing you sales, and Clarity shows you the recordings where it happened.
Then turn what you see into fixes, one at a time, and use Clarity's heatmap compare to see whether behaviour changed. My guide to fixing a low Shopify conversion rate covers the usual culprits, and if recordings show pages that take an age to load, find out which apps are slowing your store.
Smart events and Copilot. Clarity auto-detects up to nine event types (Purchase, Add to Cart, Begin Checkout, Contact Us, Submit Form, Request Quote, Sign Up, Login and Download), and admins can create up to 20 custom ones in Settings > Smart events > New event, no code needed. Copilot's session and heatmap summaries save time, but Microsoft itself warns that generative AI can get things wrong, so watch the recording before acting on a summary. You can turn Copilot features off in Settings > Copilot.
Common Clarity problems
- Every page is a separate session, pages per session is 1 and quick backs are 0. Consent isn't reaching Clarity for UK or EU visitors. Turn on Shopify's cookie banner, connect your consent platform, or add the Consent API call, then run the console check above.
- No data at all. Check the code is in the
<head>of every page, and compare the script on your site with the one under Install manually, checking thesrc: if another site's data turns up in your project, the wrong code has been pasted. Then look forcollectrequests in the Network tab. Browser extensions that block trackers can stop Clarity in your own browser, so test in a clean profile. - Clarity stopped after a Shopify theme change. Microsoft's FAQ says theme changes can remove a theme-installed script. The app avoids this. If you're on theme code, either move to the app or paste the code (and your consent script) into the new theme's
theme.liquid. - The Shopify app made a new project instead of using mine. Add your store owner's email address as a member of the existing project, then connect it.
- No checkout data. Microsoft only documents checkout tracking, and the checkout abandonment card, for Shopify Plus stores.
- Recordings look broken or unstyled. Clarity rebuilds the page from your CSS, so stylesheets must be publicly reachable without a login. Content inside canvas elements and third-party iframes won't appear.
- Clarity is blocked by your Content Security Policy. If your site sends a CSP header, add Clarity's domains as listed on Microsoft's Clarity CSP page.
- Clarity loads twice. If you've used more than one method (the app plus theme code, or GTM plus a hard-coded tag), keep one and remove the rest.
If you'd rather hand the tracking over, I set up and fix analytics and tracking on Shopify, from GA4 and the Meta Pixel to tools like Clarity; get in touch for a quote.
Microsoft Clarity: frequently asked questions
Is Microsoft Clarity free?
Yes. Microsoft says Clarity is free forever, with no traffic limits, no sampling of your traffic and no paid upgrade. It keeps up to 100,000 recordings per project per day and stores recordings for 30 days.
How do I add Microsoft Clarity to Shopify?
Install the free Microsoft Clarity: AI Insights app from the Shopify App Store, choose Clarity only (or Clarity with Brand Agents), click Go to theme settings, make sure the Clarity JS app embed is switched on and click Save. Then turn on Shopify's cookie banner under Settings > Customer privacy > Cookie banner so Clarity receives consent from UK and EU visitors.
Can I add Microsoft Clarity to Shopify without the app?
Yes. Paste Clarity's tracking code (or your Google Tag Manager container, with Clarity as a tag inside it) into your theme's theme.liquid file, just before </head>, via Online Store > Themes > ... > Edit code. It only runs on storefront pages, not checkout, and you have to re-add it if you change theme. You also have to pass consent yourself: theme code doesn't pick up Shopify's cookie banner the way the app does, so add a script that reads Shopify's Customer Privacy API and calls Clarity's consentv2 API.
Can I add Microsoft Clarity to Shopify as a custom pixel?
It's not a good idea. Shopify's pixel sandbox can't read the page, track scrolling or record clicks for heatmaps, which is what Clarity relies on. Use Microsoft's Shopify app instead.
How do I add Microsoft Clarity to a website that isn't on Shopify?
Create a project at clarity.microsoft.com, go to Settings > Setup and either choose your platform (such as WordPress, Wix or Squarespace), connect Google Tag Manager, or click Get tracking code and paste it into the head of every page.
Does Microsoft Clarity need cookie consent in the UK?
In practice, yes. Microsoft has enforced a consent signal for visitors from the UK, EEA and Switzerland since 31 October 2025, and without it every page view becomes a separate session. The ICO's guidance on the analytics exception says recordings of individual visitors still need consent. Check with your own adviser for your situation.
How long does Clarity take to show data?
Live visitors show within moments of installing the code, but Microsoft says dashboard data takes a few hours to appear. Give it a week or two before drawing conclusions.
Does Microsoft Clarity slow down my site?
Clarity adds one script to your pages, and Microsoft says it doesn't interfere with your other JavaScript. Every script adds some work for the browser, though, so install it once, through one method, and test your page speed before and after.
Can Clarity replace Google Analytics?
No. Clarity shows how people use your pages through recordings and heatmaps; GA4 measures traffic sources, conversions and revenue. Use both, and connect them with Clarity's Google Analytics integration.
