Microsoft Clarity Integrations
Overview
Microsoft Clarity is designed to work alongside your existing analytics and marketing tools, not replace them. While Clarity excels at showing you how users behave, integrating it with platforms like Google Analytics, content management systems, and e-commerce solutions creates a more complete picture of user experience and business performance.
This guide covers the major integrations available, how to set them up, and how to get the most value from combining Clarity with other tools.
Google Analytics Integration
The Google Analytics integration is Clarity's most powerful connection, bridging quantitative metrics with qualitative behavior insights.
What the Integration Provides
In Clarity Dashboard:
- Filter session recordings by GA4 traffic sources (organic, paid, social, direct, referral)
- Segment by GA4 campaigns and campaign parameters (utm_source, utm_medium, utm_campaign)
- View user properties and custom dimensions from GA4
- See conversion events from GA4 alongside session recordings
In Google Analytics Dashboard:
- Direct links to Clarity session recordings from GA4 reports
- Clarity recording URLs in GA4 Explorations
- Ability to watch session recordings for specific user cohorts identified in GA4
Setup Process
Step 1: Connect Accounts
- Log into your Clarity dashboard
- Navigate to Settings > Integrations
- Click Google Analytics
- Sign in with the Google account that has access to your GA4 property
- Select the GA4 property you want to link
- Grant permissions for data sharing
- Confirm the connection
The integration typically activates within a few hours. Historical data is not backfilled, only new sessions will include GA data.
Step 2: Verify Connection
- In Clarity, go to Recordings
- Add a filter and check if GA dimensions appear (Source, Medium, Campaign)
- If they appear, the integration is working
- In GA4, navigate to a user-level report and look for Clarity session URLs (may take 24-48 hours to appear)
Step 3: Configure GA4 Custom Dimension (Optional)
To make Clarity session URLs appear more prominently in GA4:
- In GA4, go to Admin > Custom Definitions > Custom Dimensions
- Create a new dimension:
- Save the dimension
Now you can use Clarity Session URL as a dimension in reports and explorations.
Use Cases
Debug High-Bounce Traffic Sources
Scenario: GA4 shows that traffic from Facebook ads has a 75% bounce rate, but you don't know why.
Workflow:
- In Clarity, filter recordings: Source = facebook, Medium = cpc
- Further filter by Quick Backs or high bounce indicators
- Watch sessions to see what's causing immediate exits
- Common findings: landing page doesn't match ad messaging, slow load times, confusing navigation
Analyze Campaign Performance
Scenario: A specific campaign is driving traffic but not converting.
Workflow:
- In GA4, identify the underperforming campaign
- In Clarity, filter by Campaign = [campaign name]
- Compare behavior of this campaign's users vs. high-converting campaigns
- Look for differences in scroll depth, rage clicks, or page navigation patterns
Understand Device-Specific Issues
Scenario: GA4 shows mobile conversion rate is half of desktop, but doesn't tell you why.
Workflow:
- In Clarity, filter: Device = Mobile, Page = Checkout
- Watch recordings to identify mobile-specific friction (small buttons, text input issues, layout problems)
- Cross-reference with GA4 to quantify the impact of fixes
Limitations
- Data delay: GA data in Clarity may lag by a few hours
- Sampling: If your GA4 property uses sampling, Clarity integration reflects sampled data
- Historical data: Only new sessions post-integration include GA dimensions
- Universal Analytics: Integration works with GA4 only, not the deprecated Universal Analytics
Content Management System Integrations
Clarity provides native integrations and plugins for major CMS platforms, making installation quick and code-free.
WordPress
Via Official Plugin
- In WordPress admin, go to Plugins > Add New
- Search for "Microsoft Clarity"
- Install and activate the Microsoft Clarity plugin by Microsoft
- Go to Settings > Clarity
- Paste your Clarity Project ID (found in Clarity dashboard under Settings > Setup)
- Save settings
The plugin automatically adds the Clarity tracking code to all pages.
Manual Installation
If you prefer manual control or the plugin isn't compatible with your theme:
- Get your Clarity tracking code from the Clarity dashboard
- In WordPress, go to Appearance > Theme File Editor
- Edit
header.phpor use a plugin like Insert Headers and Footers - Paste the Clarity script in the
<head>section - Save changes
Shopify
Via Shopify App Store
- Visit the Shopify App Store
- Search for "Microsoft Clarity"
- Install the Clarity app
- During setup, sign into your Clarity account
- Select the Clarity project to connect
- Authorize the connection
The app automatically adds tracking to your store and provides e-commerce-specific insights.
Manual Installation
- In Shopify admin, go to Online Store > Themes
- Click Actions > Edit Code for your active theme
- Open
theme.liquid - Paste the Clarity tracking code just before the closing
</head>tag - Save
Wix
- In Wix Editor, go to Settings > Custom Code
- Click + Add Custom Code
- Paste your Clarity tracking code
- Set it to load on All Pages in the Head section
- Save and publish
Squarespace
- In Squarespace dashboard, go to Settings > Advanced > Code Injection
- Paste your Clarity tracking code in the Header section
- Save
- Clarity will now track all pages
Webflow
- In Webflow project settings, go to Custom Code
- Paste Clarity tracking code in Head Code
- Publish your site
- Tracking begins immediately on the published domain
Drupal, Joomla, and Others
For CMS platforms without official plugins:
- Locate the global header template (usually
header.php,page.html.twig, or similar) - Add the Clarity tracking code before the closing
</head>tag - Save and clear cache
E-Commerce Platforms
Shopify (Detailed)
Beyond basic tracking, Clarity on Shopify captures:
- Product page interactions and scroll behavior
- Add-to-cart click patterns
- Checkout funnel navigation
- Mobile vs. desktop shopping behavior differences
Pro Tips:
- Filter recordings by "checkout" page to find abandonment friction
- Use heatmaps on product pages to optimize image and description placement
- Watch sessions with rage clicks to identify broken buttons or slow-loading elements
WooCommerce (WordPress)
Use the WordPress Clarity plugin or manually add the tracking code.
E-commerce Insights:
- Track cart page interactions
- Identify confusing checkout form fields
- Watch sessions where users abandon at specific steps
- Optimize mobile shopping experience
Magento
- Go to Content > Configuration
- Select your store view
- Expand HTML Head
- Add Clarity tracking code to Scripts and Style Sheets
- Save configuration
- Clear cache
BigCommerce
- Go to Storefront > Script Manager
- Click Create a Script
- Name it "Microsoft Clarity"
- Select Script location: Head
- Paste your Clarity tracking code
- Set to All Pages
- Save
Google Tag Manager Integration
For teams managing multiple marketing tags, GTM provides a centralized way to deploy Clarity without touching code directly.
Setup Process
Step 1: Create Clarity Tag in GTM
- In GTM, go to Tags > New
- Name the tag "Microsoft Clarity"
- Click Tag Configuration > Custom HTML
- Paste your Clarity tracking code (full script from Clarity dashboard)
- Save tag configuration
Step 2: Set Trigger
- Click Triggering
- Select All Pages (or create a custom trigger if you only want Clarity on specific pages)
- Save
Step 3: Test and Publish
- Click Preview in GTM
- Visit your website in the preview window
- Verify that the Clarity tag fires on page load
- Check GTM debug panel to ensure no errors
- In Clarity dashboard, verify that sessions are being recorded
- Publish the GTM container
Advanced GTM Setup
Conditional Loading
Only load Clarity on specific pages:
// Trigger: Custom Event
// Trigger fires on: Some Pages
// Condition: Page Path contains "/checkout"
Sampling
Track only a percentage of sessions to reduce data volume on high-traffic sites:
// Custom HTML Tag
<script type="text/javascript">
if (Math.random() < 0.5) { // 50% sampling
(function(c,l,a,r,i,t,y){
// Rest of Clarity tracking code
})(window,document,"clarity","script","YOUR_PROJECT_ID");
}
</script>
API Integration
Clarity doesn't offer a full REST API for programmatic access to session data, but it does provide a JavaScript API for custom event tracking and session tagging.
JavaScript API
Track Custom Events
// Fire custom event
clarity("event", "feature_used");
// Set custom tags for filtering
clarity("set", "user_type", "premium");
clarity("set", "experiment_variant", "B");
Identify Users
// Set custom user ID (use hashed ID, not PII)
clarity("identify", "user_abc123");
Upgrade User Session
// Force current session to be recorded even if sampling is enabled
clarity("upgrade", "session_priority");
Use Cases
Segment by User Type:
// After user login
if (userIsPremium) {
clarity("set", "subscription", "premium");
} else {
clarity("set", "subscription", "free");
}
Tag A/B Test Variants:
// After assigning user to experiment
clarity("set", "experiment", "homepage_redesign");
clarity("set", "variant", userVariant); // "A" or "B"
Then filter recordings in Clarity by these custom tags to analyze behavior differences.
Collaboration Tools
While Clarity doesn't have formal integrations with Slack, Jira, or Asana, you can leverage session URLs for collaboration:
Slack
Share session recordings directly in Slack channels:
- In Clarity, find a session of interest
- Copy the session URL
- Paste in Slack with context: "Found mobile checkout bug: [URL]"
Team members can click and watch without needing Clarity access (as long as they're invited to the Clarity project).
Jira / Bug Tracking
Attach Clarity session URLs to bug tickets:
- Reproduce the bug or find a user session exhibiting the issue
- Copy the Clarity session URL
- Paste it into the Jira ticket description or comments
- Developers can watch the session to understand the exact user experience
Microsoft Teams
Since Clarity is a Microsoft product, sharing in Teams is seamless:
- Copy session URL from Clarity
- Paste in Teams chat or channel
- Teams automatically unfurls a preview
- Team can discuss the session inline
Analytics Platform Alternatives
While Clarity integrates officially with Google Analytics, you can use it alongside other analytics platforms:
Adobe Analytics
No official integration, but you can:
- Use both tools in parallel
- Manually cross-reference Adobe data with Clarity sessions by time ranges and pages
- Tag Clarity sessions with Adobe campaign IDs using custom events
Mixpanel / Amplitude
Behavior analytics platforms like Mixpanel and Amplitude track events, while Clarity shows sessions:
- Use Mixpanel/Amplitude for quantitative funnel analysis
- Use Clarity to watch sessions of users who dropped off at specific funnel steps
- Tag Clarity sessions with Mixpanel user IDs for cross-referencing
Matomo / Plausible
Privacy-focused analytics work well with Clarity:
- Both tools respect user privacy
- Clarity provides session context that event-based analytics don't capture
- Use together for a complete privacy-conscious analytics stack
Content Delivery Networks (CDNs)
Clarity's tracking script is hosted on Microsoft's global CDN, ensuring fast load times worldwide. No special CDN configuration is needed.
Cloudflare
Clarity works seamlessly with Cloudflare. No conflicts with:
- Rocket Loader
- Minification
- Bot management
- DDoS protection
Custom CDN Configurations
If you host the Clarity script on your own CDN:
- Download the Clarity script from Microsoft's CDN
- Host it on your CDN
- Update the script tag source URL
- Ensure your CDN supports frequent updates (Clarity occasionally updates the script)
Note: Microsoft recommends using their hosted version to automatically receive updates and optimizations.
Consent Management Platforms
Clarity respects user privacy and works with consent management platforms:
OneTrust
// Only load Clarity after consent
OptanonWrapper = function() {
if (OptanonActiveGroups.indexOf('C0002') > -1) {
// User consented to performance cookies
// Load Clarity script
}
}
Cookiebot
// Conditional loading based on consent
if (Cookiebot.consent.statistics) {
// Load Clarity
}
Custom Consent
// Check your custom consent flag
if (userConsent.analytics === true) {
(function(c,l,a,r,i,t,y){
// Clarity tracking code
})(window,document,"clarity","script","YOUR_PROJECT_ID");
}
Limitations and Workarounds
No Server-Side Integration
Clarity is client-side only. You can't send events from server-side code. For server-side tracking, use Google Analytics Measurement Protocol or similar, then cross-reference with Clarity sessions.
No Real-Time API
You can't programmatically query Clarity for real-time session data. All insights are accessed through the Clarity dashboard.
Limited Export Options
Clarity doesn't offer bulk session export or CSV downloads. Insights are meant to be consumed in the dashboard through recordings and heatmaps.
Workaround: Integrate with GA4 to get quantitative data exports, then use Clarity for qualitative deep dives.
Best Practices
✅ Do:
- Integrate Clarity with Google Analytics for maximum insight
- Use GTM for easier tag management across multiple marketing tools
- Tag sessions with custom events to enable filtering by business context
- Share session URLs with team members for collaborative debugging
- Respect user consent by loading Clarity only after approval
❌ Don't:
- Expect Clarity to replace your primary analytics platform (it's complementary)
- Send PII through custom events or user identification
- Over-engineer integrations; Clarity is designed to be simple
- Ignore consent requirements in privacy-regulated regions
Key Takeaways
Microsoft Clarity integrates seamlessly with:
- Google Analytics for combined quantitative + qualitative insights
- CMS platforms (WordPress, Shopify, Wix, etc.) via plugins and manual installation
- Google Tag Manager for centralized tag management
- Collaboration tools via shareable session URLs
- Consent management platforms for privacy compliance
The most valuable integration is Google Analytics, which transforms both tools into a more powerful analytics stack. Start there, then expand to CMS and GTM integrations as needed.
Additional Resources: