TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Error rate: formula, variants and how to set alert thresholds

Error rate is errors divided by a chosen total — pageviews, sessions, visitors or requests. The same week can read 0.9% or 3.75% depending on the denominator. Formula, a recomputable example, variants and the SRE threshold method.

Chen Yu Reviewed by Lucas Hayes Also called failure rate Last updated Nov 16, 2026 Glossary

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.

NumeratorDenominatorCalculationRate
450 JS error occurrences50,000 pageviews450 ÷ 50,0000.9%
300 affected sessions8,000 sessions300 ÷ 8,0003.75%
240 affected visitors6,000 visitors240 ÷ 6,0004%
1,200 failed API requests40,000 requests1,200 ÷ 40,0003%

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

VariantNumeratorDenominatorWhat counts as an error
Front-end JS, occurrence rate (TapCub's definition)JS error occurrencesPageviewsScript errors captured per pageview
Front-end JS, affected-pageview rate (Alibaba Cloud ARMS defines it this way)Pageviews with ≥1 errorTotal pageviewsA pageview counts once, however many errors it threw
API error rateFailed requestsTotal requestsDecide whether 4xx client errors count, or only 5xx server errors
App stabilityCrash-free sessions or usersTotal sessions or usersInverse framing: report the good share — see crash-free rate
Service SLIBad eventsTotal valid eventsDefined 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 error event fires for synchronous script errors and resource load failures; unhandled Promise rejections fire a separate unhandledrejection event. A tool listening only to error misses 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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:

  1. Measure a 30-day baseline with a named denominator, including normal spikes from deploys and campaigns.
  2. 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.
  3. 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.
  4. 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:

  1. 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.
  2. 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 TypeError stands 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.
  3. 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.
  4. Alert on the built-in metric. In All-platform analytics › Operations › Monitors, monitor the built-in error_rate (or errors) 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

Was this explanation clear?

We use your answers to fix and expand this page.

Chen Yu

Technical Engineer

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

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

How do you calculate error rate?

Divide the error count by a named denominator and multiply by 100: error rate = errors ÷ denominator × 100. In the sample week, 450 JavaScript errors ÷ 50,000 pageviews = 0.9%. The same errors read differently per session (300 ÷ 8,000 = 3.75%) or per failed request (1,200 ÷ 40,000 = 3%), so always state the denominator.

What is an acceptable error rate?

There is no sourced universal number; tolerance depends on what the errors break. Measure a 30-day baseline with a named denominator, set an SLO your baseline can meet, and treat 1 − SLO as the error budget, as the Google SRE Book describes. Alert when the budget burns too fast, not on any single spike.

Is error rate the same as availability?

They are complements over the same denominator, not the same metric. The SRE Book defines availability-style SLIs as good events ÷ valid events; error rate is bad events ÷ total events. A 99% error-free SLI implies a 1% error rate on that same basis — but a per-pageview JS error rate says nothing about API availability.

Why is my error rate low but users still complain?

Because occurrences spread unevenly. In the sample week the per-pageview rate is 0.9%, yet 3.75% of sessions hit an error, and 450 occurrences ÷ 240 affected visitors ≈ 1.9 errors each. A few people on the broken page see it repeatedly. Check affected sessions or visitors, not just occurrences.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics