Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Install Microsoft Clarity Analytics in WordPress

Have you ever looked at your website analytics and wondered not just what your visitors did, but why they did it? For a long time, we relied on Google Analytics, but we always felt we were missing the story behind the numbers.

That’s where Microsoft Clarity changes the game. It provides visual tools like heatmaps and session recordings, showing you exactly how users interact with your site. This helps you move beyond guesswork to make real improvements.

In this guide, we’ll show you the simple method we use to install Microsoft Clarity on our WordPress sites. It’s a powerful and free way to better understand your audience.

How to Install Microsoft Clarity Analytics in WordPress

Ready to dive in? Here is a quick overview of what we will cover in this tutorial:


What Is Microsoft Clarity and Why Use It?

Microsoft Clarity is a free analytics tool for websites. It helps you see the most popular pages on your website and how users click, scroll, and interact with those pages.

The most important feature of Microsoft Clarity is its data visualization of user behavior. This includes click tracking, heatmap reports, session recordings, and more.

We’ve found it useful for getting beyond the traditional metrics. While Google Analytics tells you what happened on your site, Clarity shows you exactly how it happened.

Heatmaps show a visual report of how users move their mouse, as well as where they click, select, and scroll. We’ve used these insights to optimize button placements and improve content layout for better engagement.

Heatmap showing user interactions on a website

Similarly, session recordings help you see how users view your content, where they spend more time, and what takes them away from your WordPress website.

This information helps you create a better user experience for your users, improve performance, and boost sales conversions.

Viewing the Microsoft Clarity analytics dashboard

Note: Microsoft warns that Clarity should not be used on sites that contain sensitive data, including user health care, financial services, or government-related information.


Microsoft Clarity vs. Google Analytics: What’s the Difference?

As WordPress analytics experts, we often get asked whether to choose between Microsoft Clarity and Google Analytics. The truth is, they serve different purposes and work best when used together.

Google Analytics is the best analytics solution on the market because it offers a lot of in-depth tracking features. Microsoft Clarity, on the other hand, focuses on the visualization of user interactions with heatmaps and session recordings.

Google Analytics helps you track almost anything on your website. It also has enhanced eCommerce tracking, conversion tracking, and detailed reports.

A good way to think about it is that Google Analytics tells you what happened (for example, 100 people left your checkout page), while Clarity shows you why it might have happened (such as a broken button was causing them to get stuck).

Microsoft Clarity is a dedicated behavior analytics platform that perfectly complements Google Analytics by unlocking visual features like heatmaps and visitor session recordings.

Before Microsoft’s analytics feature, many website owners would use paid heatmap solutions like Hotjar or CrazyEgg alongside Google Analytics, but now you have a free alternative to those tools.

We recommend installing Google Analytics on all your websites. The data it provides is essential for understanding your audience and making data-driven decisions to improve your SEO and grow your traffic.

They both work along quite well without affecting your website’s functionality.

It’s easy to add Microsoft Clarity to any website. You need to sign up for Microsoft Clarity and then add a tracking code to your website. We will take you through the process step by step.


Adding Microsoft Clarity to WordPress

There are a few ways to add Microsoft Clarity to your website. You can choose the method that works best for you.

Method 1: Add Microsoft Clarity Using the Official Plugin (Easiest)

The easiest way to add Microsoft Clarity to WordPress is with the official Microsoft Clarity plugin. We highly recommend this method for beginners because you usually don’t have to leave your website or touch any code.

First, install and activate the Microsoft Clarity plugin. For more details, see our guide on how to install a WordPress plugin.

Upon activation, you will automatically be taken to the Clarity setup screen. In most cases, you will be asked to sign in. You can log in using an existing Google, Microsoft, or Facebook account.

Microsoft Clarity Login Options

Note for Safari & Ad-Blocker Users: If your browser blocks tracking scripts, the plugin might skip the login screen and ask you for a Clarity project id instead. If you see this, simply jump down to our section below on Getting Your Clarity Tracking Code to learn how to create your account and find your Project ID. You can then paste that ID right into this box.

If you were able to log in normally, the wizard might show a screen asking to ‘Enable cookies for Clarity’.

The plugin needs these to display your dashboard inside WordPress securely. Go ahead and click the button to enable them.

Microsoft Clarity Third-Party Cookies Setup

If your browser prevents the cookies from enabling, just click the ‘I don’t want to enable third-party cookies’ link. Clarity will still track your website perfectly. You will just log into the main Microsoft Clarity website to view your data.

