Skip to main content

Error Tracking

This tracker plugin provides two ways of tracking exceptions: manual tracking of handled exceptions using trackError and automatic tracking of unhandled exceptions using enableErrorTracking.

Installation

  • npm install @snowplow/browser-plugin-error-tracking
  • yarn add @snowplow/browser-plugin-error-tracking
  • pnpm add @snowplow/browser-plugin-error-tracking

Initialization

import { newTracker, trackPageView } from '@snowplow/browser-tracker';
import { ErrorTrackingPlugin, enableErrorTracking } from '@snowplow/browser-plugin-error-tracking';

newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ ErrorTrackingPlugin() ],
});

enableErrorTracking();

Functions

trackErrorDocumentation
enableErrorTrackingDocumentation

Context

This plugin does not add any additional data to context of an event.

Was this page helpful?