Microsoft Clarity alternative: session replay your AI agent sets up and reads
Microsoft Clarity is free session replay and heatmaps with no traffic limits, recordings kept 30 days and mobile app SDKs (as of 7 November 2026), built for people in its dashboard; an AI agent gets a local MCP server and a Data Export API capped at 10 requests a project a day. AgentFirstStack Replay is free, open-source replay your agent sets up and reads itself: strict masking in the browser, no cookies, consent where required, and each session as a transcript over REST and MCP. Stay with Clarity for every session at any traffic, mobile apps or longer retention.
Set it up with one prompt
Paste this into your coding agent. It runs next to Clarity first, so you lose no recordings while you compare.
Set up AgentFirstStack Replay on this project, next to Microsoft Clarity. It's free, open-source session replay built for agents, masked in the visitor's browser by default, and you can do the setup yourself: there is no signup form. 1. Read https://agentfirststack.com/llms.txt and https://replay.agentfirststack.com/llms.txt. 2. Find where Clarity's tracking code is installed (in the page, a plugin or Google Tag Manager) and how the site sends it consent (clarity('consentv2', ...), Google Consent Mode or a consent platform). Tell me what you found and change nothing in Clarity. 3. If this project's .env already has AGENTFIRSTSTACK_API_KEY, use it and read AGENTFIRSTSTACK.md. Otherwise get a key: curl -X POST https://agentfirststack.com/v1/signup, and save api_key in .env as AGENTFIRSTSTACK_API_KEY and in the production secrets. 4. Create a replay site for the production domain with require_consent "eea". If the site already sets Google Consent Mode, add consent_source "gcm" so replay follows the same choice; with an IAB TCF consent platform, "tcf"; with its own banner, call afsr('consent', true) where it tells Clarity. Link analytics_site_id if the site runs AgentFirstStack analytics; otherwise add the snippet from the install answer. Serve it from the site's own domain (a first-party domain, or the path proxy until its DNS record is live). 5. Keep mask_mode strict and unmask only interface text (nav, buttons, links, headings, labels). Add "[data-clarity-mask]" to mask_selectors, and ask me for any selectors under Clarity's Settings, Masking. 6. Deploy, open the homepage with ?afsr=1 and click through the main pages, then run verify and fix what it reports. 7. Leave Clarity installed: its recordings can't be moved. Write the replay site id and the env var name (never the key) in AGENTFIRSTSTACK.md, and create a claim link for me with POST https://agentfirststack.com/v1/claim-link. Tell me what you set up, what verify returned, how consent now works for each tool, and give me the claim link.
What Microsoft Clarity is
Microsoft Clarity is a behavior analytics tool for websites and apps: session recordings, heatmaps and insights such as rage clicks, dead clicks, excessive scrolling, quick backs and JavaScript errors (semantic metrics). Its FAQ says "Clarity is a free service forever" and "You never encounter traffic limits or are compelled to upgrade to a paid version", with "No sampling" and no limit on the number of projects (Clarity FAQ, as of 7 Nov 2026). Funnels and smart events are set up without code.
It also does things for people that AgentFirstStack doesn't: Copilot answers questions about the dashboard and summarizes heatmaps; a Google Analytics integration adds a Clarity dimension to one web property; and AI Visibility shows "how often your website appears in AI-generated answers", next to Bot Activity, which needs a connection to a CDN such as Cloudflare, Fastly or Amazon CloudFront (same FAQ). Our AI search reports AI crawler reads and visitors sent by assistants, but doesn't track citations in answers.
The details that matter when you compare, as of 7 Nov 2026:
| Microsoft Clarity | Source | |
|---|---|---|
| Price | Free; "Clarity is 100% free - forever" | FAQ |
| Traffic | No traffic limits, no sampling | FAQ |
| Recordings kept | 30 days; labelled or favorited sessions 9 months | Data retention |
| Heatmap data | 9 months | Data retention |
| Default masking | "By default, the masking mode is set to Balanced": numbers and email addresses masked. Strict masks all content. Inputs and dropdowns are masked in every mode | Masking |
| Cookies | First-party _clck and _clsk, plus Microsoft third-party cookies such as MUID | Cookies |
| Consent | Consent signals enforced for visits from the EEA, UK and Switzerland since 31 October 2025, through clarity('consentv2', ...), Google Consent Mode or a consent platform | Consent API, GCM |
| Without consent | No cookies; "Each pageview creates a new session" | Without consent |
| One visitor's data | "You need to delete the entire project to delete user's data" | FAQ |
| API | Data Export API: 10 requests per project a day, the last 1 to 3 days, up to three dimensions, 1,000 rows with no pagination | Data Export API |
| MCP | A local server started with npx and a Data Export token: dashboard queries and a list of recordings | GitHub |
| Mobile apps | Native Android and iOS, React Native and Flutter; Cordova and Ionic on Android | Mobile SDK |
What Clarity's MCP server and Data Export API return to an agent, tool by tool, is on our Microsoft Clarity MCP page.
How AgentFirstStack Replay does it
The difference is who sets it up and who reads it. There's no project to create in a dashboard: your agent makes the account, the site and the install, checks it, and reads what visitors did.
- Setup by the agent.
POST /v1/signupreturns a key,POST https://replay.agentfirststack.com/v1/sitescreates the site, andverifyfetches the live homepage to check the install, the Content-Security-Policy and the domain. Linked to AgentFirstStack analytics, the tracker loads the recorder: one snippet for both. - Strict masking, no cookies. Every text node and typed value is masked in the browser before it's sent; your agent unmasks interface text only. Password, payment-card and one-time-code fields can never be unmasked. The session lives in the tab's sessionStorage, and the IP address is never stored.
- Consent that waits. With
require_consent: "eea", visitors from the EEA, the UK and Switzerland aren't recorded at all until they consent, throughafsr('consent', true), Google Consent Mode, an IAB TCF v2 CMP or the AgentFirstStack consent banner. Everyone else is recorded at once. That's a different choice from Clarity's, which keeps recording without consent, one pageview per session. - Sessions as text. Each session is a transcript of pages, labelled clicks, masked inputs, scroll depth, errors and the signals (rage, dead and error clicks, quick backs, excessive scrolling, failed requests), plus summaries across up to 1,000 sessions, heatmaps as data, grouped errors, funnel drop-offs and survey answers. API reads are limited to 300 a minute per project, not 10 a day.
- Signals go where you report. Rage clicks, JS errors and the rest arrive in AgentFirstStack analytics as events joined to the visitor, and in a tags container as server events if you link one.
- Served from your own domain. A first-party domain (one CNAME) serves replay at
/_r/*with analytics and tags, so the recorder doesn't load from a third-party host, which is what ad blockers block.
The hosted service records 200 sessions per site a day (100 until a person claims the project), each up to 30 minutes, and keeps them 14 days. Everything else is on the session replay page and in the replay manual.
Side by side
| Microsoft Clarity | AgentFirstStack Replay | |
|---|---|---|
| Price | Free | Free hosted service with fair-use limits |
| Setup | A person signs up, adds a project and installs the tracking code | The agent: POST /v1/signup, a site, the snippet or an analytics link, then verify |
| Volume | No traffic limits, no sampling | 200 sessions per site a day |
| Recordings kept | 30 days; labelled or favorited 9 months | 14 days hosted; up to 365 self-hosted |
| Heatmaps | Visual, in the dashboard; data kept 9 months | As data and as a PNG; daily aggregates up to 90 days |
| Default masking | Balanced: numbers and email addresses | Strict: all text and inputs |
| Cookies | First-party and Microsoft third-party cookies | None: a per-tab session in sessionStorage |
| EEA, UK and Swiss visitors without consent | Recorded without cookies, one session per pageview | With require_consent: "eea", not recorded |
| Reading sessions as an agent | MCP lists recordings by filter, which you watch in Clarity; Data Export API, 10 requests a day | Transcripts, summaries, heatmaps, errors and funnels over REST and MCP |
| Written summaries | Copilot chat and heatmap summaries | Findings computed without a model; your agent interprets |
| One visitor's data | Delete the whole project | get_visitor and delete_visitor_data |
| Mobile apps | Android, iOS, React Native, Flutter | No: websites only |
| Source | The tracking code is open source | The whole service is AGPL-3.0, the recorder MIT; self-hostable on Cloudflare |
When to choose which
Stay with Microsoft Clarity if
- You need every session recorded at high traffic, free: Clarity has no traffic limits and no sampling, and our hosted service stops at 200 sessions per site a day.
- You need recordings for more than 14 days, or heatmap history for months.
- You record native or hybrid mobile apps.
- People on your team watch recordings and read heatmaps in a dashboard, and like Copilot, smart events, the Google Analytics integration or Shopify purchase insights.
- You want reports on citations in AI answers, which our AI search doesn't do.
Use AgentFirstStack Replay if
- An agent should set replay up, test it and report back, without a person creating a project or a token.
- The agent needs to read many sessions as text, search them by signal or survey answer, and group what went wrong, without a 10-request daily quota.
- You want every text masked by default, no cookies, nothing recorded from EEA, UK or Swiss visitors before consent, and deletion of one visitor's data.
- You want replay with analytics, tags and inboxes on one key, open source and self-hostable.
You can run both while you compare; each adds its own recorder to the page.
Moving from Clarity
- Recordings don't move. Clarity's FAQ says you can't download specific recordings, and there's no import. Keep Clarity until you no longer need its 30 days of recordings.
- Masking rules do. Elements marked
data-clarity-maskkeep working when[data-clarity-mask]is in the replay site'smask_selectors; selectors from Clarity's mask-by-element list go there too. Review unmask rules before copying them: our default is stricter, andunmask_selectorsnever reveal typed values. - Consent follows the same source. If Clarity gets consent from Google Consent Mode, set
consent_source: "gcm"; with an IAB TCF platform,"tcf"; with your own banner, callafsr('consent', true)where it callsclarity('consentv2', ...). - The setup check knows. When the tags scan finds Clarity on the site, the setup check's "other tools" row lists it as staying until its recordings expire. Your agent removes Clarity's code only when you say so.
FAQ
Is Microsoft Clarity really free?
Yes. As of 7 November 2026, Microsoft's Clarity FAQ says it is a free service forever, with no traffic limits, no sampling and no paid version to upgrade to. AgentFirstStack Replay's hosted service is free too, but with fair-use limits: 200 recorded sessions per site a day.
What does Clarity do better than AgentFirstStack Replay?
Volume, retention and people. Clarity records every session at any traffic, keeps recordings 30 days and heatmap data 9 months, has SDKs for Android, iOS, React Native and Flutter apps, and has a dashboard with Copilot chat, funnels, a Google Analytics integration and AI Visibility reports for people who work in it.
Does Clarity need cookie consent in Europe?
Clarity has enforced consent signals for visits from the EEA, the UK and Switzerland since 31 October 2025. Without consent it sets no cookies and treats each pageview as a separate session, so journeys, funnels and quick backs lose accuracy. AgentFirstStack Replay with require_consent set to eea records nothing from those visitors until they consent, and never sets cookies.
Can an AI agent read Clarity recordings?
It can list them. Clarity's MCP server runs locally with a Data Export API token and lists recordings by filter, which you watch in Clarity, and the Data Export API allows 10 requests per project a day over the last 1 to 3 days. AgentFirstStack Replay returns each session as a text transcript, with summaries, heatmaps, errors and funnels over REST and MCP.
Can I move my Clarity recordings to AgentFirstStack?
No. Clarity's FAQ says you can't download specific recordings, and AgentFirstStack can't import them. Keep Clarity installed until you no longer need its history, and copy its masking rules into the replay site's selectors.
How do I delete one visitor's data?
In Clarity, per its FAQ, you delete the entire project. In AgentFirstStack Replay, delete_visitor_data removes one person's sessions and survey answers by user id, analytics visitor id, session ids or email, and get_visitor shows what is stored about them first.
Related
- ReplaySession replayMasked recordings your agent sets up and reads as text.
- ReplayMicrosoft Clarity MCPWhat Clarity's MCP server and export API return.
- ReplayHotjar alternativeContentsquare, formerly Hotjar, compared.
- ReplayFullstory alternativeEnterprise experience analytics, or open-source replay.
- ReplaySession replay for AI agentsFind out why visitors drop off.
- Cookie consent bannerOne banner for tags, Consent Mode and replay.