# Errors that block payment

> The JavaScript errors visitors hit on each page and funnel step, and how many of those visitors left without paying.

Source: https://metricraven.com/docs/javascript-errors  
Markdown: https://metricraven.com/docs/javascript-errors.md  
Section: Features

Turn on JavaScript errors and MetricRaven records the errors your own scripts throw in visitors' browsers. Each page and funnel step then shows how many visitors hit an error there and didn't pay, so a broken checkout button shows up next to the revenue it costs. This isn't an error-monitoring tool: there are no alerts, releases or source maps.

## What you see

| Where | What |
| --- | --- |
| Pages → view all | An **Errors** column: visitors who hit a JavaScript error on the page and didn't pay in the period. Hover a number for visitors, non-payers and errors; click it for the page's errors. Shown from 640 px wide. |
| Conversions → Funnel | A warning sign and a count on a drop-off badge: visitors who left before that step and hit an error. The step's hover card adds **Hit an error** (“12 of 40”) and the most common error. Click the count for the list. |
| Error list | Errors grouped by name and message, most non-paying visitors first, with how often each happened, when it was last seen and a small chart. Open one for the latest stack trace, browsers, pages and the people who hit it (team members only); a person opens their timeline. |
| Visitor timeline | A line such as Hit an error on /pricing, with the error name and message. |

“Didn't pay” means no payment in the selected period, the same paying visitors as the **Purchase rate** figure.

## Turn it on

1. **Open Settings → Tracking & install → Advanced → JavaScript errors**

   It is off until you turn it on. Admins and the owner can change it.

2. **Switch on JavaScript errors**

   It saves at once. Pages pick it up on their next load; keep the standard [tracking script](https://metricraven.com/docs/install).

Error reports aren't billed: they don't count toward your monthly events. The [Reports API](https://metricraven.com/docs/reports-api), [MCP](https://metricraven.com/docs/mcp-tools) (`get_errors`) and [CLI](https://metricraven.com/docs/cli-commands) (`analytics errors`) read them too.

## How it works

### What is recorded

- Uncaught errors and unhandled promise rejections, from the moment the script loads (also those during the first page load). The capture code is a small add-on, `/js/addons/errors.js` (about 1 KB gzipped), loaded only when the setting is on; until it runs, the script holds up to 20 errors and hands them over.
- Only your own scripts: the file (or, for a rejection, the first file in the stack) must be on the page's own origin. Scripts on other domains, including CDNs, report only “Script error.”, which is dropped.
- Dropped as noise: `Script error.`, `ResizeObserver loop` messages and anything from a browser extension (`chrome-extension://`, `moz-extension://`, `safari-web-extension://`).
- Each error is sent once per page and page load, with its name, message, stack, file, line and column. It never starts or extends a visit.

### Grouping

Errors with the same name and message are one group. Numbers, long hexadecimal IDs and quoted text in the message are ignored when grouping, so `Order 123 not found` and `Order 456 not found` are one group.

### Funnel drop-offs

A step's marker counts the visitors who reached the step before it, didn't reach it, and hit an error in the period. When the step they reached is a page step, only errors on those pages count. Above 10,000 visitors who left, the first 10,000 are checked and the hover card says “(sample)”.

## Privacy

The script removes, and the server removes again, from the name, message, stack and file:

- query strings and #fragments of URLs (line and column numbers stay);
- anything that looks like an email address, replaced with `[email]`;
- runs of 24 or more letters, digits and `_-+=` that contain a digit (tokens, keys, session IDs), replaced with `[token]`;
- runs of 9 or more digits (phone and card numbers), replaced with `[number]`.

Messages are cut to 500 characters and stacks to 2000. Nothing is stored in the browser. Error reports are deleted after 90 days, and with the person when you [delete their data](https://metricraven.com/docs/delete-person-data). Shared dashboards show counts only, never error text.

> **Warning:** Don't put personal data in error messages: the scrub catches common shapes, not all of them.

## Limits

- 10 errors per page and 25 per page load; the rest are dropped (the [debug mode](https://metricraven.com/docs/install#attributes) says so).
- 20,000 errors per website per day.
- No source maps: minified stacks stay minified.
- Errors thrown before the tracking script loads are missed.
- Failed images, scripts and network requests aren't errors here, and neither is `console.error`.

## Troubleshooting

### Nothing shows up

Check that the setting is on and the page has loaded since. Errors from scripts on another domain arrive as “Script error.” and are dropped: serve those scripts from your own domain, or load them with `crossorigin="anonymous"` and have their server send `Access-Control-Allow-Origin`.

### Content Security Policy

Error reports go to the same collect endpoint as pageviews, so no new directive is needed. See [Content Security Policy](https://metricraven.com/docs/content-security-policy).
