---
title: Sending custom errors - Web
description: Send custom errors from your web page
lastUpdated: 12 December 2025
source_url:
  html: https://docs.contentsquare.com/en/web/sending-custom-errors/
  md: https://docs.contentsquare.com/en/web/sending-custom-errors/index.md
---

Note

This feature is part of [Experience Monitoring ↗](https://contentsquare.com/platform/experience-monitoring/), which is only available on Enterprise plans or as an add-on to Pro plans. Contact your Customer Success Manager or [sales ↗](https://contentsquare.com/request-a-demo/) to learn more.

With the Custom Errors feature, collect any text displayed on the user screen as a result of a specific action such as:

* Filling a form,
* Loading a product list,
* Log in to a website,
* A request failing to get the remaining stock quantity on a product page.

Custom errors can be located inside alert banners, pop-up windows, or inline in a form.

## Collecting custom errors

Note

You can send a maximum of 20 custom errors per page.

[Tag Configurator Template: Custom Error ](https://support.contentsquare.com/hc/en-us/articles/37271813052817-CSTC-Template-Custom-Error)Use the Tag Configurator to implement custom error tracking through a visual interface.

To collect custom error messages, use the `trackError` command:

```html
<script type="text/javascript">
   window._uxa = window._uxa || [];
   window._uxa.push([
    "trackError",
    "<MESSAGE>",
    {key: value, key: value, ...}
  ])
</script>
```

where:

* `<MESSAGE>` is a `string` which contains the text displayed to end-users (max. 300 characters).
* (optional) - A JavaScript object with **up to 5 key/value pairs** to categorize the errors. Both the key and value should be `string` and can be up to 30 characters.

### Examples

Send a custom error for a failing request, typed as an error from the system:

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(["trackError", "Could not get stock quantity", { type: "systemError" }]);
</script>
```

Send a custom error for incorrect user input with multiple attributes (type, severity, language):

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push([
    "trackError",
    "140000 is not a valid postal code",
    {
      type: "formValidation",
      severity: "minor",
      lang: "english"
    },
  ]);
</script>
```

## Verifying the sending of custom errors

Use the [Contentsquare Tracking Setup Assistant Chrome Extension ↗](https://chrome.google.com/webstore/detail/contentsquare-tracking-se/pfldcnnaiaiaogmpfdjjpdkpnigplfca) to track custom errors that are sent.

![](https://docs.contentsquare.com/_astro/ctsa-custom-erorrs.BfztI1e8_14pHYm.webp)
