How to Set Up Microsoft Clarity on SharePoint Online

In this post, I will explain what Microsoft Clarity is, the benefits and features of Microsoft Clarity, and how to deploy Microsoft Clarity on SharePoint Online, including global and per site collection deployments. 

What Is Microsoft Clarity?

Microsoft Clarity is a user behaviour analytics tool that gives you an overview of how users are interacting with your site. It summarises the information in a form of dashboards and allows you to analyse different user behaviours. 

Clarity is designed to be easy to implement and easy to use. The tool helps site owners better understand their audience, user engagement (e.g. most and least visited pages), user interactions with pages (e.g. do they scroll down the page), and if users are presented with any broken page links. 

This data helps the site owners make informed decisions about the changes required to the site to improve the user experience.

Microsoft Clarity can be easily integrated with third party platforms such as Adobe Dynamic Tag Manager, ClickFunnels, Google Tag Manager, Shopify, Squarespace, Unbounce, Weebly, Wix, WordPress, and WooCommerce. 

In this post, I’m specifically focusing on how to deploy Microsoft Clarity to SharePoint Online. If you want to get a better understanding of your intranet audience and/or overall usage of SharePoint in your organisation this post is for you.

Key Features of Microsoft Clarity 

Microsoft Clarity provides several key capabilities including: 

  • Insights Dashboard
  • Heatmaps
  • Session Recordings

Let’s take a look at each of them.

Insights Dashboard

Insights dashboard is an automatically generated dashboard of aggregate metrics which gives an overview of the traffic on your site. 

At a glance you will be able to see the total number of sessions, average time spent on the site, broken links, how many users scroll up and down on the page looking for the information they can’t find, what are most commonly used devices and browsers, where do users come from and more.  

The data can be further filtered using several filters such as date range, device, browser, country, insights, etc. 

Insights Dashboard
Figure 1. Microsoft Clarity Insights Dashboard

Heatmaps

Heatmaps provide a visual way of how users are interacting with pages on your site. They come in the form of clickmaps and scrollmaps. 

Clickmaps tell you what content on a page is imported to your users whereas scrollmaps show whether your users are seeing what is important. 

Most popular content is highlighted with red and neon whereas less popular content is highlighted with different shades of blue and purple. 

Understanding the user journey through the heatmaps allows you to make design improvements on the site ensuring users can get to the information they are looking for in the most efficient way.

Microsoft Clarity Heatmaps
Figure 2. Microsoft Clarity Heatmaps

Session Recordings

Sessions recordings allow you to analyse user behaviour when browsing through different pages as the mouse movements, scrolling and clicks for every user of the site are recorded. Recordings can be viewed and replayed at any time.

Microsoft Clarity Session Recordings
Figure 3. Microsoft Clarity Session Recordings

Is Clarity a Replacement for Google Analytics?

The simple answer is no. Google Analytics is a usage analytics tracking tool that provides analytics such as session duration, bounce rate, average time spent on a page, page load time, etc. You can also manage your marketing funnels and marketing campaign. 

Google Analytics and Microsoft Clarity integrate together with a few clicks. Clarity passes information back to Google Analytics and you can easily integrate your Clarity project with Google Analytics account.

Google Analytics and Microsoft Clarity integration
Figure 4. Start Google Analytics and Microsoft Clarity integration

How to Add Microsoft Clarity to SharePoint Online

Microsoft Clarity can be deployed to SharePoint Online globally or per site collection level. Global deployment means that the tracking will be enabled on all SharePoint sites regardless if they are communications or teams sites.

Per site collection deployment means that Clarity is deployed on a per site collection basis, you can choose which site you want to add Clarity to. 

Now I will take you through both deployment options.

How to Deploy Microsoft Clarity Globally

  1. Navigate to https://clarity.microsoft.com
  2. Click Sign In button then select Sign in to Microsoft
  3. You will be presented with the below prompt – select checkbox Consent on behalf of your organisation then select Accept button
  4. Accept the prompt to confirm your email address and click Continue
  5. You will be prompted to create a new project as follows:
    Name: enter the name of your intranet or a SharePoint site
    Site: The URL that Microsoft Clarity will monitor
    Category: The category of your site, select Other
  6. You will be redirected to the Setup page
  7. Under Clarity tracking code copy the unique identifier

Deploy Microsoft Clarity Globally to SharePoint Tenant

  1. Download the Clarity deployment package from GitHub
  2. Navigate to your App Catalog site on your Office 365 tenant. If you don’t have one set up already you can follow instructions here to set it up.
  3. On the left hand side select Apps for SharePoint
  4. Select the Upload button then upload the previously downloaded sppkg solution
  5. Select ‘Make this solution available to all sites in the organisation’ checkbox
  6. Click the Deploy button
  7. The app has been successfully installed
  8. Select Site Contents (on the left hand side) then navigate to Tenant Wide Extensions list
  9. Edit the item Components Property field enter the unique ID you copied from Tracking Clarity Code (step X)
  10. Save the changes and monitoring will start on all your SharePoint sites
  11. Once it’s deployed, allow a couple of hours and you will start seeing data on your project dashboard, heatmaps of the pages and recording of user sessions.
    Insights Dashboard

How to Deploy Microsoft Clarity per Site Collection

  1. Download the Clarity deployment package from GitHub
  2. Navigate to your App Catalog site on your Office 365 tenant. If you don’t have one set up already you can follow instructions here to set it up.
  3. On the left hand side select Apps for SharePoint
  4. Select the Upload button then upload the previously downloaded sppkg solution
  5. Do NOT select ‘Make this solution available to all sites in the organisation’ checkbox, just click the Deploy button
  6. On the left hand side select Site Contents and click New then select App from the dropdown list
  7. In the search box search for ‘Clarity’ then click on the app to install it
  8. Once installed, the app will be visible under Site Contents
  9. Deploy the app to a site collection using SharePoint Online Management Shell. If you don’t have it installed, you can get it from here. Open SharePoint Management Shell and type the following cmdlet – replace the URL with the URL of your site collection
    Connect-PnPOnline -UseWebLogin -Url https://yourtenant.sharepoint.com/
  10. Enter your credentials
  11. To enable the solution to execute the following cmdlet, replace “TrackingCodeID” with your own clarity project ID.
    Add-PnPCustomAction -ClientSideComponentId "7f8fd1f2-9d26-4a4a-a607-bf4622d7ec11" -Name "Microsoft Clarity" -Title "Microsoft Clarity" -Location ClientSideExtension.ApplicationCustomizer -ClientSideComponentProperties: '{"clarityID":"TrackingCodeID"}' -Scope site
  12. Once it’s deployed, allow a couple of hours and you will start seeing data on your project dashboard, heatmaps of the pages and recording of user sessions.
    Insights Dashboard

The Bottom Line

In summary, Microsoft Clarity is a great tool to monitor and analyse user behaviour on your SharePoint sites.

I’d highly recommend using Clarity to track usage of your SharePoint intranet site or SharePoint sites in general. 

Microsoft Clarity is super easy to implement, dashboards are automatically created and provided analytics are comprehensive enough to give you a good understanding of users, their behaviours and help you make informed decisions on how to improve user experience and engagement of your site.

Leave a Comment