Microsoft Clarity for Android

Sreejin Thaivalappil
6 min readAug 24, 2023

--

Clarity is a user behavior analytics tool that helps you understand how users interact with your website or mobile applications

Microsoft Clarity primarily focused on web analytics for desktop websites. However, mobile websites and applications often have distinct user behavior patterns, and analytics tools are crucial for understanding how users interact with them as well. It’s possible that Microsoft has expanded the capabilities of Clarity to include mobile analytics.

It was designed to help website owners and developers understand how users interacted with their websites by providing insights into user behavior, such as how users navigate through pages, where they click, and how far they scroll. Clarity aimed to offer a more in-depth understanding of user interactions beyond traditional metrics like page views and bounce rates.

Some key features of Microsoft Clarity included:

  1. Session Playback: Clarity allowed website/mobile app owners to replay user sessions, showing the exact interactions users had on their website/mobile apps. This could help identify usability issues, areas of confusion, or points where users might drop off.
  2. Heatmaps: The tool generated heatmaps that visually represented where users clicked, moved their cursors, and scrolled on a webpage. Heatmaps could highlight popular areas of interaction and help identify elements that were often overlooked.
  3. Click Tracking: Clarity provided data on individual clicks, such as the number of clicks on specific links or buttons. This information could be used to analyze the effectiveness of call-to-action elements.
  4. Scroll Tracking: It tracked how far users scrolled down a page, which could give insights into the visibility and engagement of content located lower on a website/mobile apps.
  5. Engagement Metrics: Clarity provided data on user engagement metrics, such as time spent on a page and the number of pages viewed during a session.
  6. Error Tracking: The tool could also help identify errors encountered by users which could impact the user experience.
  7. Dashboard and Reports: Clarity offered a user-friendly dashboard to visualize and interpret the collected data. Users could generate reports and view trends over time.

Enjoy all the features of Clarity at absolutely zero cost. You’ll never run into traffic limits or be forced to upgrade to a paid version.

Mission at Clarity is make behaviour analytics available to everyone — from bloggers to Fortune 500 companies.

Clarity is built by Microsoft, one of the largest technology companies in the world. Microsoft processes a massive amount of anonymous data around user behaviour to gain insights and improve machine learning models that power many of our products and services. Clarity is one of the ways Microsoft gathers this important data — and why we’ve made it available for free.

Microsoft will never share your data with third parties.

Clarity will not compromise website/mobile app performance in any mean.

users will not experience a difference in site speed or performance. Clarity tracking code is asynchronous so it does not slow down the page load time.

Clarity for Mobile

Clarity mobile SDKs give you powerful insights to see what’s working and what’s not — all while protecting your users’ privacy. Clarity SDK re-creates user mobile sessions with perfect accuracy.

The unique features of Clarity that help you understand user behavior include:

  • View and analyze the data in near real-time, so you don’t have to wait.
  • There are no limits on the number of apps per account.
  • There’s no traffic limit on data that is collected from the apps.
  • No sampling.
  • Clarity won’t impede the performance of your app.

Designed to minimise impact on page load, main thread usage, and bandwidth. Your users won’t notice any performance issues. You should see around 10KiB (per second of recording) going to Clarity. If your app is graphics-heavy, it may experience higher outgoing traffic at first due to asset loading

Works with Android, React Native, Cordova and ionic frameworks. These are the early stages of Clarity mobile, the team is working on supporting iOS & other popular frameworks.

Android SDK Integration

Android SDK supports API levels 29–33 inclusive. Applications that with API levels 19–28 inclusive will build successfully but data will not be sent to Clarity.

Step one

Sign up for Clarity and create project

  1. Go to https://clarity.microsoft.com/ and select Sign up.

2. Choose a sign-up method and follow the steps on the screen.

3. On successful sign-in, you can view the Projects page.

4. Select New project to start adding a project.

5. Go to the Mobile tab. Enter the Name and App details. Select Add new project once done.

account and project creation completed now its time to do some integration

Step two

Add mavenCentral() to your project repositories. Add the dependency to your module build.gradle script.

repositories {
mavenCentral()
}

dependencies {
implementation 'com.microsoft.clarity:clarity:1.3.2'
}

Add the following code to your startup activity only:

import com.microsoft.clarity.Clarity
import com.microsoft.clarity.ClarityConfig

override fun onCreate(savedInstanceState: Bundle?) {
...
val config = ClarityConfig("<ProjectId>")
Clarity.initialize(applicationContext, config)
...
}

For those who not migrated to Kotlin

import com.microsoft.clarity.Clarity;
import com.microsoft.clarity.ClarityConfig;
import com.microsoft.clarity.models.ApplicationFramework;
import com.microsoft.clarity.models.LogLevel;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
...
ClarityConfig config = new ClarityConfig(
"<ProjectId>",
null, // Default user id
LogLevel.None,
false, // Disallow metered network usage
true, // Enable web view capturing
Collections.singletonList("*"), // Allowed domains
ApplicationFramework.Native);

Clarity.initialize(getApplicationContext(), config);
...
}

Additional info

class ClarityConfig(
val projectId: String,
val userId: String? = null,
val logLevel: LogLevel = LogLevel.None,
val allowMeteredNetworkUsage: Boolean = false,
val enableWebViewCapture: Boolean = true,
val allowedDomains: String? = listOf("*")
)

After integration it might take at least 30min to 2 hours to reflect user interactions on the microsoft clarity dashboard.

Clarity Insights

Clarity Insights are a set of Machine Learning (ML) based filters and recommendations on what content should be most important for you. The dashboard is helpful for designers, product managers, marketers, and web developers. Through the dashboard, you can understand the users without analyzing the ocean of data from user interactions.

overview of clarty dashboard

Heatmap

A Heatmap (or Heat map) is a visualization tool that makes it easy to analyze aggregated information about how users interact with the app.

Clarity tracks all user taps on device and automatically generates a heat map. This data helps you identify the most engaged areas and figure out gaps.

  • Clarity heat maps are created on the fly. There’s no creation delay. Heat maps return within a matter of seconds.
  • Aggregate data helps quantify behaviors and trends. This data helps identify what content is best working for your app.
  • Easy to communicate impact to stakeholders through color scaling.
heatmaps overview

Recordings

Recordings allow you to analyze user behavior throughout a session. You can replay user actions to understand user perspective, traffic source, session timing, and so on.

A session is the recording of the exact user behavior while on your screen. This includes navigation throughout the web pages/screens along with clicks/taps and scrolls.

Session recordings are a visual way to watch real user interaction on your app. They enable you to watch the entire user journey, see what your visitors love and where improvements can be made. Clarity recordings take user events such as scrolls, clicks/taps, page/screen visits, etc., and save them for 90 days. After watching your session recordings, you should be able to make changes to optimize your page/screen and increase conversions.

Filters and Segments

Clarity offers a wide range of powerful filters to help you sort and customize Recordings, Heatmaps, and Dashboard. By choosing the right filter for your needs, you can find interesting patterns in your data and make better-informed decisions.

There are 30+ filters available, so Clarity has organized them into groups based on relevant categories.

Navigate through the filters by using the left bar. You can choose from the following groups on the navigation bar:

To avoid multiple manual typings, you can save groups of filters into segments. Segments can be applied to filters and custom tags.

You can create, apply, delete, clear, and upgrade a segment from any of the following features:

  • Dashboard
  • Recordings
  • Heatmaps

For more info — https://learn.microsoft.com/en-us/clarity/setup-and-installation/about-clarity

Happy reading… Subscribe to see more, and don’t forget to press that clap button.

--

--