Microsoft Clarity is a heatmaps and session recording tool. It helps you better understand how users are interacting with your website through session replays and heatmaps.
Getting started
RudderStack supports sending event data to Microsoft Clarity via the following connection modes:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | Supported | - | - |
Cloud mode | - | - | - |
Once you have confirmed that the source platform supports sending events to Microsoft Clarity, follow these steps:
- From your RudderStack dashboard, add a source. Then, from the list of destinations, select Microsoft Clarity.
- Assign a name to the destination and click Continue.
Connection settings
To successfully configure Microsoft Clarity as a destination, you will need to configure the following settings:
- Project ID: Enter your Microsoft Clarity project ID. For more information on obtaining your Clarity project ID, refer to the FAQ section below.
- Microsoft Clarity Cookie Consent: Enable this setting to allow RudderStack to call the Microsoft Clarity API to track the users using a cookie.
- Client-side Events Filtering: This setting lets you specify which events should be blocked or allowed to flow through to Microsoft Clarity. For more information on this setting, refer to the Client-side Events Filtering guide.
- Use device mode to send events: As this is a web device mode-only destination, this setting is enabled by default and cannot be disabled.
- OneTrust Cookie Categories: This setting lets you associate OneTrust cookie consent groups to Microsoft Clarity.
Identify
You can use the identify
events to create a new user in Microsoft Clarity.
A sample identify
call is shown below:
rudderanalytics.identify("1hKOmRA4GRlm", { name: "Alex Keener", email: "alex@example.com"});
By default, Clarity uses cookies to track your users and gather the session data. You can configure your Clarity project to require cookie consent, that is, Clarity will not place a cookie until a user provides consent.
In this case, to track the user sessions via the cookie, make sure you enable the Microsoft Clarity Cookie Consent setting in the RudderStack dashboard. This setting indicates that RudderStack can call the Clarity API to track the users via a cookie once a user provides consent.
Supported mappings
RudderStack maps the following identify
attributes to the corresponding Microsoft Clarity properties:
RudderStack property | Microsoft Clarity property |
---|---|
userId Required | customuserid |
context.sessionId | customsessionid |
context.traits.customPageId | custompageid |
FAQ
Where can I find the Microsoft Clarity project ID?
To get your Microsoft Clarity project ID, follow these steps:
- Log into your Microsoft Clarity dashboard.
- Select your Microsoft Clarity project and go to Settings > Overview to get your project ID, as shown:
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.