Skip to content

Microsoft Clarity

Description

Microsoft Clarity is a free user behaviour analytics tool that helps you understand how users are interacting with your website through session replays and heatmaps. It records the information about the visitors of your website, tracks how users behave, and provides you with analytical data.

Aitoc Microsoft Clarity module allows you to integrate the Microsoft Clarity script into your website on every single page so the activity of your site's visitors on all the pages will be tracked.

Compatibility

Microsoft Clarity module is compatible with the following Magento platforms:

Community Edition (Open Source) Enterprise Edition (Commerce) Cloud Edition
2.3.0 - 2.4.* 2.3.0 - 2.4.* 2.3.0 - 2.4.*

Installation

Installing module using zip file

  • Unzip and paste the extension file into your root Magento folder.
  • Connect to your server by SSH.
  • Go to your Magento root folder.
  • To install the extension, perform this command:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Composer installation

If you haven't installed any Aitoc module before, in that case first you will need to add your Aitoc composer repository. Please go through the document to see how you can add a composer repository.

To install the module, you will need to run the following commands:

composer require aitoc/module-microsoft-clarity
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
  • To switch the extension on/off, perform these commands:
php bin/magento module:enable Aitoc_MicrosoftClarity
php bin/magento module:disable Aitoc_MicrosoftClarity
  • To update the module, use below command:
composer update aitoc/module-microsoft-clarity

Module Demo

Microsoft Clarity Account

To have the module enabled and working on your website, first you will need to visit Microsoft Clarity and Signup to create your account.

Once the account is created and you are logged into your account, it will ask you to add a new project.

Name: Name of your Project

Website: Your website URL where you want to integrate and enable Microsoft Clarity.

Site Category: Select the category of your site from the drop-down. For ex: If you are having an eCommerce Store, then select E-Commerce from Dropdown.

Once you have entered all the details, click on Create button.

Microsoft Clarity Tracking Code

Once you have created a new project, from your Project Dashboard, select the Setup tab. In the Setup tab, you will find the Clarity tracking code, and below that the script will be available which we need.

From the script, we only need the tracking code to configure and enable Microsoft Clarity on your Magento website. Below is an example of how you can find your tracking code:

Script

<script type="text/javascript">
   (function(c,l,a,r,i,t,y){
       c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
       t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
       y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
   })(window, document, "clarity", "script", "8h5i95d0n4mgkd");
</script>
Your tracking code = 8h5i95d0n4mgkd

Above is just an example to show you where you can find the Tracking Code from the script available in your Microsoft Clarity Account.

Config settings

Path: Stores → Configuration → AITOC EXTENSION → Microsoft Clarity

Or

Path: Admin → AITOC → Microsoft Clarity → Configuration

Enabled: Yes/No - Sets whether the module is enabled or disabled.

Tracking Code: Text - Please enter your Microsoft Clarity tracking code here.

Enable Customer Group Tag - If this is enabled, then in Microsoft Clarity, custom tags and filters will be created based on the Customer Groups available in Magento. So for each session and page that are tracked in Clarity, they will have a Customer Group tag so it will be easier to filter and find session/recording for each page based on customer group.

How the module works

Once you have added the Tracking Code, the Microsoft Clarity Script will start to appear on the front-end on each page. You can view this in Page Source or your browser's developer tools.

Also, in your Microsoft Clarity Account, under the project you have created, you will start to see analytics details based on visitors' activity on your site. You can see this in:

Log in Your Microsoft Clarity Account → Select your Project → Dashboard & Recording

THANK YOU FOR CHOOSING AITOC EXTENSIONS!

Back to top