---
title: Error analysis - Capacitor
description: How to use Contentsquare Error Analysis in your Capacitor apps
lastUpdated: 09 October 2025
source_url:
  html: https://docs.contentsquare.com/en/capacitor/error-analysis/
  md: https://docs.contentsquare.com/en/capacitor/error-analysis/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.

## Get Started

### Start the SDK

You do not need to do anything to start the errors collection, it will start itself with Contentsquare SDK.

## Sample App

For best implementation practices of our library, explore the [Contentsquare for Capacitor sample app ↗](https://github.com/ContentSquare/capacitor-sample-app).

## JS Errors

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

Find more information on how Contentsquare handles JS errors in our [JavaScript errors Help Center article ↗](https://support.contentsquare.com/hc/en-us/articles/37271807561873).

## API Errors

### Automatic network inspection

API Errors automatically collects failed network requests.

### Debugging and Logging

If in-app features are enabled, a info log should appear with the details of the event (see [Capacitor Debugging and Logging](https://docs.contentsquare.com/en/capacitor/#check-the-logs) section):

```plaintext
CSLIB ℹ️ Info: API Error (from Webview) - GET 401 https://api.client.com
```

### How API Errors works

#### Initialization

The way our SDK works is by auto-starting with the application launch and automatically collects failed network requests.

#### Configuration

Once started, our SDK fetches its config from our servers. It will start collecting data from network events if the API Errors setting is enabled in the config (this is handled by the Contentsquare team).

#### Tracking

The SDK monitors only the API Errors with response code above 400, and generates analytics data. These events are then locally stored, and eventually sent to our servers in batches.

Warning

To make sure API Errors occurring at app launch are correctly tracked, the session has to be tracked (included in tracked users and not opted-out) and a first screenview event has to be sent before.

#### Sending data

For each network error, a new event will be sent in analytics and Session Replay data.

### API Troubleshooting Details

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 of the request endpoint (of the URL of the information you request for).

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.

See [API Troubleshooting Details ↗](https://support.contentsquare.com/hc/en-us/articles/37271885035537) for more details.

### Collected data points

Only network calls in error (response code above 400) will be collected.\
Here the exhaustive list of data collected:

* URL (without query strings)
* HTTP method
* Response code
* Timestamp of the request
* Timestamp of the response
* HTTP headers of the request
* HTTP headers of the response
* HTTP body of the request
* HTTP body of the response
* Query parameters of the request endpoint

### Known limitations and recommendations

#### Conflict with Firebase Performance Monitoring

* Android

  Contentsquare Error Analysis is not compatible with Firebase Performance Monitoring auto-collection. Only one of the two will log events, and usually, the events will be automatically logged by the Contentsquare Error Analysis. To log events to Firebase Performance Monitoring, we suggest [logging it manually ↗](https://rnfirebase.io/perf/usage#http-request-tracing).

* iOS

  Contentsquare Error Analysis is compatible with Firebase Performance auto-collection, but the HTTP body from the response won't be collected by the Error Analysis SDK. Contentsquare Error Analysis may not be compatible with other network auto-collection tools.
