---
updatedAt: 2026-08-31T05:54:28.000Z
agentTools:
  projectIndex: https://developers.piwik.pro/llms.txt
---

# enableJSErrorTracking

The **enableJSErrorTracking()** method enables or disables the recording of JavaScript errors on your website. If enabled, it saves errors as custom events and includes information about the error type and page URL where the error occurred. You'll see them in Analytics > Reports > Custom events or if you create a custom report.

## Syntax

```js JavaScript
enableJSErrorTracking(unique)
```
```js Angular
enableJSErrorTracking(unique?): void
```
```js Gatsby
enableJSErrorTracking(unique?): void
```
```js Next.js
enableJSErrorTracking(unique?): void
```
```js Nuxt
enableJSErrorTracking(unique?): void
```
```js React
enableJSErrorTracking(unique?): void
```
```js VUE
enableJSErrorTracking(unique?): void
```

## Parameters

| Parameter | Type    | Description                                                                                                                                           | Required |
| :-------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
| unique    | boolean | When set to true, you'll only collect unique errors from a page. Duplicate errors from the same page view will be ignored. The default value is true. | No       |

## Examples

To enable the recording of JavaScript errors:

```js JavaScript
_paq.push(["enableJSErrorTracking"]);
```
```js Angular
enableJSErrorTracking()
```
```js Gatsby
enableJSErrorTracking()
```
```js Next.js
enableJSErrorTracking()
```
```js Nuxt
enableJSErrorTracking()
```
```js React
enableJSErrorTracking()
```
```js VUE
enableJSErrorTracking()
```

## Notes

* Some browsers may limit error details if the error occurs in a script loaded from a different origin. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event#notes)