How to Add Microsoft Clarity to WordPress for Beginner Website Insights

Google Analytics tells you how many people visited a page and how long they stayed, but it doesn’t tell you why they left without clicking your call to action. Microsoft Clarity fills that gap — it’s a free tool that records real visitor sessions and builds heatmaps showing exactly where people click, scroll, and get stuck.

I usually recommend Clarity as the first behavioural-analytics tool for a new WordPress site, mainly because it costs nothing and has no traffic cap, unlike most of the paid alternatives. Setup takes a few minutes and the data starts showing up almost immediately. If you’re still working through the earlier stages of getting a site live, the step-by-step guide to building a WordPress website covers what to have in place before analytics tools like this one are worth adding.

What Clarity Actually Shows You

Standard analytics — including Google Analytics 4 — is built around aggregate numbers: sessions, bounce rate, conversion events. Useful, but it can’t show you the specific moment a visitor hesitated over a form field or gave up scrolling halfway down a page.

Clarity’s session recordings and heatmaps close that gap by showing actual visitor behaviour rather than summarised numbers. Watching a handful of real sessions on a page that isn’t converting tends to reveal the problem faster than staring at a GA4 dashboard — a confusing menu, a button that looks unclickable, a form that’s longer than it needs to be. Microsoft also uses this data to power a set of automated insights, flagging things like rage clicks (repeated frustrated clicking) and dead clicks (clicks on elements that don’t actually do anything) without you having to watch every recording yourself.

None of this replaces GA4 — the two tools answer different questions. GA4 is better at telling you which pages get traffic and which channels bring it; Clarity is better at telling you what happens once someone actually lands on one. Running both gives you the full picture: where visitors come from, and what they do once they arrive.

Setting It Up

1. Create a Clarity Project

Go to clarity.microsoft.com and sign in with a Microsoft, Google, or Facebook account — no separate password to manage. Select Add new project, give it a name, and enter your site’s URL. Clarity generates a unique tracking code for that project immediately; you don’t need to configure anything else before moving on to installation.

2. Copy the Tracking Code and Add It to WordPress

On the project’s Setup page, choose Install manually and copy the full script snippet shown — a short block of JavaScript that needs to load on every page you want tracked, which in practice means your site’s <head> section. Microsoft’s own Clarity setup documentation covers the Google Tag Manager route too, if manual installation doesn’t suit your setup.

The cleanest way to add third-party tracking code without editing theme files directly is a small header-and-footer plugin — paste the Clarity script into the header field and it loads sitewide. If your theme has a built-in custom code or “Insert Headers and Footers” option, that works just as well and skips the extra plugin. Avoid pasting the code directly into header.php unless you’re using a child theme, since a theme update will otherwise wipe it out.

3. Verify the Installation

Back on the Clarity dashboard, the project should show a “Setup complete” status within a few minutes of a real visit hitting the site — including your own, so load the homepage once after installing. If it still shows as waiting after 30 minutes or so, double-check the code landed inside <head> and not somewhere it got stripped out by a caching plugin’s HTML minification.

Reading the Data Without Wasting a Week

Heatmaps need a meaningful number of sessions on a page before the pattern is reliable — a handful of visits will show gaps and noise rather than a real picture. Give it at least a few days, more on lower-traffic sites, before treating any single heatmap as a firm conclusion about how a page performs.

Rather than watching every session, use Clarity’s filters to jump to the useful ones — recordings with rage clicks, dead clicks, or excessive scrolling are flagged automatically and worth reviewing first. Segment recordings by device before drawing conclusions, too — a layout issue that looks minor on desktop often turns out to be the reason mobile visitors are leaving, and the two session sets can tell very different stories. For a fuller picture of how this fits alongside your other post-launch metrics, see How to Track Website Performance After Launch.

Clarity vs Hotjar in 2026 — the Comparison Actually Changed

Hotjar was acquired by and merged into Contentsquare in mid-2025, and its pricing structure has since moved onto Contentsquare’s unified plans. That’s a real change worth flagging, because the old framing of “Hotjar caps free sessions daily, so Clarity’s uncapped free tier wins” is now out of date — the current Hotjar/Contentsquare free tier covers a substantially larger 200,000 sessions per month, not a small daily cap.

Clarity still has the simpler pitch: genuinely free forever, with no session or traffic limit at all, versus a free tier that’s generous but does have a ceiling. For a small or mid-size WordPress site unlikely to approach 200,000 monthly sessions any time soon, the practical difference between the two free tiers is smaller than it used to be — the real deciding factor now is feature set rather than session caps. Hotjar/Contentsquare’s paid tiers add on-site surveys and more advanced segmentation that Clarity doesn’t offer; Clarity’s advantage is that everything it does offer, including AI-generated rage-click and dead-click insights, stays free at any traffic level. Running both simultaneously is still unnecessary for most sites — the overlap in what they record rarely justifies the extra script weight of loading two behavioural-analytics tools on the same page.

Practical Tips

Clarity masks sensitive input fields (passwords, payment details) by default, but it’s worth checking the masking settings if your site collects anything unusual, like ID numbers or health information, before you go live with recordings switched on.

Because Clarity sets tracking cookies and records real visitor behaviour, treat it the same way you would any other analytics or advertising script for cookie-consent purposes — mention it explicitly in your cookie banner and privacy policy rather than assuming an existing Google Analytics mention already covers it.

Common Mistakes

  • Installing the tracking code inside a page template instead of the sitewide header, which means only that one page gets recorded.
  • Drawing conclusions from a heatmap built on a handful of sessions rather than waiting for a representative sample.
  • Forgetting to check that a caching or minification plugin isn’t stripping the script out of the cached HTML.
  • Never updating a cookie consent banner to mention Clarity, which can create a compliance gap if your site targets visitors covered by GDPR or similar rules.

When to Use This vs Alternatives

Clarity is the right starting point for most WordPress sites because it’s free with genuinely no session limits at any scale. Hotjar/Contentsquare’s free tier is generous enough now that the choice between the two comes down to feature needs — on-site surveys and deeper segmentation on one side, guaranteed uncapped free use on the other — rather than the older “free vs capped” framing. If your main goal is aggregate numbers rather than watching individual behaviour, GA4 alone is enough — Clarity is a layer on top, not a replacement for standard analytics.

Conclusion

Microsoft Clarity is a five-minute install that shows you what your analytics numbers can’t — where real visitors actually get stuck. Add it early, give it a week of real traffic, then start with the flagged rage-click recordings before anything else.