Next, the wizard will ask you a few quick questions about your project. Simply follow the on-screen prompts.

Once you finish those questions, Clarity will automatically create your project and connect your website. You do not need to copy or paste any tracking codes.

That’s it. Your site is now sending data to Clarity. You can view your heatmaps and recordings directly inside your WordPress dashboard by clicking the new ‘Clarity’ menu item in your left-hand sidebar.

Getting Your Clarity Tracking Code (For Methods 2 & 3)

First, head to the Microsoft Clarity website and click on the ‘Get Started’ button. You need a Microsoft, Facebook, or Google account to sign up.

After signing up, you will see the Clarity dashboard with a popup to add a new project.

Go ahead and enter a name for your project. You can use the name of your website to make it easily recognizable. Next, enter your website URL.

Setting up a new project in Microsoft Clarity

Once you have created your new project, you will be asked how you want to install Clarity.

You should click the ‘Get tracking code’ option.

Install Clarity Using a Tracking Code

You will now see the tracking code that you need to add to your WordPress website.

Simply click the ‘Copy to clipboard’ button.

Copying the Clarity tracking code

Depending on the method you use to add this code to your WordPress site, you may need the complete tracking code or just your project ID. You will find the project ID at the end of the tracking code just before </script>.

In the screenshot above, it is ‘ejbjp9k5ge’. Remember, your own project ID will be a different, unique code.

We recommend leaving this tab open or copying the code to a safe place. You will need it in the next step of this tutorial.

Method 2: Adding Microsoft Clarity Code Using WPCode

The safest and easiest way to add code to your website is WPCode, the best WordPress code snippets plugin. This plugin lets you add any script in your website’s header or footer right from your WordPress dashboard (no FTP or cPanel needed).

Once you have installed and activated the WPCode Free Plugin, you need to visit the Code Snippets » Header & Footer page.

Once there, you should paste the entire Microsoft Clarity tracking code into the ‘Header’ field.

Paste the Microsoft Clarity Tracking Code Into WPCode's Header Field

Don’t forget to click the ‘Save Changes’ button to store your settings.

The plugin will now automatically add the Microsoft Clarity analytics code to all pages of your WordPress site so you can track website visitor activity on your website.

Method 3: Adding Microsoft Clarity Code Using All in One SEO

All in One SEO is the best WordPress SEO plugin that allows you to easily optimize your WordPress website for search engines and social media platforms. We show you how to get the most out of it in our guide on how to set up All in One SEO for WordPress correctly.

If you have All in One SEO installed on your website, then you can use it to add the Microsoft Clarity tracking code.

Simply head over to All in One SEO » General Settings » Webmaster Tools and click on the ‘Microsoft Clarity’ icon.

A field will appear where you can paste your Clarity project ID. That’s the last item in your Clarity tracking code and will look something like ‘ejbjp9k5ge’.

Pasting the Microsoft Clarity Project ID into AIOSEO

Make sure you click the ‘Save Changes’ button afterward, and your WordPress site will be connected to Microsoft Clarity.

Pro Tip: If you are using a WordPress caching plugin, then you need to clear your WordPress cache after adding the project ID or tracking code. This is important because, otherwise, Microsoft will not be able to verify your site for a few hours.

Bonus: Connect Microsoft Clarity to Google Analytics

If you’re already using Google Analytics, you can link it to your Clarity account for deeper insights. This lets you filter Clarity’s session recordings and heatmaps by Google Analytics segments.

For example, you can view recordings only from organic search visitors or users who completed a purchase.

To connect the two, open your Clarity project and go to Settings » Integrations. Click on the Google Analytics option and enter your GA4 Measurement ID.

If you aren’t sure where to find this, you can follow our guide on how to install Google Analytics 4 in WordPress. Simply go to your Google Analytics dashboard, click on ‘Admin’, and look under your ‘Data Streams’ to find the ID.

View stream ID and measurement ID

Once saved, Clarity will begin enriching recordings with your GA data within a few hours.

This integration is completely optional, but it’s especially useful if you want to understand why certain traffic segments behave differently on your site.


Using Microsoft Clarity

Once you have installed the tracking code and cleared your WordPress cache, Microsoft will then start recording visitor session data.

However, it will likely take up to 2 hours before you can see any results in your Clarity account.

Using the Microsoft Clarity Dashboard

