data-errors to the script tag, and every uncaught error and unhandled promise rejection is sent with its message, source file, line, column and stack. The Errors screen groups the same error from many visitors into one row you can resolve or ignore.
Turn on error tracking
Add thedata-errors attribute to your existing script tag:
data-errors="". In Settings, Tracking code, the JavaScript errors switch adds it to the snippet for your platform.
To confirm it works, deploy the change, open your live site and run this in the browser console:
CrispStats error test. Resolve or ignore it when you are done.
An error thrown straight from the console prompt is not always reported as uncaught by the browser. Wrapping it in
setTimeout makes it a normal uncaught error. If you excluded your own browser with localStorage.crispstats_ignore, the script sends nothing from it, so run the test in a private window.What is captured
The script listens for uncaught errors and unhandled promise rejections and sends one event of typeerror for each, with these fields:
Each event also carries what every CrispStats event carries: the page URL, referrer, screen width, browser language and timezone.
Limits in the browser
- Once per distinct error. An error with the same message, source file and line is sent once per page load, however often it repeats.
- Ten per page load. After ten errors, the script sends no more until the next page load.
- Cross-origin errors are skipped. For a script loaded from another origin without CORS, the browser reveals only
Script error.with no details. Those are not sent, because there is nothing to act on. - Failed resource loads are skipped. An image or script that fails to load carries no message and is not reported.
How errors are grouped
CrispStats groups errors by their message (the first 500 characters) and source file. Every error with the same message from the same file is one group, whatever page or browser it happened on. The group’s type, such asTypeError or ReferenceError, is read from the start of the message; anything else shows as Error.
Read the Errors screen
The date range and filters at the top of the dashboard apply to the whole screen.Summary
- Occurrences: how many times an error was thrown in the range.
- Affected visitors: how many visitors hit at least one error.
- Error-free sessions: the share of visits where nothing broke.
data-errors added. If the attribute is already there, nobody hit an error in that period.
Error groups
The list shows up to 50 groups with the most occurrences in the range. Each row shows the type and message, the source file, when it was first seen, a trend sparkline, occurrences, affected visitors, when it was last seen and its status.- Status tabs: Open (the default), Resolved, Ignored and All, each with a count.
- Search: matches the error type, the message and the source file.
- Sort: by Last seen (the default), Occurrences or Affected visitors.
Error details
Select a row to open the group’s details:- The full type and message, and the source file.
- Occurrences, Affected visitors, First seen and Last seen.
- Trend over the selected period.
- Sample stack trace: the most recent stack captured for the group. A group can have none: scripts from another origin only share their stack when they are loaded with CORS, and a promise rejected with something other than an
Errorcarries no stack. - Top pages and Browsers: the five pages and five browsers with the most occurrences. Select one to filter the dashboard by it.
Resolve, ignore or reopen an error
Owners, admins and members of the site can change an error’s status from the details panel:
Ignored errors also do not trigger New error alerts.
Get alerted about errors
Two alert rules watch errors: New error tells you when an error appears that has not been seen before, and Error spike tells you when errors pass a count within a window. See alert rule types.Next steps
Get alerted
Send new errors and error spikes to email, Slack, Discord, Telegram or a webhook.
Monitor web vitals
Measure how fast pages load and respond for real visitors.
Content Security Policy
Allow the script and collector if your site sends a CSP header.