Microsoft Clarity is a heat-mapping and session recording tool that provides valuable insights into how your users behave while on your website. Where data from Google Analytics tells you what’s happening on your website, Microsoft Clarity will give you insight into why users do what they do on your site.
Using Google Optimize as your A/B testing tool, it’s easy to see what effect variations have on key metrics. But if you’re looking to get insight into why and how user behavior changed, things become more complex. The problem is that, out of the box, there isn’t a way to see a heatmap of just your experiment’s B variant — and if you’re trying to watch session recordings of users on your B variant, there isn’t an easy way to do that either.
This is where we can leverage Microsoft Clarity’s manual custom tags feature. The custom tags feature allows us to run a snippet of JavaScript code to tag the user in Clarity with our Google Optimize experiment name and variation. You will set up and fire this tag from within Google Optimize’s visual editor on all of your experiment’s variants. After the user is tagged, you will be able to easily view heatmaps and recordings from users who saw your experiment, adding value to your Google A/B testing.
To set a custom tag for a user, Clarity uses a small JavaScript snippet:
clarity(“set”, “key”, “value”);
You’ll want to create as many Clarity custom tag snippets as you have variants; most of the time, you’ll only need one. The snippet for your experiment should look something like this:
clarity(“set”, “My A/B Test”, “1”);
With our Clarity snippet created for our variant, we’re ready to add it to our experiment.
First, in Google Optimize, click Edit on your variant.
After the preview of your variant loads, click the code icon in the top right-hand corner, and then select Global JavaScript.
In the Global JavaScript window, first, add:
window.onload = (event) => {
};
This on-load function will only run what’s inside of it after the page has fully loaded. We’re using it because we don’t want our Clarity snippet running too fast before Microsoft Clarity has had a chance to load fully.
Now add the snippet to set the custom tag and save. It should look like this:
After implementing the custom tag, it can take from 30 minutes to two hours to show up in your Clarity filters.
Now that your custom tag is firing, you can set up filters and a segment in Microsoft Clarity for your experiment.
After logging into Clarity, click on filters in the top right-hand corner. Then click on Custom Tags in the left-hand navigation.
The name of your test will be found in the Select Tag dropdown. Select it, then in the right-hand dropdown, select your variant and apply the filter.
With the filter applied, you’re able to view heatmaps and recordings from only the users who interacted with your experiment.
Finally, save your filter as a segment, so it’s easy to return to for analysis when your A/B test completes.
In today’s fast-evolving digital learning landscape, keeping students engaged and ensuring course completion are top…
Predicting conversions is no longer optional Businesses relying only on historical data for marketing decisions…
Unlocking the Full Potential of GA4 with Custom Metrics Google Analytics (GA4) is packed with…
This website uses cookies.