A JS error, short for JavaScript error, is an exception thrown while a script executes in a visitor's browser. Microsoft Clarity, the free behavioural analytics product Microsoft launched in late 2020, treats these exceptions as a first-class metric: the tracking code listens for them, the dashboard counts them, and every affected session can be replayed. The reason the metric exists is that broken scripts rarely announce themselves. A visitor whose checkout button silently fails does not file a bug report. They leave. Clarity's error reporting exists to turn that invisible failure into something a team can see, count, and watch happen.
How Clarity captures an error
Clarity works from a single asynchronous script placed in a page's head section. That script loads from clarity.ms, instruments the page, and streams data back to Microsoft's Azure infrastructure. Microsoft's data collection documentation splits the payload into three parts: an envelope carrying version, project ID, user ID, session ID and page number; an analytics block carrying events; and a playback block carrying the document object model and its mutations.
Script errors sit inside the analytics block, classified as diagnostic events alongside image errors, logs and performance events. That classification matters. Clarity is not a debugger attached to the page. It is a behavioural recorder that happens to log exceptions as one more event type in the same ordered stream as clicks, scrolls and text input, which is why an error can be positioned precisely against what the visitor was doing when it fired.
The underlying browser mechanism is the window error event, standardised in HTML and supported across browsers since 2015. It fires for synchronous script failures and hands over a message, a source file, a line number and a column number. Promise rejections without handlers do not trigger it; they raise a separate unhandledrejection event.
What the dashboard reports
Clarity's documentation describes the dashboard as surfacing concurrent JavaScript errors occurring across a site's clients. The insights view shows a total error count, a breakdown by individual error message, and a link from each message straight into the recordings where it occurred.
That breakdown arrived on 20 October 2022, when Microsoft shipped JavaScript error details and a companion metric called click errors. Writing on the Clarity blog, Sharon Peng put a number on the problem: around 9% of a site's sessions carried a JavaScript error, measured across the platform at that time. Two obstacles made that figure hard to act on. Sites accumulate hundreds of distinct error types, and many of them never touch the user experience at all.
Peng also published the four most common error types across Clarity projects, with the share of projects affected: illegal invocation at 7.4%, an unexpected token caused by an unclosed script tag at 6.5%, a ResizeObserver loop limit at 5.7%, and an undefined jQuery reference at 3.4%. The same post reported that in more than 30% of Clarity projects, a single error type accounted for over half of all script error issues, which reframes error triage as a search for one dominant offender rather than a general cleanup.
Click errors narrow the set to exceptions that fire after a user click. Sessions containing one are tagged automatically, and a toggle at the top of the error widget switches the view. The separation is the difference between a script failing on page load and a script failing because someone pressed something.
Filtering and segmentation
JavaScript errors appear in Clarity's filter panel under the Page group, which also holds page duration, click count, page size, screen resolution and visible time. The error filter selects sessions where an exception was detected during script execution. Its dropdown exposes the top 500 error messages for a project. Multiple errors can be combined with logical OR or logical AND, an option exists to select any JavaScript error at all, and the filter supports exclusion, so a known and harmless error can be removed from a view rather than muddying it. Click errors sit in the same dropdown, below the JavaScript section.
Filter combinations save as segments and persist across the dashboard, recordings and heatmaps. Heatmaps add a related view: the click map offers an error clicks layer, documented as showing clicks that occur immediately before JavaScript errors. That framing is the inverse of the click errors metric, which is described as errors occurring after a click. Both describe the same adjacency from opposite ends.
Origin and evolution
The opaque half of this metric predates Clarity by a decade. In 2011, the HTML specification was tightened so that a script served from a different origin reports only the string "Script error." to the error handler, with an empty filename and a line number of zero. Browsers hide the detail deliberately, to stop a cross-origin script leaking information to a handler it does not control. Recovering the real message requires a crossorigin attribute on the script tag and a matching access control header from the serving origin.
Clarity itself began as an internal tool for studying user behaviour on Bing.com before its public launch in late 2020. Microsoft's fifth-anniversary post confirms that JavaScript errors were on the original dashboard, alongside rage clicks, dead clicks, sessions, scroll depth and quick backs. The October 2022 release added message-level detail and click errors. In April 2023, mobile SDKs extended the model to iOS and Android with crash analytics. Documentation now covers linking Clarity sessions to Sentry events through a session URL tag, placing behavioural replay beside a dedicated error monitoring stack rather than replacing it.
Why the metric matters to marketers
For media buyers the relevance is direct. Paid traffic lands on pages that scripts control, and a landing page that throws an exception on a form submit converts nothing while continuing to bill. Clarity's Campaign Insights feature, launched on 14 May 2025, was built around exactly that gap, mapping where users abandon conversion and flagging negative engagement signals on pages reached through ads. Clarity's Google Ads integration classifies sessions as low, medium or high intent based on engagement, which makes a script failure visible as a suppressed intent distribution rather than only as a raw error count.
Exposure widened further when Microsoft Advertising made Clarity mandatory for all third-party publishers on 11 November 2025, with clicks from pages lacking the tag filtered out as nonbillable. Error reporting arrived on a large set of publisher properties as a side effect of a policy about inventory quality.
Limitations and disputes
Clarity does not accept source maps. A feature request asking Microsoft to allow their upload, so minified stack traces could be rendered readable, was opened on GitHub within days of the October 2022 launch and remains unimplemented as of August 2026. Competing tools took the opposite route: Amazon added source map support to CloudWatch RUM in March 2025, and Sentry and PostHog treat source map upload as standard setup. Clarity reports a message and a count, not a resolved stack trace.
Microsoft's own documentation contradicts itself on scope. The semantic metrics page and the 2022 announcement both describe a per-message breakdown, while the FAQ, last updated on 30 June 2026, still states that specific script error names cannot be viewed automatically and that the capability is in development. Both pages are current Microsoft documentation.
Retention caps the analysis window. Recordings persist for 30 days, with favourites and a random sample held up to nine months, and Clarity records a maximum of 100,000 sessions per project per day. Programmatic access is thin: the Data Export API breaks metrics down by up to three dimensions across a maximum of three days, and the Clarity MCP server released on 4 June 2025 carried a limit of ten requests per day at launch.
Noise is a further problem. Microsoft's own guidance flags the ResizeObserver loop error as typically not user-impacting and safe to ignore, yet it counts toward the same total as a failed payment script. Clarity cannot render inside third-party iframes, so errors thrown by embedded third-party content fall outside its view. Support forums also carry recurring reports of the Clarity tag itself generating console errors, particularly on Shopify and single-page framework installations, which means the measuring instrument occasionally appears in its own measurements.
Consent adds a European constraint. Clarity enforced consent signal requirements for the EEA, UK and Switzerland, and without a valid signal sessions fragment page by page. An error trail that spans a journey becomes several disconnected fragments.
Disambiguation
Dead click: a click producing no visible response within a reasonable time. It signals a broken or misleading element, but no exception is required and often none is thrown.
Click error: a strict subset of JS errors, restricted to those firing after a user click. Every click error is a JS error; most JS errors are not click errors.
Rage click: repeated rapid clicking in a clustered area. A behavioural symptom of frustration rather than a technical event.
Script error: in Clarity's data model, the internal event name for the diagnostic category. In browser consoles, the literal message returned for cross-origin failures. The two senses are unrelated in meaning.
Recent developments
Error reporting has been the quiet part of Clarity's roadmap. Development since 2025 has concentrated on AI measurement, from Copilot in the dashboard on 15 April 2025 through bot analytics, citations and topic-level reporting. The error card has not changed materially since 2022. Copilot summarisation now reaches error-tagged recordings indirectly, and Microsoft's documentation warns that generative output can be ungrounded and requires verification. The metric remains what it was at launch: a count, a message list, and a route into the recordings.
Timeline
- 2011: HTML specification work fixes the cross-origin error handler behaviour, returning only "Script error." with an empty filename and zero line number
- July 2015: the window error event reaches broad cross-browser availability
- Late 2020: Microsoft Clarity launches publicly with JavaScript errors already on the dashboard alongside rage clicks, dead clicks and quick backs
- 20 October 2022: Clarity ships JavaScript error details and the click errors metric, reporting 9% of sessions affected on average
- 30 October 2022: a GitHub feature request asks Microsoft to support source map upload
- April 2023: Clarity for Mobile Apps launches with iOS and Android SDKs including crash analytics
- 15 April 2025: Copilot arrives in the Clarity dashboard
- 14 May 2025: Campaign Insights connects advertising performance to post-click behavioural signals
- 4 June 2025: the Clarity MCP server launches with a ten-requests-per-day limit and three days of history
- 11 November 2025: Microsoft Advertising requires Clarity on all third-party publisher placements
- 15 December 2025: Clarity's fifth-anniversary post confirms JavaScript errors were present at launch
- 30 June 2026: the Clarity FAQ, updated, still states that specific script error names cannot be viewed automatically
Related PPC Land coverage
- Microsoft Clarity bridges ad gap with AI insights - covers the 14 May 2025 launch of Campaign Insights and the negative engagement signals it surfaces on post-click landing pages.
- Microsoft Advertising requires Clarity for third-party publishers - reports the 11 November 2025 mandate that filtered clicks from pages without the Clarity tag.
- Microsoft launches AI analytics bridge for developer tools - documents the Clarity MCP server and its request, history and dimension limits.
- Microsoft Clarity expands Google Ads metrics - details the intent classification applied to sessions arriving from Google Ads campaigns.
- Microsoft Clarity enforces cookie consent requirements across Europe - explains the consent signal enforcement affecting session continuity in the EEA, UK and Switzerland.
- Microsoft adds Copilot to Clarity analytics - reports the 15 April 2025 arrival of natural language querying in the dashboard.
- Microsoft Clarity vs. Google Analytics 4: a detailed comparison - positions Clarity's frustration and error metrics against the GA4 reporting model.
Summary
Who: Microsoft's Clarity team operates the metric. It is read by developers, UX teams, conversion rate optimisation specialists, and media buyers auditing paid landing pages.
What: A count of uncaught JavaScript exceptions thrown in visitors' browsers, broken down by error message, filterable across the top 500 messages, and linked to the session recordings in which each error occurred.
When: Present since Clarity's public launch in late 2020, with message-level detail and the click errors subset added on 20 October 2022 and no material change since.
Where: The Clarity dashboard insights area, the Page filter group, the error clicks heatmap layer, and the diagnostic events section of the tracking payload sent to clarity.ms.
Why: Script failures suppress conversion without producing complaints or appearing in campaign reporting. Counting them beside session replay ties a technical fault to the specific moment a visitor abandoned a page.
Discussion