From Data to Insights: Capture Microsoft Clarity Playback URL (MCPU) in GA with GTM
Raneem Deeb | 27 May 2025
Track and Analyse User Interactions Like Never Before

Introduction
Understanding how users interact with your website/ app is crucial for optimising user experience and improving conversions. Microsoft Clarity provides powerful session playback and heatmaps, while Google Analytics (GA) offers advanced event-based tracking. However, GA lacks session recording, making it challenging to pinpoint exactly how users behave on your site.
That is where Google Tag Manager (GTM) integration comes in. By linking Microsoft Clarity Playback URLs to GA, you can watch real user sessions directly from GA reports, giving you a comprehensive idea of user behaviour.
This blog talks about:
- What is Microsoft Clarity and why is it useful?
- Why integrate Microsoft Clarity with GA & GTM.
- Setting Up Microsoft Clarity Playback URL Tracking in GA via GTM.
What Is Microsoft Clarity and Why Is It Useful?
Microsoft Clarity
Microsoft Clarity https://clarity.microsoft.com/ is a free and advanced behavioral analytics tool that provides a clear understanding of user interactions with your website or app. This insight can help improve business outcomes and enhance the user experience.
With Microsoft Clarity, you can:
- Understand how users navigate your website or app.
- Identify issues that lead to user frustration.
- Efficiently analyse user behavior.
- Segment data for customised insights based on your needs.
Key features include:
- Session recordings: Watch real user interactions.
- Heatmaps: Visualise where users click and scroll on your site.
- User insights: Identify friction points and behavior trends.
- Event and funnel tracking.
- Chat and summarise with Copilot.
Microsoft Clarity Benefits
It is simple and easy to customise based on your business needs. It also does not slow your website performance because Clarity JavaScript is asynchronous, so your website visitors will notice no change in site performance or speed.
Moreover, you do not have to wait for your data because it is analysed and visualised in near real time. It helps you to analyse your user behaviour efficiently by using deep AI and Machine Learning algorithm-powered insights.
Important GDPR Compliance Note
When using Microsoft Clarity or any session replay tool, it’s essential to ensure compliance with data protection laws such as the General Data Protection Regulation (GDPR). You must inform users that session recording technology is in use, typically within your privacy policy or cookie banner. Be transparent about the nature of data collected (e.g., keystrokes, mouse movements), avoid capturing sensitive personal data, and consider enabling IP anonymisation features provided by Clarity. Always consult your Data Protection Officer or legal team before implementing behavioural tracking at scale.
One of the most valuable features is the Playback URL, which generates a unique link for each recorded session, allowing you to replay user interactions. By integrating this with GA, you can track user sessions, events, conversions, and traffic sources.
Why Integrate Microsoft Clarity (MC) with Google Analytics & GTM?
Benefits of Integrating Microsoft Clarity with Google Analytics
Microsoft Clarity can pull data from your GA https://analytics.google.com/ and display it in its experience when you integrate them so you will be able to utilise GA Dashboard in MC to debug and understand user pain points.
Although GA is powerful, it doesn’t offer session replays, by integrating MC with GA you get:
- Deeper Insights: Watch session playbacks for users who triggered key GA events (e.g., form submissions, purchases).
- Better Debugging: Identify UX issues by linking GA errors to actual user behaviour.
- Improved Conversions: Understand why users drop off or abandon your site.
- Effortless Automation: GTM automates the session URL tracking, ensuring all user sessions are linked to GA events.
At this point you can add only one web property to integrate to each Clarity project.
To install GA into your Clarity project, follow the following steps:
- Go to
Setup and select
Get Started under
Google Analytics integration.

2. You will be directed to sign into Google. Choose the account you want to use.
3. In the dialog box, choose the web property from which Clarity should retrieve data. Then, select the site from the menu and click Save. You will be redirected to the Clarity Setup page.

By capturing the Clarity session playback URL in GA event reports, you can quickly review recordings related to specific user actions.
Setting Up Microsoft Clarity Playback URL Tracking in GA via GTM
Microsoft Clarity can be deployed via GTM https://tagmanager.google.com/ with some helpful templates, once published you shouldn't need to worry about making updates unless new features are released by Microsoft.
Let’s go through the set up process:
Step 1: Install Microsoft Clarity on Your Website
In this step, you are going to sign up at Clarity’s website https://clarity.microsoft.com/ and create a new project. Then, you copy the tracking code provided by Clarity and add it to your website’s <head> section OR install it via GTM.
There are several methods to install Clarity to GTM, this blog will mention one of them, which is importing the “ Microsoft Clarity - Official” tag template to your GTM workspace.
On the Chosen tag type panel, select the Discover more tags in the Community Template Library option and choose “ Microsoft Clarity - Official”, as shown in image 3 and enter your Clarity project ID in the field shown in image 4. After then, set the trigger to fire on all pages.


By publishing your GTM container, Clarity will collect session data!
Step 2: Capture the Clarity Playback URL in GTM
For this step there are also different methods; you can create a Custom JavaScript Variable in GTM to capture the Clarity session playback URL, or you can use the GTM variable template “Microsoft Clarity Playback URL” by Jude Nwachukwu, as shown in image 5.

This variable dynamically fetches the session playback URL when a user visits your site.
Step 3: Create a GTM Tag to Send Clarity Playback URLs to GA
Create a GA Event Tag to send the Clarity Playback URL to GA by following these steps:
- Go to GTM → Tags → New.
- Choose Tag Type: Google Analytics: GA4 Event.
- Select your GA configuration tag and set your event name.
- Add the event parameter {{Microsoft Clarity Playback URL}}.
- Select trigger based on what you want to capture session URLs (e.g., page view, form submission, or clicks).
- Save and publish your GTM container.
Now, every time an event occurs, GA will store the Clarity session link, allowing you to watch the corresponding user recordings.
Eventually, once Clarity session URLs are in GA, you can:
- Track UX issues: Replay sessions where users encountered errors.
- Improve Conversions: Watch how users interact with key pages and optimise CTAs.
- Analyse drop-offs: See what happened before users abandoned a page or form.
- Refine marketing strategies: Identify how traffic from different sources behaves.
For instance, if a user adds items to their basket but then abandons the checkout process. By reviewing these sessions, you might discover issues like:
- Slow Page Load or Technical Glitches: The checkout page may be loading too slowly or experiencing errors.
- Unclear Navigation: Users might be confused by the layout or find it hard to locate key elements (e.g., payment options).
- Unexpected Costs: Hidden fees or unexpected shipping charges could discourage users.
- Distraction or Interruption: External factors or a cluttered interface might be causing users to leave.
Highlighting these friction points in the user journey can generate hypotheses for your website testing plan; allowing you to optimise the checkout process, improve user experience, with the ultimate aim of boosting conversions.
Conclusion
Integrating MCPU with GA via GTM unlocks a new level of behaviour analytics, where you can:
- Track session playbacks directly in GA reports.
- Understand why users drop off and optimise pages accordingly.
- Improve debugging and conversion tracking with real-time insights.
This setup ensures that every key user event is linked to real session playback, giving you a 360° views of user behaviour. With GA, GTM, and Microsoft Clarity combined, you will have everything you need to analyse and optimise your website performance.
Set up the integration and start tracking real user sessions!
Want to have a chat?
Chat through our services with our team today and find out how we can help.