Simply log in to your Clarity account after a few hours, and you should be able to see the activity summary in your dashboard.

Viewing the Microsoft Clarity analytics dashboard

You can see useful insights like the percentage of sessions that have ‘dead clicks’. These are clicks that don’t go anywhere. For instance, users might be clicking on an image, thinking that it’s a button or a link.

Another useful statistic is ‘rage clicks’, when users rapidly click or tap in the same area. Paying close attention to these metrics can help you make your site more user-friendly.

The dashboard also shows you the number of ‘quick backs’. These occur when a user moves off a page and then very quickly comes back to it.

It also tracks excessive scrolling when users scroll through a page more than expected. And like Google Analytics, Microsoft makes it easy to see the most popular pages on your site.

Using Microsoft Clarity Recordings

The ‘Recordings’ tab shows you recordings of different user sessions. You get the details of the user’s device, operating system, and country.

Clarity also tells you the number of pages they visited, the duration and time of their session, and the number of clicks they made.

Clarity showing the recordings of user sessions

The recordings let you watch an animation of mouse movements and clicks. In the screenshot above, you can see a user moved their mouse to the November archives link and clicked it.

Using Microsoft Clarity Heatmaps

The ‘Heatmaps’ tab shows you a heatmap of your website. These help you see which sections are popular on your site based on the number of people clicking.

Clarity's heatmap showing mouse clicks

The heatmap will also show you how far users scrolled down the page and which areas on the page received the most clicks.

Viewing Clarity Data Inside WordPress

One of the most useful features of the official Microsoft Clarity plugin is the embedded dashboard. If you installed Clarity using Method 1, you can view your analytics directly from your WordPress admin area.

To access this, simply look at your left-hand WordPress admin menu and click on the new Clarity menu item.

Visit the Clarity Menu in WordPress

This will load your Clarity dashboard right inside WordPress. This means you don’t need to open a new tab or log into a separate website to check how visitors are interacting with your site.

The embedded view gives you full access to the exact same data as the external Clarity dashboard. You can watch session recordings, view heatmaps, and analyze engagement metrics and device breakdowns without ever leaving your site.

On our test website, it started displaying useful information almost right away.

Microsoft Clarity Dashboard in WordPress
Clarity Copilot and Clarity Chat

Microsoft Clarity also includes built-in AI features that make it incredibly easy to extract insights without having to manually review hours of recordings.

First is Clarity Copilot, which automatically summarizes your session recordings and gives you key takeaways about user behavior patterns in plain language. You can actually use this feature in two different ways.

To get a broad overview of your traffic, navigate to the ‘Recordings’ tab in your dashboard and click the ‘Summarize Recordings’ button near the top right of your screen. The AI will analyze your current list of recordings and generate a quick recap of overall trends.

Summarizing Microsoft Clarity Recordings in WordPress

Note: If you have a brand new website or just installed Clarity, you might see a “Not enough recordings to generate a summary” message. The AI needs a certain amount of real visitor data to spot patterns. Just give it a few days to collect traffic, and the summaries will start working!

If you want to understand a specific user’s journey, you can also summarize individual recordings. Just look under the specific recording for the ‘Generate Session Insights’ button. It looks like a cartoon speech bubble with two sparkles.

Viewing Microsot Clarity Session Insights in WordPress

Next is the interactive chat feature. This lets you ask questions about your analytics data in plain English. For example, you can ask, “Which pages have the most rage clicks?” or “Where are users dropping off in my checkout flow?” and get a direct answer.

Opening Copilot in Microsoft Clarity

You can find this feature by clicking the Copilot icon located at the top right of your Clarity dashboard.

A chat panel will open where you can type your questions directly.

Chatting With Microsoft Clarity's Copilot in WordPress

The best part is that all of these AI features are available right inside your Clarity dashboard and are included in the free plan with absolutely no extra setup required.


Final Thoughts on Microsoft Clarity Analytics Tool

Microsoft Clarity is a powerful analytics tool with some incredible features for beginners. While it’s no alternative to the powerful Google Analytics platform, it definitely offers some interesting features like free heatmap and session recording.

Often, new website owners want to see heatmaps and session recordings, but they don’t have the budget to purchase premium solutions like HotJar or CrazyEgg. Well, now you can use Microsoft Clarity.

Using the heatmaps and session recordings, you should be able to optimize your website or online store experience to improve user experience and boost sales.


