Configuring Application Error Messages

Application error messages are collected using the DXA sendApplicationError JavaScript API endpoint. This can be called directly on the page when a message is shown, using one of the following methods.

To provide a single error message to DXA, simply pass the error message text (this can be hard-coded or retrieved from a data layer JavaScript variable), for example:
<script type="text/javascript">
    decibelInsight('sendApplicationError', dataLayer.errorMessage);
</script>
Alternatively, a CSS selector can be provided that matches all HTML elements on the page that may contain an application error message. In this case, zero or more error messages that match the provided CSS selector will be tracked by DXA.
<script type="text/javascript">
    decibelInsight('sendApplicationError', '.error', true);
</script>
Once implemented, you will be able to use the application error reporting feature, along with being able to use application errors as segment filters.