Microsoft Clarity

Connect Microsoft Clarity with Webflow to record every user session, visualize clicks and scrolls with heatmaps, and detect rage clicks and UX friction.

Install app
View website
View lesson
A record settings
CNAME record settings
Microsoft Clarity

How to build with Microsoft Clarity and Webflow

Microsoft Clarity bridges the gap between pageview analytics and understanding user struggles. Connect Clarity to Webflow using three methods: the Microsoft Clarity marketplace app for one-click setup (recommended), manual code embedding for custom configurations, or API integration for programmatic data access.

Let’s look at the integration types in detail:

Use the Microsoft Clarity app

The Microsoft Clarity marketplace app offers the fastest integration with guided setup and automatic project creation. Install from Webflow's marketplace, authorize your sites, and link or create a Clarity project. The data appears within minutes after publishing.

This method provides:

  • Complete dashboard access within Webflow: View recordings, heatmaps, and insights without leaving your workspace  
  • Automatic tracking code deployment: No manual code copying required  
  • Copilot AI integration: Get summarized insights and recommendations within your workflow  
  • Automatic deployment: Clarity improvements deploy through the native integration

The marketplace app works best for teams wantinga  straightforward setup without technical implementation.

Embed tracking code manually

Manual implementation provides complete control over tracking code placement and configurations. Create a project in your Clarity dashboard, copy the JavaScript tracking code, and paste it into Webflow's Site Settings under Custom Code (Head code section). However, the Microsoft Clarity app remains the recommended approach for one-click installation.

The Webflow custom code documentation covers three methods:

  1. Site-wide code through Site Settings (Head or Footer Code)  
  2. Page-specific code via individual page settings  
  3. The Custom Code Embed element for in-page placement.

The Head Code section is recommended for analytics, and all sections support up to 50,000 characters.

Here are the implementation steps:

  1. Create your Microsoft Clarity account at https://clarity.microsoft.com/, enter your Website URL, and copy your tracking code from Settings → Setup  
  2. Navigate to Site Settings → Custom Code in Webflow  
  3. Paste the Clarity tracking code in the Head Code section  
  4. Publish your site to activate tracking — saving in the Designer isn't sufficient  
  5. Wait 2-3 minutes, then verify tracking by checking for active users in Clarity

Place code in Head Code rather than Footer Code — analytics scripts load more reliably when initialized before page content.

The manual implementation enables:

  • Custom data masking: Add data-clarity-mask="true" to sensitive form fields  
  • User identification: Implement window.clarity('identify', userId, sessionId, pageId, friendlyName) to track users across sessions  
  • Custom event tracking: Use window.clarity('event', eventName) to log specific interactions  
  • GDPR consent integration: Control tracking with window.clarity('consent') based on user preferences

Manual integration works best when you need customization beyond the marketplace app, such as custom event tracking or advanced cookie consent integration.

Build with Webflow and Microsoft Clarity API

For programmatic control, both platforms provide REST APIs. S

API capabilities include: custom event tracking for Webflow interactions, automated content optimization by correlating Clarity metrics with Webflow CMS performance, GDPR consent management, and programmatic session data retrieval.

The Clarity Data Export API at GET https://www.clarity.ms/export-data/api/v1/project-live-insights provides JWT-authenticated data retrieval, designed for periodic exports rather than real-time streaming. The Webflow API supports programmatic site management including custom code deployment via PUT https://api.webflow.com/v2/pages/:page_id/custom_code.

Access analytics data programmatically

The Clarity Data Export API provides JSON-formatted analytics data through REST endpoints. Retrieve traffic metrics, engagement time, scroll depth, and dimensional breakdowns by browser, device, country, and campaign. Combine with the Webflow CMS API to correlate engagement metrics with content performance — list collection items and match with Clarity session data to identify high-engagement content.

Authentication: Generate JWT tokens in Clarity project settings under Data Export (admin permissions required). Include tokens as Authorization: Bearer YOUR_TOKEN. For site tracking via the Clarity tracking code, no additional authentication is required—the project ID in your snippet handles authentication.

Primary endpoint:

GET https://www.clarity.ms/export-data/api/v1/project-live-insights?numOfDays={1|2|3}&dimension1={dimension}&dimension2={dimension}&dimension3={dimension}

