Error Analysis

Contentsquare allows you to collect similar error types as in a web project: JS errors, API errors and Custom errors.

WebView error tracking prerequisites

Section titled WebView error tracking prerequisites

In order to collect WebView errors, Error Analysis needs to be setup on the native side. See the dedicated documentation: iOS and Android.

How WebView error tracking works

Section titled How WebView error tracking works

Similar to analytics events and Session Replay, once set in WebView mode, the web tracking tag will collect errors and pass them to the native SDK, that will then send them to the dedicated Apps project.

Each error type has a collection setting that needs to be enabled by your Contentsquare Implementation manager.

Similar to web context, JS errors are collected out of the box if the collection is enabled in the web project associated to the tracking tag loaded in the page.

Find more information on how Contentsquare handles JS errors in our JavaScript errors Help Center article.

Similar to web context, API errors are collected out of the box if the collection is enabled in the web project associated to the tracking tag loaded in the page.

Find more information on how Contentsquare handles API errors in our Analyzing API errors Help Center article.

Removing Personal Data in request URL path

Section titled Removing Personal Data in request URL path

By default, the API errors feature collects the URL path of the failed API requests. To prevent the collection of Personal Data in the URL path, you can rewrite the request URL path. Follow the web documentation dedicated section: Removing Personal Data in the API errors.

API errors troubleshooting details enables you to collect more information about API errors so you can troubleshoot errors faster.

With this feature you will be able to see three types of additional API error details in the Event Stream of Session Replay.

  • The HTTP headers of the request and the response.
  • The body (the data sent by the request or received in the response).
  • The query parameters for the URL of the requested endpoint.

Where to configure API troubleshooting details

Section titled Where to configure API troubleshooting details

Similar to the collection settings, the Tag loaded in WebView mode will apply the API troubleshooting details rules inherited from the configuration defined in the associated web project.

See API Troubleshooting Details for more details.

Follow the web documentation section to implement custom error collection: Sending custom errors.

Find more information on how Contentsquare handles Custom errors in our Custom errors Help Center article.

Validate WebViews error collection

Section titled Validate WebViews error collection

If in-app features are enabled, you will be able to see the WebView errors collected as events in the SDK Logs and Log Visualizer. See iOS Debugging and Logging and Android Debugging and Logging sections for more details about debugging and logging.

Check out SDK logs to validate WebView errors are properly collected:

CSLIB: API Error (from WebView) - GET 401 https://api.client.com
CSLIB: JS Error (from WebView) - <Error name> - <Message>
CSLIB: Custom Error (from WebView): <Message> - Attributes: [key:value, key:value...]

WebView errors in Log Visualizer

Section titled WebView errors in Log Visualizer

Use Log Visualizer from the CS Apps project to validate WebView errors are properly collected and received.