Skip to main content
Error tracking records the JavaScript errors your visitors hit and groups them by message in the Errors report, so you can see which errors are most common, how many sessions they affect, and the exact stack trace behind each one. It’s off by default — you turn it on with one attribute on your tracking script.

How do I turn on error tracking?

Add data-track-errors to your tracking snippet. It’s off by default because most sites want to opt in deliberately.
Once enabled, tinyanalytics automatically captures uncaught exceptions (window.onerror) and unhandled promise rejections — the two ways errors normally escape your code — and sends each as an error event.

What does tinyanalytics record for each error?

Each captured error records the fields you need to reproduce it, all trimmed to safe limits: Errors are captured with the same page context as any other event — the page, browser, OS, device, and country — so you can see where and for whom each error happens.
tinyanalytics filters out noise automatically. Benign ResizeObserver loop warnings are dropped, and errors from cross-origin third-party scripts are ignored — only errors from your own site are recorded. Identical errors from the same visitor are de-duplicated within a 60-second window, so one broken loop doesn’t flood your report.

How do I track an error manually?

To record an error you’ve caught yourself — in a try/catch, an error boundary, or a rejected request — call trackError:
The second argument is optional metadata: any extra properties you want stored alongside the error, the same way custom event properties work. Manual tracking works whenever the script is loaded, and pairs well with automatic capture for the errors your code already handles gracefully.

How do I read the Errors report?

The Errors report lists one row per distinct error message, most frequent first. For each error you see: Click an error to open its details and read every individual occurrence: the exact time, the visitor’s page, browser, OS, device, and country, the person (linked to their user profile), the full message, and the stack trace with a clickable file:line:column reference. The report honors your dashboard’s date range, filters, and segments — so you can narrow to errors on one page, one browser, or one release.

Common workflows

  • Triage by impact. Sort by sessions, not occurrences, to fix the errors hurting the most people first.
  • Confirm a fix. Watch an error’s trend sparkline drop to zero after you deploy.
  • Scope a regression. Filter to a browser or country to see whether an error is universal or environment-specific.

Frequently asked questions

Error tracking is off by default. Add the data-track-errors attribute to your tracking snippet and re-deploy, and tinyanalytics starts capturing uncaught exceptions and unhandled promise rejections as error events.
Automatic capture records the errors that escape your code — uncaught exceptions (window.onerror) and unhandled promise rejections — once data-track-errors is on. Manual tracking with window.tinyanalytics.trackError(err, { ... }) records errors you already catch yourself in a try/catch or error boundary, with optional metadata. Use both together.
No. Errors from cross-origin third-party scripts are ignored, so only errors from your own site are recorded. tinyanalytics also drops benign ResizeObserver loop warnings, and de-duplicates identical errors from the same visitor within a 60-second window.
Read the Sessions column in the tinyanalytics Errors report — it counts the distinct sessions that hit the error, which is your blast radius. Sort by sessions rather than occurrences to fix the errors hurting the most people first.

Configure the tracking script

The data-track-errors attribute and every other option.

Track custom events

Send named events and properties yourself.

Performance

Core Web Vitals — the other health signal.

Tracking API

The error event type on the ingestion endpoint.