Authentication: Requires JWT Bearer token via the Authorization header.

Query Parameters:

  • numOfDays - Values of 1, 2, or 3 (days of historical data)  
  • dimension1, dimension2, dimension3 - Optional dimensions: Browser, Device, OS, Country

Integration example with Webflow:

Correlate Clarity session data with Webflow CMS collection list performance by matching timestamps with engagement metrics. Export Clarity data and update Webflow CMS fields via the Webflow CMS API to display popular content based on scroll depth and engagement. For multi-site implementations, explore multi-channel content delivery. The API is designed for periodic exports and daily reporting.  

Track Webflow interactions with custom events

The Clarity JavaScript API tracks custom events for Webflow interactions without backend infrastructure. Call methods through window.clarity after the tracking code loads.

Available methods:

  • Webflow form trackingwindow.clarity('event', 'webflow_form_field_focus') tracks interactions with .w-input fields  
  • CMS collection engagementwindow.clarity('event', 'cms_item_clicked') logs clicks on .w-dyn-item elements  
  • User identificationwindow.clarity('identify', userId, sessionId, pageId, friendlyName) links form submissions to known users  
  • Session taggingwindow.clarity('set', 'webflow_collection', 'blog-posts') adds metadata for filtering sessions  
  • Consent managementwindow.clarity('consent') or window.clarity('consent', false) controls tracking based on user preferences

This client-side approach requires no server infrastructure and begins collecting data within 2-3 minutes, with full dashboard availability in 5-10 minutes.

Sync data with Webflow webhooks

Important: This approach uses Webflow webhooks to capture site events, which you correlate with Clarity session data through manual analysis or custom middleware. Microsoft Clarity doesn't provide webhooks—you'll need to periodically retrieve Clarity data via the Data Export API.

Webflow's webhook system sends real-time notifications for form submissions, CMS updates, and site publishing through seven event types (form_submission, collection_item_created, collection_item_changed, collection_item_deleted, collection_item_unpublished, site_publish, and e-commerce events). Clarity provides a polling-based Data Export API instead. Connect Webflow webhooks to custom endpoints that receive events in real-time, then periodically retrieve Clarity session data to correlate behavior patterns.

Relevant webhook events:

Create webhooks through the Webflow API. For real-time synchronization, build custom middleware that receives Webflow webhooks and periodically polls Clarity's API.

curl -X POST https://api.webflow.com/v2/sites/{site_id}/webhooks \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "triggerType": "form_submission",
    "url": "https://your-server.com/webhook"
  }'

Note: This is a Webflow API endpoint for creating webhooks. Microsoft Clarity doesn't offer webhooks, but you can use Webflow webhooks to stream events to external systems for analytics integration.

Validate webhook authenticity via the x-webflow-signature header per the webhook signatures documentation.

Use cases combining webhooks with Clarity:

  • Form abandonment analysis — Track form submissions via Webflow's Form Submissions API and form_submission webhooks to calculate completion rates  
  • Content performance monitoring — Correlate Clarity metrics with CMS publication times using collection_item_created events  
  • Deployment annotations — Create analytics markers when site_publish events occur to track post-update changes

What you can build

Integrating Microsoft Clarity with Webflow gives you visibility into actual user behavior patterns, conversion barriers, and UX friction points across your entire site.

  • E-commerce checkout optimization: Identify cart abandonment patterns through session recordings. Watch users navigate product pages, add items to cart, and encounter checkout obstacles.    
  • B2B lead generation optimization: Analyze form abandonment using Microsoft Clarity's heatmaps to identify which content sections drive interaction.    
  • Content performance tracking: Use Clarity's heatmaps to understand actual reading behavior beyond page views. Scroll depth reveals where readers stop engaging.    
  • Mobile-first responsive design optimization: Segment heatmaps by device type to uncover device-specific friction that aggregate analytics hide.

