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

If you are looking to unlock deeper insights into how visitors interact with your WordPress website, then Microsoft Clarity offers a powerful, free solution. This web analytics tool provides valuable data on user behavior through heatmaps, click tracking, and scroll depth analysis.

As we have optimized our own websites over the years, we have found that understanding how users navigate our sites, where they click, and what captures their attention, has been invaluable when optimizing content, improving user experience, and boosting conversions.

This step-by-step guide will show you how to easily integrate Microsoft Clarity into your WordPress website, letting you make data-driven decisions that enhance your online presence.

How to Install Microsoft Clarity Analytics in WordPress

This is 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.

Heatmaps show a visual report of how users move their mouse, as well as where they click, select, and scroll.

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?

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.

Microsoft Clarity is a newer platform, and it’s currently not an alternative to Google Analytics’s far superior features. However, you can use Microsoft Clarity alongside Google Analytics to unlock features like heatmaps and visitor session recordings because Google doesn’t offer those features yet.

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 to improve your search rankings. After that, you can follow our guide below to install Microsoft Clarity in WordPress.

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.

Signing Up for Microsoft Clarity

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’.

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.

Adding Microsoft Clarity Code to WordPress

Now, you need to add the Microsoft Clarity tracking code to your WordPress website in a way that makes it present on all pages. Luckily, there are a number of easy ways to make this happen without manually editing any WordPress files.

You can choose your preferred method from the following three.

Method 1: Adding Microsoft Clarity Code Using the Microsoft Clarity Plugin

The first thing you need to do is install the Microsoft Clarity plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Settings » Clarity page in WordPress admin.

Here, you need to paste the project ID. That’s the last item in your Clarity tracking code and will look something like ‘ejbjp9k5ge’.

Enter Your Microsoft Clarity Project ID

Make sure you click the ‘Save Changes’ button at the bottom to store your settings. Your WordPress site is now connected to Microsoft Clarity.

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.

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.

Final Thoughts on Microsoft Clarity Analytics Tool

Microsoft Clarity is a new analytics tool with some great features. 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.

Expert Guides 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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

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. Dennis Muthomi

    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. Olaf

    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. Mrteesurez

    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. Jiří Vaněk

    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.

    • WPBeginner Support

      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

      • Jiří Vaněk

        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.

  5. Stefan

    It seems that there’s a plugin now too.

    • WPBeginner Support

      Thank you for letting us know about it :)

      Admin

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.