Microsoft Clarity

Step-by-step guide on sending your event data from RudderStack to Microsoft Clarity.

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.

Connection compatibility

Destination info
  • Status: Generally Available
  • Supported sources: Web
  • Refer to it as MICROSOFT_CLARITY in the Integrations object.

Connection modes
SourceCloud modeDevice modeHybrid mode
Webnot supportedsupportednot supported
Supported message types
SourceIdentifyPageTrackScreenGroupAlias
Device mode
Websupportednot supportednot supportednot supportednot supportednot supported

Get started

Once you have confirmed that the source platform supports sending events to Microsoft Clarity, follow these steps:

  1. From your RudderStack dashboard, add a source. Then, from the list of destinations, select Microsoft Clarity.
  2. 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.
  • Consent management provider: Configure the consent management settings for the specified source by choosing the consent management provider from the dropdown. If you choose Custom, make sure to pass the custom consent data to SDK.

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.

Microsoft Clarity cookie consent enabled

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.

info
If the Cookies setting is enabled in the Clarity project settings, then you need not enable the Microsoft Clarity Cookie Consent dashboard setting.

Supported mappings

RudderStack maps the following identify attributes to the corresponding Microsoft Clarity properties:

RudderStack propertyMicrosoft Clarity property
userId
Required
customuserid
context.sessionIdcustomsessionid
context.traits.customPageIdcustompageid

FAQ

Where can I find the Microsoft Clarity project ID?

To get your Microsoft Clarity project ID, follow these steps:

  1. Log into your Microsoft Clarity dashboard.
  2. Select your Microsoft Clarity project and go to Settings > Overview to get your project ID:
Microsoft Clarity project ID

Questions? Contact us by email or on Slack