# Error Tracking
> Documentation for tracking Error Tracking with the web tracker.
> Source: https://docs.snowplow.io/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/plugins/error-tracking/
> Documentation index: https://docs.snowplow.io/llms.txt
> Status: Previous version
> Current version: https://docs.snowplow.io/docs/sources/web-trackers/

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

```javascript
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

|                       |                                                                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `trackError`          | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#trackError)          |
| `enableErrorTracking` | [Documentation](/docs/sources/web-trackers/previous-versions/browser-tracker-v3-reference/tracking-events/#enableErrorTracking) |

### Context

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