Sending custom errors
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
Section titled Collecting custom errorsTo collect custom error messages, use the trackError
command:
where:
<MESSAGE>
is astring
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 can be up to 30 characters.
Examples
Section titled ExamplesSend a custom error for a failing request, typed as an error from the system:
Send a custom error for incorrect user input with multiple attributes (type, severity, language):
Verifying the sending of custom errors
Section titled Verifying the sending of custom errorsUse the Contentsquare Tracking Setup Assistant Chrome Extension ↗ to track custom errors that are sent.