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

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you looking to use Microsoft Clarity analytics on your WordPress website?

Microsoft Clarity is a free analytics tool that helps you analyze how users engage with your website with click tracking, scroll tracking, and heatmaps.

In this article, we will show you how to easily install Microsoft Clarity in WordPress, step by step.

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

Now that you know how to install Microsoft Clarity Analytics in WordPress, you may like to see some other guides related to WordPress analytics:

We hope this article helped you learn how to install Microsoft Clarity Analytics in WordPress. You may also want to see our guide on how to increase your blog traffic or our expert picks for the best email marketing services to grow your business.

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

6 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    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 says

      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 says

        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.