Quick answer
Error rate is the share of errors within a chosen total over a time window: errors ÷ denominator × 100. The denominator — pageviews, sessions, visitors or requests — decides what the number means, so name it before comparing rates or setting alerts.
Formula: error rate = errors ÷ pageviews (TapCub definition); variants: affected pageviews ÷ pageviews, failed requests ÷ total requests, 1 − crash-free sessions ÷ sessions, bad events ÷ valid events (SLI)
What is error rate?
In monitoring, error rate is the share of errors within a chosen total over a time window: errors ÷ denominator × 100. The catch is the denominator. The same week can read as 0.9% per pageview, 3.75% of sessions affected, or 3% of API requests failed — all correct, all different metrics. "Error rate" alone does not say what is measured. Name the denominator first; then compare dashboards, set targets and configure alerts. Denominator before threshold is the point of this page.
What error rate actually measures
The Google SRE Book defines a service level indicator (SLI) as a ratio: good events ÷ total valid events. Error rate is its mirror image — bad events ÷ total events — so two decisions come before the number means anything:
- What counts as an error (numerator). Occurrences? Sessions that hit at least one error? Failed HTTP requests? Different counts, not interchangeable: one visitor can trigger dozens of occurrences of the same bug.
- What it is divided by (denominator). Pageviews, sessions, visitors or requests answer different questions: how noisy the site is, how many visits break, how many people are affected, how reliable the API is.
Naming rule: never write a bare "error rate" in a report or alert — write "error rate (occurrences per pageview)" or "affected-session rate". If a dashboard shows an error rate without naming the denominator, ask before comparing: two tools reporting "2%" may measure entirely different things.
Error rate formula and a worked example
The general formula:
error rate = errors ÷ denominator × 100%
TapCub's Errors report fixes the definition: error rate = script errors ÷ pageviews. Other tools fix other denominators — hence the variant table below.
Sample data: one week with 50,000 pageviews, 8,000 sessions, 6,000 visitors and 40,000 API requests. Monitoring recorded 450 JavaScript error occurrences, affecting 300 sessions and 240 visitors; 1,200 API requests failed.
| Numerator | Denominator | Calculation | Rate |
|---|---|---|---|
| 450 JS error occurrences | 50,000 pageviews | 450 ÷ 50,000 | 0.9% |
| 300 affected sessions | 8,000 sessions | 300 ÷ 8,000 | 3.75% |
| 240 affected visitors | 6,000 visitors | 240 ÷ 6,000 | 4% |
| 1,200 failed API requests | 40,000 requests | 1,200 ÷ 40,000 | 3% |
Same week, four "error rates" from 0.9% to 4%. The per-pageview number looks reassuring; the per-session number says nearly 1 in 26 visits hit an error. Both are true — they answer different questions.
The denominator alone moves the number tenfold: the same 50 errors ÷ 10,000 pageviews = 0.5%, but ÷ 1,000 pageviews = 5%. Identical bugs on a quiet page and a busy page report wildly different rates. Errors also cluster: 450 occurrences ÷ 240 affected visitors ≈ 1.9 errors per affected visitor, so occurrence counts overstate how widespread a problem is while understating how hard it hits the people who see it.
Which error rate variant fits your context
| Variant | Numerator | Denominator | What counts as an error |
|---|---|---|---|
| Front-end JS, occurrence rate (TapCub's definition) | JS error occurrences | Pageviews | Script errors captured per pageview |
| Front-end JS, affected-pageview rate (Alibaba Cloud ARMS defines it this way) | Pageviews with ≥1 error | Total pageviews | A pageview counts once, however many errors it threw |
| API error rate | Failed requests | Total requests | Decide whether 4xx client errors count, or only 5xx server errors |
| App stability | Crash-free sessions or users | Total sessions or users | Inverse framing: report the good share — see crash-free rate |
| Service SLI | Bad events | Total valid events | Defined per service in the SRE Book (e.g. failed vs successful RPCs) |
Two front-end caveats before comparing numbers across tools:
- Coverage differs. Per MDN, the
errorevent fires for synchronous script errors and resource load failures; unhandled Promise rejections fire a separateunhandledrejectionevent. A tool listening only toerrormisses every rejected Promise, so its "JavaScript error rate" is structurally lower. - Occurrences vs affected units differ. 450 occurrences on 300 error-hit pageviews: 0.9% of 50,000 pageviews by occurrence, 0.6% by affected pageview. Neither is wrong; comparing one tool's occurrence rate against another's affected rate is.
Common mistakes that distort error rate
- Mixing occurrences with affected units. If the numerator counts occurrences but you describe the result as "share of users affected", stop — occurrences repeat per person. Use affected sessions or visitors when the claim is about people.
- Averaging rates across pages or services. Averaging a 0.5% page and a 5% page into "2.75%" misleads whenever traffic differs — the busy page dominates the real rate. Sum the numerators, sum the denominators, divide once.
- Counting every 4xx as a failure. If expected client errors (a 404 on a mistyped URL, a 401 before login) inflate the API error rate, decide up front which statuses count and document it; MDN's status reference separates client from server errors for this reason. A 500 error, by contrast, is always the server's failure and belongs in the count.
- Alerting on small denominators. A page serving 10 requests an hour reads one failure as 10%. Add a minimum count — rate above threshold and errors ≥ 50 — so tiny samples cannot page anyone.
- Computing rates from sampled data. Sampled errors over unsampled pageviews (or vice versa) gives a wrong rate. Compute both sides from the same dataset, or scale both consistently.
How to set an error rate alert threshold
No sourced universal "acceptable error rate" exists — a checkout API and a marketing blog have different tolerances. Use the SRE method instead of copying a benchmark:
- Measure a 30-day baseline with a named denominator, including normal spikes from deploys and campaigns.
- Set an SLO, derive the error budget. The SRE Book defines the budget as 1 − SLO. With a 0.9% baseline and an SLO of "at least 99% of pageviews error-free", the budget is 1% — barely above normal, so pick targets your baseline can meet.
- Alert on budget burn, not raw spikes. The SRE Workbook's alerting chapter recommends burn-rate alerts with multiple time windows to filter noise. Starter rule: alert when the rate stays above 2% (about twice the sample baseline) and errors ≥ 50 in the window — sample thresholds, tune to your baseline.
- Dry-run before enabling. Replay the rule over the past 30 days and count firings; if it fires weekly on normal traffic, loosen it.
For the wider setup see web performance monitoring; for adaptive thresholds see anomaly detection and setting up traffic alerts.
Error rate and conversion: before and after a fix
Sample data, continuing the week above: of the 450 occurrences, one checkout-page TypeError group accounts for 300. It exclusively affected 210 sessions; the other 90 affected sessions also hit different errors, so they stay affected after this fix.
- Before: 450 ÷ 50,000 = 0.9% per pageview; 300 ÷ 8,000 = 3.75% of sessions affected.
- After the fix: occurrences drop by 300 to 150 ÷ 50,000 = 0.3%; affected sessions drop by 210 to 90 ÷ 8,000 = 1.125%.
- Checkout goal, same sessions basis: the week before converted 256 ÷ 8,000 = 3.2%; the week after, 304 ÷ 8,000 = 3.8%.
Conversion moved with the fix, but this is correlation, not proof — seasonality, campaigns and traffic mix also changed between weeks. Supporting evidence, not an A/B result. The decision rule that survives the caveat: if occurrences concentrate on pages in your conversion path, fix those groups before chasing the same count on low-stakes pages.
How to check error rate in TapCub
Take the sample week into TapCub: the card says 0.9%, and you want to know who is affected and whether to alert. Four steps, each with its denominator named:
- Read the card with its denominator. Open Monitoring › Errors. The cards show error count, error rate (errors ÷ pageviews), affected visitors and affected sessions; the sample week reads 450 errors, 0.9%, 240 visitors and 300 sessions. The rate is per pageview, not per request or session. Script errors need
data-errors="true"in the snippet, which the default snippet includes; if JavaScript errors was switched off, an empty page does not mean nothing broke. Details: find JavaScript errors. - Find the group doing the damage. Each error group shows its count, the sessions involved and when it was last seen, so the 300-occurrence checkout
TypeErrorstands out. Expand it for each occurrence's time, page, place, device and session, and open a session to see what the visitor did before it broke. - Track the fix with statuses. Groups are Active, Resolved or Ignored. Mark the checkout group resolved when the fix ships to take it out of the active list, then read the cards for the following week: 0.9% → 0.3% per pageview, and 3.75% → 1.125% affected sessions in the sample.
- Alert on the built-in metric. In All-platform analytics › Operations › Monitors, monitor the built-in
error_rate(orerrors) on an hourly, daily, weekly or monthly grain. Dry-run first to see how often it would have fired over the past 30 days. By default the same rule does not repeat for about 60 minutes and pauses after 3 hits in a row; it only notifies and never acts for you. Set the threshold with the baseline method above.
Boundaries: the Errors page fixes its denominator to pageviews. For a session-based view of your conversion path, All-platform analytics › Business › Journey maps shows, for each stage defined by page patterns, the share of stage sessions with error events next to the drop-off, so the affected-session question has a home too. API failure rates per request are not computed by TapCub; take them from your server or APM. TapCub has no Apdex score (see Apdex), does not run A/B tests, and monitors do not roll back releases.
See also: What is a JavaScript error? Types, impact and how to triage them.
See also: What is user error? Meaning, causes and how to tell it from bad design.
Sources
- Google, SRE Book, ch. 4: Service Level Objectives — SLI ratios, SLOs, error budgets.
- Google, SRE Workbook, ch. 5: Alerting on SLOs — burn-rate alerting and low-traffic handling.
- MDN, Window: error event — what the
errorevent covers. - MDN, Window: unhandledrejection event — Promise rejections bypass
error. - MDN, HTTP response status codes — 4xx vs 5xx definitions.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Technical Engineer
Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.