Issue Tracking

Capture and monitor errors, exceptions, and console messages.

What's Captured

The issue tracker automatically captures various types of errors.

Uncaught Errors

JavaScript runtime errors via window.onerror

Promise Rejections

Unhandled promise rejections via unhandledrejection

Console Errors

Optional console.error and console.warn intercept

Manual Captures

Programmatically captured errors and messages with context

Installation

Add the error tracking script to your website.

index.html
<!-- Add after your main tracker script -->
<script
  defer
  src="https://cdn.himetrica.com/errors.js"
  data-api-key="YOUR_API_KEY"
></script>

Use standalone if you only want error tracking without the main analytics tracker.

Install with AI

Copy this prompt and paste it into ChatGPT, Claude, or any AI assistant to install Issue Tracking for you.

Add Himetrica Issue Tracking to my website. This is a client-side error tracking script — it must run in the browser (frontend only), not on the server.

1. If you already have the main Himetrica tracker installed, just add this script tag after it (it will share the API key automatically):
<script defer src="https://cdn.himetrica.com/errors.js"></script>

2. If using standalone (without the main tracker), add:
<script defer src="https://cdn.himetrica.com/errors.js" data-api-key="YOUR_API_KEY"></script>

3. To also capture console.error and console.warn, add the data-intercept-console attribute:
<script defer src="https://cdn.himetrica.com/errors.js" data-api-key="YOUR_API_KEY" data-intercept-console="true"></script>

4. For Next.js, add in app/layout.tsx:
import Script from 'next/script'
<Script src="https://cdn.himetrica.com/errors.js" strategy="afterInteractive" />

5. To manually capture errors in try/catch blocks:
himetrica.captureError(error, { context: 'checkout' })

6. To log messages at different severity levels:
himetrica.captureMessage('Payment started', 'info', { orderId: '123' })

The script automatically captures uncaught exceptions, unhandled promise rejections, and optionally console errors. All code must run in the browser — do not add these to any server-side or backend code.

Manual Error Capture

Use captureError to send caught exceptions with custom context.

javascript
// Manually capture an error with context
try {
  riskyOperation();
} catch (error) {
  himetrica.captureError(error, {
    userId: currentUser.id,
    action: 'checkout',
    cartValue: 99.99
  });
}

Capture Messages

Use captureMessage for logging important events that aren't necessarily errors.

javascript
// Log a message at different severity levels
himetrica.captureMessage('Payment processing started', 'info', {
  orderId: '12345'
});

himetrica.captureMessage('Retry attempt failed', 'warning', {
  attempt: 3,
  maxRetries: 5
});

himetrica.captureMessage('Critical validation failed', 'error', {
  field: 'email',
  value: 'invalid'
});

React Error Boundary

Integrate with React Error Boundaries for component-level error tracking.

jsx
// React Error Boundary integration
class ErrorBoundary extends React.Component {
  componentDidCatch(error, errorInfo) {
    himetrica.captureError(error, {
      componentStack: errorInfo.componentStack,
      source: 'react-error-boundary'
    });
  }

  render() {
    return this.props.children;
  }
}

Features

1

Deduplication

Same errors are deduplicated client-side to prevent spamming. Each unique error is only sent once every 5 minutes.

2

Rate Limiting

Maximum of 10 errors per minute per client to prevent error storms from affecting performance.

3

Stack Trace Normalization

Stack traces are cleaned and limited to 20 lines for readability while preserving debugging information.

4

Session Linking

Errors are automatically linked to visitors and sessions when used with the main tracker.

Data Captured

FieldDescription
typeerror, unhandledrejection, or console
messageThe error message
stackStack trace (if available)
sourceSource file URL
lineno / colnoLine and column number
severityerror, warning, or info
pathCurrent page URL path
userAgentBrowser user agent string
contextCustom context object (if provided)
Issue Tracking Docs | Himetrica