Frequently asked questions

  • Place the tracking code in the Head Code section under Site Settings → Custom Code. The Head Code section supports up to 50,000 characters and applies code site-wide across all pages automatically. For analytics implementations like Microsoft Clarity, the Head Code section is recommended for optimal tracking initialization. Avoid placing the code in Footer Code as this can delay tracking initialization and may miss early page interactions.

  • Obtain explicit user consent before activating Clarity tracking for visitors from the EU, UK, and Switzerland — this is a mandatory legal requirement for GDPR compliance, not optional. Starting October 31, 2025, Clarity enforces consent signal requirements for these regions. Implement a Cookie Management Platform like Cookiebot or OneTrust on your Webflow site, then integrate it with Clarity's Consent API using window.clarity('consent') to grant tracking permission or window.clarity('consent', false) to withdraw it. Microsoft provides implementation details, including testing procedures for different consent scenarios.

  • Data processing can take 2-3 minutes after publishing. Verify that you published your Webflow site rather than just saving changes—custom code only activates on published sites. Check browser Developer Tools (F12) to confirm the Clarity script loads by looking for requests to https://www.clarity.ms/collect in the Network tab. Clear both your website cache and browser cache if you recently made code changes. If issues persist, verify the tracking code appears in your published site's source code and confirm your Clarity project domain matches your Webflow site's published domain exactly.

  • Yes, use the Clarity JavaScript API to log custom events with window.clarity('event', 'event_name'). Track button clicks, form field interactions, video plays, or any JavaScript-accessible user action. Add the event tracking code to Webflow's custom code sections or use a custom code embed on specific pages. For example, track when users expand accordion elements, scroll past pricing tables, or interact with custom components. You can filter session recordings by your custom events to analyze specific user behaviors and create audience segments based on tracked interactions.

Microsoft Clarity
Microsoft Clarity
Joined in

Description

Microsoft Clarity is a free behavior analytics platform that provides session recordings, heatmaps, and AI insights to help you understand user behavior and identify UX issues. The platform visualizes user interactions, detects frustration patterns like rage clicks and dead clicks, and generates automated recommendations through its Copilot AI feature.

Install app

This integration page is provided for informational and convenience purposes only.


Other Analytics and targeting tools integrations

Other Analytics and targeting tools integrations

Zuko

Zuko

Connect Zuko Analytics with Webflow to track detailed form interactions, identify drop-offs, and optimize conversion performance through behavioral insights.

Analytics and targeting tools
Learn more
The Facebook Pixel

The Facebook Pixel

Use the Facebook pixel to understand the actions people are taking on your website.

Analytics and targeting tools
Learn more
Optimizely

Optimizely

Add Optimizely's experimentation platform to your Webflow site for A/B testing and personalization.

Analytics and targeting tools
Learn more
Nocodelytics

Nocodelytics

Connect Nocodelytics with Webflow to track user behavior, clicks, and conversions without coding custom analytics.

Analytics and targeting tools
Learn more
Matomo (formerly Piwik)

Matomo (formerly Piwik)

Connect Matomo's privacy-focused analytics with Webflow to gain deep insights into visitor behavior while maintaining complete data ownership. Track conversions, visualize user journeys, and optimize your site's performance without compromising user privacy or sharing data with third parties.

Analytics and targeting tools
Learn more
Marketo

Marketo

Connect Marketo with Webflow to capture leads, track visitor behavior, and create personalized marketing campaigns directly from your Webflow site.

Analytics and targeting tools
Learn more
Klaviyo

Klaviyo

Connect Klaviyo's powerful email marketing and SMS automation with Webflow to create personalized customer journeys, capture leads through embedded forms, and sync e-commerce data for abandoned cart recovery and behavioral targeting — all without leaving your visual design environment.

Analytics and targeting tools
Learn more
Hotjar

Hotjar

Connect Hotjar's powerful user behavior analytics with Webflow to understand how visitors interact with your site. Track heatmaps, session recordings, and gather feedback to optimize user experience and boost conversions — all without coding.

Analytics and targeting tools
Learn more
Google Tag Manager

Google Tag Manager

Connect Google Tag Manager to Webflow to manage all your marketing and analytics tags from one central dashboard. Deploy tracking pixels, conversion scripts, and third-party tools without touching code, while maintaining site performance and privacy compliance.

Analytics and targeting tools
Learn more

Related integrations

No items found.

Get started for free

Try Webflow for as long as you like with our free Starter plan. Purchase a paid Site plan to publish, host, and unlock additional features.

Get started — it’s free