BE Digital Knowledge base

Welcome to the BE Digital knowledge base, a source full of articles on digital topics. Our knowledge base is continually updated with the latest insights. We also regularly publish valuable whitepapers that offer in-depth analysis and advice. For the latest news and trends, visit our blog.

Barry Eichhorn - BE Digital

Written by

Owner & AI Advisor

Updated on 13 June 2024

How do you install Microsoft Clarity?

How do you install Microsoft Clarity is a question we get a lot. Installing Microsoft Clarity on your website can provide valuable insights into your visitors’ behaviour. Before you start, it is advisable to check the speed of your website. A fast website contributes to a better user experience and ensures that adding Clarity has no negative impact. 

1. Preparations and required tools

Google Tag Manager

The easiest way to install Microsoft Clarity is via Google Tag Manager (GTM). It is important that GTM is already installed on your website. If you haven’t done this yet, don’t worry: you can find a guide to installing GTM here.

Cookiefirst

You also need Cookiefirst to make sure Clarity’s tracking complies with cookie regulations. For the installation of Cookiefirst and creating a trigger for ‘Cookie Consent Marketing’, read here more about the EU cookie policy. 

2. Installing Microsoft Clarity

Now that you have made the preparations, you can start installing Microsoft Clarity via Google Tag Manager.

Create an account

First create an account with Microsoft Clarity. Visit the Clarity website and register. Follow the instructions to set up your account.

Create a new project

Once you have managed to create an account, you can log in to your newly created account. You can then create a new project at the top left. Create a new project. 

Enter the name and URL of the website

Enter the name of your project and the URL of your website. Then click “Add new project” to continue to the next step.

Copy the tracking code

Once you have added the project, Clarity generates a unique tracking code. It is important that you copy this code, as you will need it for the next steps in the process.

3. Configuring Google Tag Manager

Open Google Tag Manager

Log in to Google Tag Manager and select the domain for which you want to set up Clarity.

Add a new tag

Go to “Tags” and click “New Tag” to add the Microsoft Clarity tracking code.

Give the tag a name of your choice

Give your new tag a recognisable name, such as “Microsoft Clarity”.

Change the tag type to ‘Custom HTML’

Make sure your tag type is set to “Custom HTML”. Paste the tracking code you copied earlier into the HTML box.

Set the trigger to Cookie Consent Marketing

At the bottom of the page, choose the trigger setting ‘Cookie Consent Marketing’. The reason for this is that the Clarity tracking code is then only loaded if the user has accepted the marketing cookies. 

Set the consent to ‘ad_storage’

Go to the consent overview and select Microsoft Clarity. Set the consent to ‘Require additional consent for tag to fire’.

Publishing the changes

After correctly setting up the tag and trigger, you can publish the changes. Click “Submit” to put the new configuration live straight away.

Step 4: Clarity settings

Open Clarity and block your IP address

Log in to Microsoft Clarity and go to your account settings. Click ‘IP blocking’ and add your own IP address to prevent your own visits from being counted in the data. 

Step 5: Check website speed

Checking the speed of your website again is the last step in the process. Using Clarity should not affect your website’s loading time. If it does, consider optimising your website first before you reinstall Clarity.
Can’t work it out, or want to talk it through with a specialist? Get in touch with us. 

Frequently asked questions

How do I install Microsoft Clarity via Google Tag Manager?

Create a Clarity account and project and copy the tracking code. In Google Tag Manager, create a new tag of the type ‘Custom HTML’, paste the code into it, choose the trigger ‘Cookie Consent Marketing’ and publish the changes via ‘Submit’.

What do I need before installing Microsoft Clarity?

You need Google Tag Manager, which must already be installed on your website, and Cookiefirst so that the tracking complies with cookie regulations. Also check your website’s speed first.

Why do I set the trigger to Cookie Consent Marketing?

That way the Clarity tracking code is only loaded if the user has accepted marketing cookies. This keeps the tracking compliant with cookie regulations.

How do I stop my own visits from being counted in Clarity?

Log in to Microsoft Clarity, go to your account settings and click ‘ip-blocking’. Add your own IP address there so that your own visits don’t end up in the data.

Barry Eichhorn - BE Digital

About the author

Owner & AI Advisor

Barry Eichhorn is the owner of BE Digital and advises organisations on digital strategy, AI and online growth. With more than 10 years of experience, he helps business owners and teams put technology to practical use and make digital choices that contribute to sustainable growth.