Error Tracking Setup

Gurulu captures unhandled JavaScript errors automatically when the tracker is installed. No extra configuration is needed for basic error tracking.

What gets captured

  • Unhandled exceptions (window.onerror)
  • Unhandled promise rejections
  • Console errors (opt-in)
  • Network failures (fetch/XHR errors)

Error grouping

Errors are grouped by message and stack trace fingerprint. Each group shows occurrence count, affected users, first/last seen timestamps, and the browser/device breakdown.

Configuration

Error tracking is enabled by default. To customize behavior:

import { init } from '@gurulu/tracker';

init({
  siteId: 'YOUR_SITE_ID',
  token: 'YOUR_TOKEN',
  trackErrors: true,        // default: true
  trackConsoleErrors: false, // capture console.error calls
  errorSampleRate: 1.0,     // 0.0 to 1.0
});

Manual error reporting

import { captureError } from '@gurulu/tracker';

try {
  riskyOperation();
} catch (err) {
  captureError(err, { context: 'checkout-flow' });
}

Alerts

Set up error spike alerts from the dashboard or CLI. Gurulu can notify you via webhook, Slack, or email when error rates exceed a threshold.

For readable stack traces in production, see Source Maps.