Frequently Asked Questions About Microsoft Clarity

We receive a lot of questions about analytics tools. To help you out, we’ve compiled answers to the most common questions about using Microsoft Clarity on your WordPress website.

1. Is Microsoft Clarity really free to use?

Yes, Microsoft Clarity is completely free. There are no traffic limits or paid tiers, giving you full access to features like heatmaps and session recordings without any cost.

2. Will Microsoft Clarity slow down my website?

Microsoft designed the Clarity tracking script to be asynchronous. This means it loads independently and won’t block your website’s content from loading for your visitors. We have not observed any negative impact on site speed.

3. Can I use Microsoft Clarity and Google Analytics at the same time?

Absolutely. In fact, they work best together. Google Analytics is great for tracking numbers and trends (like how many people visited a page and where they came from). Clarity provides the visual story behind those numbers (like showing you exactly where people clicked and scrolled on that page).

4. How long does it take for data to appear in my Clarity dashboard?

After you install the tracking code, it can take up to 2 hours for the first batch of visitor data to appear in your dashboard. After that initial processing, new session data will show up very quickly, often in near real-time.

5. Is Microsoft Clarity better than Hotjar?

Both tools offer heatmaps and session recordings, but they differ in pricing and depth. Hotjar’s free plan is limited to 35 daily session recordings, while Microsoft Clarity is completely free with no session or traffic limits.

Clarity also includes AI-powered features (Clarity Copilot and Clarity Chat) that Hotjar doesn’t offer. Hotjar has stronger survey and user feedback tools, so if you need on-page polls or feedback widgets, it’s worth considering alongside Clarity.

6. How do I use Microsoft Clarity to improve SEO?

Clarity helps with SEO indirectly by highlighting pages where users are frustrated or disengaged. High rage-click rates on a page can signal a broken element or misleading link, both of which affect user experience signals.

Session recordings can show you where visitors get confused and leave, helping you identify thin or confusing content that may be causing high bounce rates.

7. What are Clarity Copilot and Clarity Chat?

Clarity Copilot and Clarity Chat are AI features built into Microsoft Clarity’s dashboard. Copilot generates automatic summaries of your heatmaps and session recordings so you can quickly understand behavioral trends without watching individual recordings.

Clarity Chat is a conversational interface where you can ask questions about your data in plain English and get direct answers. Both features are free and available to all Clarity users.


Additional Resources on WordPress Analytics

We hope this article helped you learn how to install Microsoft Clarity Analytics in WordPress. You may also want to see some other guides related to WordPress analytics:

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

8 CommentsLeave a Reply

  1. Microsoft Clarity works amazing alongside Google Analytics. The heatmaps are game-changers for landing page optimization!
    Good thing it works both for desktop and mobile. Users behave totally differently on each device, so this helps me nail the responsive design tweaks.
    The “rage clicks” feature has been a lifesaver too. It’s helped me spot and fix UI issues across my clients’ sites really quickly.

  2. I usually use WP Code and insert the Clarity code directly into the header or another part of the site that always displays (like the footer). It’s pretty safe and simple. Now I see that AIO SEO can do this too, and in an even easier way. I assume the lite version can do this as well? I’ll have to try it out, as adding codes is simple, but this would be a quicker way.

  3. I’ve always relied on Google Analytics for its robust tracking capabilities and detailed reports, especially when it comes to understanding my eCommerce performance. However, I want to thank you for introducing Microsoft Clarity. The idea of visualizing user interactions with heatmaps and session recordings is intriguing and adds a layer of insight that traditional analytics sometimes misses. While it might not replace Google Analytics for me, I can see how using them together could offer a more comprehensive view of user behavior. This combination could be a game-changer for anyone serious about optimizing their website’s user experience.

  4. I’m considering Clarity, especially now that I can integrate it with AIO SEO. I’m just curious whether the overall integration with Microsoft Clarity could potentially affect the website speed negatively?

    I’m only considering Microsoft Clarity temporarily for heatmaps, to determine the best placement, for example, for Google AdSense. In this context, it makes sense to me to identify the least used areas on the website and target advertising there.

    • It should not have a major effect but we have not done a full in-depth analysis of any speed changes at the moment.

      Admin

      • Thank you for the advice. I finally connected the website with clarity thanks to AIO SEO and everything works perfectly. It’s a really cool tool. I’ve had it on the website for a few days, but I’m thrilled with it.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.