---
title: Getting Started - Android (classic)
description: Integrate the Contentsquare SDK into your Android app in minutes (installation, user consent, screen tracking, and testing)
lastUpdated: 03 June 2026
source_url:
html: https://docs.contentsquare.com/en/android/
md: https://docs.contentsquare.com/en/android/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
The latest CSQ SDK is here! Learn how to [upgrade your app](https://docs.contentsquare.com/en/csq-sdk-android/experience-analytics/upgrade-from-cs-sdk/).
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
## Install the SDK
Our Android SDK is shipped as an Android library (AAR) which you need to add as a dependency to your Gradle file.
See [Compatibility](compatibility/) for more information.
### Include the SDK
For distribution of our API we use **Maven Central Repository** which is supported by the Android build system by default. To add our SDK (or library), add the following line to your application's dependency list.
* Groovy
**build.gradle**
```groovy
implementation "com.contentsquare.android:library:4.52.1"
```
* Kotlin
**build.gradle.kts**
```kotlin
implementation("com.contentsquare.android:library:4.52.1")
```
The SDK autostarts when your application launches, requiring no manual initialization.
If you are using an older Kotlin version, see [Compatibility](compatibility/).
### Validate SDK integration
Start your application, and check logs for this output:
```text
CSLIB: Contentsquare SDK 4.52.1 starting in app: com.example.testapp
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Android Studio, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing logs in Android Studio
To view SDK logs:
1. Plug your Android phone into your computer (or use an emulator)
2. Open Android Studio and start your app
3. Open the `Logcat` view and select your phone or emulator
4. Filter logs by `CSLIB`

### Enable in-app features
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To enable in-app features within your app, make sure your app is launched in the background. To do so, start it and press the Android home button. Then, follow the appropriate method described as follows.
If access is blocked by the Android OS, you may need to allow the restricted settings first. To do this, go to your device settings, navigate to **Apps**, tap on your app, open the **More** menu (three dots), and then tap on **Allow restricted settings**.
#### On a device: scan the QR code
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

Note
On Android, some devices have a built-in QR code reader feature in the default camera app. If that is not the case for you, use the [QR & Barcode Reader by TeaCapps ↗](https://play.google.com/store/apps/details?id=com.teacapps.barcodescanner\&hl=en\&gl=US).
#### On an emulator: use the ADB command
If you are using an emulator, use the ADB command to enable in-app features.
In Contentsquare, select the Mobile icon in the menu top bar then select your application ID, and "Copy this ADB command".

The following command is copied to the clipboard:
```shell
adb shell "am start -W -a android.intent.action.VIEW -d cs-{{packageName}}://contentsquare.com?activationKey={{uniqueActivationKey}}\&userId={{userId}}"
```
To run the ADB command:
1. Plug your Android phone into your Computer (or use an emulator).
2. Make sure that only one phone or emulator is connected or running.
3. Start Android Studio.
4. Open the Terminal view.
5. Paste the ADB command into the Terminal and press `Enter`.
6. Switch to your phone or emulator and follow the steps on the screen.
### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.

## Get user consent
Contentsquare collects usage data from your app users. To start tracking, you need your users' consent for being tracked.
### User opt-in
The SDK treats users as **opted-out by default.**
To start tracking, forward user consent with `optIn()`. Calling this method generates a user ID and initiates tracking.
Handle user consent by implementing a UI for privacy preferences. Assuming you have an opt-in screen with a button to give consent, the code could look like this:
* Java
```java
import com.contentsquare.android.Contentsquare;
Button optinButton = ...
optinButton.setOnClickListener(view -> {
Contentsquare.optIn();
// Then finish initialization and move to the next screen...
});
```
* Kotlin
```kotlin
import com.contentsquare.android.Contentsquare
val optinButton: Button = ...
optinButton.setOnClickListener {
Contentsquare.optIn()
// Then finish initialization and move to the next screen...
}
```
Going further
For advanced configuration regarding user consent or personal data handling, see [Privacy](https://docs.contentsquare.com/en/android/privacy/).
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a `screenview` event each time a new screen is displayed on the user's device.
To trigger a screenview each time an activity becomes visible, place the call in the `onResume()` method (XML layouts only):
* Java
```java
import com.contentsquare.android.Contentsquare;
public class MyActivity extends Activity {
@Override
public void onResume() {
super.onResume();
// Send screenView
Contentsquare.send("screen_name");
}
}
```
* Kotlin
```kotlin
import com.contentsquare.android.Contentsquare
class MyActivity : Activity() {
override fun onResume() {
super.onResume()
// Send screenView
Contentsquare.send("screen_name")
}
}
```
#### Jetpack Compose support
To enable Jetpack Compose support, add a new dependency to your Gradle build file.
* Groovy
**build.gradle**
```groovy
implementation 'com.contentsquare.android:compose:4.52.1'
```
* Kotlin
**build.gradle.kts**
```kotlin
implementation("com.contentsquare.android:compose:4.52.1")
```
Attention must be paid to recompositions. The call should be wrapped using `TriggeredOnResume` to ensure only one screenview is triggered when a given screen is presented to the user.
```kotlin
import com.contentsquare.android.Contentsquare
import com.contentsquare.android.compose.analytics.TriggeredOnResume
@Composable
fun MyComposable(data: Data) {
TriggeredOnResume {
Contentsquare.send("screen_name")
}
// ...
}
```
### Implementation recommendations
From a functional perspective, a screenview should be triggered in the following cases:
* When the screen appears on the device
* When a modal or pop-up is displayed
* When a modal or pop-up is closed, returning the user to the screen
* When the app is brought back to the foreground (after being minimized)
Specific triggers
Depending on how your app is built (Popups, Webviews, Redirections, etc...), you might need specific implementation use cases for triggering screenview events.
See the [dedicated section on screen tracking](https://docs.contentsquare.com/en/android/track-screens/#implementation-recommendations).
#### Tracking app launch
Most events collected by the SDK require a screenview event to be sent first so they can be associated with that screen; otherwise, they will be discarded. If you need to collect events from the moment the app launches, you should trigger a screenview event immediately after the SDK has started.
Refer to [our guide](https://docs.contentsquare.com/en/android/track-screens/#when-to-send-your-first-screenview) for implementation examples.
#### Screen name handling
It is necessary to provide a name for each screen when calling the screenview API.
As a general rule, keep distinct screen names under 100. As they are used to map your app in Contentsquare, you will want something comprehensive. The screen name length is not limited on the SDK side. However, the limit is 2083 characters on the server side.
More on [screen name handling](https://docs.contentsquare.com/en/android/track-screens/#how-to-name-screens).
Tracking plan
To get the most out of your data, it's best to follow a tracking plan. This way, you'll capture every step of the user's journey without missing important interactions, giving you a complete picture of how your app is used.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Android Studio or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Sample app
To explore some of these features in context, check our Android sample app.
### [android-sample-app](https://github.com/ContentSquare/android-sample-app)
[A sample app giving an example implementation of the Contentsquare SDK](https://github.com/ContentSquare/android-sample-app)
[Kotlin](https://github.com/ContentSquare/android-sample-app)
## Next steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Custom Variables](https://docs.contentsquare.com/en/android/track-custom-variables/)Collect additional details about the screen or the user.
[Dynamic Variables](https://docs.contentsquare.com/en/android/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/android/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
[WebViews](https://docs.contentsquare.com/en/android/track-webviews/)For native apps which embark web applications or pages.
[Session Replay](https://docs.contentsquare.com/en/android/session-replay/)Collect data for Session Replay in compliance personal data masking.
[Error Analysis](https://docs.contentsquare.com/en/android/error-analysis/)Track API errors and application crashes with automated collection and privacy-safe debugging tools.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Integrate the Contentsquare SDK into your Android app in minutes (installation, user consent, screen tracking, and testing)","url":"https://docs.contentsquare.com/en/android/","inLanguage":"en","dateModified":"2026-06-03T22:01:55+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: Getting Started - Capacitor
description: Integrate Contentsquare SDKs into your Capacitor apps in minutes (installation, user consent, screen tracking, and testing)
lastUpdated: 07 April 2026
source_url:
html: https://docs.contentsquare.com/en/capacitor/
md: https://docs.contentsquare.com/en/capacitor/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
## Install the SDK
The SDK is shipped as a Capacitor plugin which you need to add as a dependency to your Capacitor application.
See [Compatibility](compatibility/) for more information.
### Include the SDK
Install the plugin as follows, specifying the exact version you want to install if needed:
```shell
npm install @contentsquare/capacitor-plugin
npx cap sync
```
You do not need to do anything to start the SDK. Now that the SDK is a dependency of your app, it will autostart itself when your application starts.
### Validate SDK integration
Start your application, and check logs for this output:
* Android Studio
```text
CSLIB: Contentsquare SDK 7.1.1 starting in app: com.example.testapp
```
* Xcode
```text
CSLIB ℹ️ Info: Contentsquare SDK v7.1.1 starting in app: com.example.testapp
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Android Studio, Xcode, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing local logs in IDE
* Android
To view SDK logs:
1. Plug your Android phone into your computer (or use an emulator)
2. Open Android Studio and start your app
3. Open the `Logcat` view and select your phone or emulator
4. Filter logs by `CSLIB`

* iOS
1. Unless you are using a simulator, ensure the device you are using is connected to your Mac or is on the same Wi-Fi network.
2. Open the macOS Console app or Xcode.
For the macOS Console app, make sure info messages are included at [Choose Action > Include Info Messages ↗](https://support.apple.com/guide/console/customize-the-log-window-cnsl35710/mac).
3. Filter logs by `CSLIB`.

### Implement in app-features
Note
This step only applies to iOS.
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To allow Contentsquare users to enable in-app features, perform these tasks:
1. [Add the custom URL scheme in your app Info](#1-add-the-custom-url-scheme-in-your-app-info)
2. [Call the SDK when the app is launched via a deeplink](#2-call-the-sdk-when-the-app-is-launched-via-a-deeplink)
#### 1. Add the custom URL scheme in your app Info
You have to allow your app to be opened via a custom URL scheme which can be done using one of the following methods:
##### Xcode
1. Open your project settings
2. Select the app target
3. Select the `Info` settings
4. Scroll to `URL Types`
5. Set the URL scheme to `cs-$(PRODUCT_BUNDLE_IDENTIFIER)`
##### Text editor
1. Open the `Info.plist` of your project
2. Add the following snippet:
**Info.plist**
```xml
CFBundleURLTypesCFBundleURLSchemescs-$(PRODUCT_BUNDLE_IDENTIFIER)
```
#### 2. Call the SDK when the app is launched via a deeplink
Depending on the project, there are multiple ways to handle the deeplink opening. Choose the method matching your project structure:
* AppDelegate
In your `AppDelegate` class, complete or implement the function `application(app, open url:, options:)` with: `Contentsquare.handle(url: url)`
* SceneDelegate
In your `WindowSceneDelegate` class, you need to:
1. Update `func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)` with:
```swift
if let url = connectionOptions.urlContexts.first?.url {
Contentsquare.handle(url: url)
}
```
2. Complete or implement `func scene(_ scene: UIScene, openURLContexts URLContexts: Set)` with:
```swift
if let url = URLContexts.first?.url {
Contentsquare.handle(url: url)
}
```
* SwiftUI
In the `body` of your main App struct, add the `onOpenURL` modifier and call the `Contentsquare` SDK to handle the URL:
```swift
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
MyView()
.onOpenURL { url in
Contentsquare.handle(url: url)
}
}
}
}
```
### Enable in-app features
To enable in-app features within your app, you have to **first make sure your app is launched in the background**. Then, follow the appropriate method described as follows.
#### On a device: scan the QR code
* Android
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

* iOS
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

#### On an emulator/simulator
* Android
In Contentsquare, select the Mobile icon in the menu top bar then select your application ID, and "Copy this ADB command".

* iOS
In Contentsquare, select the Mobile icon in the menu top bar then select your Bundle ID, and select "Copy this link". Paste it in Safari on your simulator to trigger the in-app features.

### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.
* Android

* iOS

## Get user consent
Contentsquare collects usage data from your app users. To start tracking, you need your users' consent for being tracked.
Warning
You are responsible for handling the UI asking users for their consent and allowing them to manage their privacy settings. Consult our [Privacy Center ↗](https://contentsquare.com/privacy-center/) and [Privacy Policy ↗](https://contentsquare.com/privacy-center/privacy-policy/).
### User opt-in
The SDK treats users as **opted-out by default.**
Forward user consent with `optIn()`. Calling this method generates a user ID and initiates tracking.
```javascript
import { ContentsquarePlugin } from "@contentsquare/capacitor-plugin";
ContentsquarePlugin.optIn();
```
Going further
For advanced configuration regarding user consent or personal data handling, see [Privacy](https://docs.contentsquare.com/en/capacitor/privacy/).
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a `screenview` event each time a new screen is displayed on the user's device.
```javascript
import { ContentsquarePlugin } from "@contentsquare/capacitor-plugin";
ContentsquarePlugin.sendScreenName(screenName).catch((err) => {
// Handle error
});
```
### Implementation recommendations
From a functional perspective, a screenview should be triggered in the following cases:
* When the screen appears on the device
* When a modal or pop-up is displayed
* When a modal or pop-up is closed, returning the user to the screen
* When the app is brought back to the foreground (after being minimized)
#### Screen name handling
It is necessary to provide a name for each screen when calling the screenview API.
As a general rule, keep distinct screen names under 100. As they are used to map your app in Contentsquare, you will want something comprehensive. The screen name length is not limited on the SDK side. However, the limit is 2083 characters on the server side.
More on [screen name handling](https://docs.contentsquare.com/en/capacitor/track-screens/#how-to-name-screens).
Tracking plan
To get the most out of your data, it's best to follow a tracking plan. This way, you'll capture every step of the user's journey without missing important interactions, giving you a complete picture of how your app is used.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Android Studio, Xcode, or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.
* Android

* iOS

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Sample app
To explore some of these features in context, check our Capacitor sample app.
### [capacitor-sample-app](https://github.com/ContentSquare/capacitor-sample-app)
[A sample app giving an example implementation of the Contentsquare SDK](https://github.com/ContentSquare/capacitor-sample-app)
[TypeScript](https://github.com/ContentSquare/capacitor-sample-app)
## Next steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Dynamic Variables](https://docs.contentsquare.com/en/capacitor/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/capacitor/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
[Session Replay](https://docs.contentsquare.com/en/capacitor/session-replay/)Collect data for Session Replay in compliance personal data masking.
[Error Analysis](https://docs.contentsquare.com/en/capacitor/error-analysis/)Track API errors and application crashes with automated collection and privacy-safe debugging tools.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Integrate Contentsquare SDKs into your Capacitor apps in minutes (installation, user consent, screen tracking, and testing)","url":"https://docs.contentsquare.com/en/capacitor/","inLanguage":"en","dateModified":"2026-04-07T14:16:48+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: What is Data Connect? - Data Connect
description: Connect Contentsquare data with your warehouse or data lake for deeper business reporting, in-depth analysis, and customer modeling
lastUpdated: 18 March 2026
source_url:
html: https://docs.contentsquare.com/en/connect/
md: https://docs.contentsquare.com/en/connect/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
Data Connect is built for data teams. It automatically syncs Contentsquare behavioral data into your data warehouse, so you can run complex SQL-based analysis and combine it with other datasets in your organization (CRM, ERP, marketing tools, and more).
Note
Data Connect is available for [Enterprise and Pro (optional) ↗](https://contentsquare.com/pricing/) plans.
## Why use Data Connect?
* **Combine various datasets.** Combine Contentsquare data with your existing datasets in one place, using the tools and query language your team already knows.
* **Full SQL access.** Run complex analytical queries directly in your data warehouse on structured data.
* **Feed your data pipelines.** Build downstream reporting, monitoring, and alerting workflows on top of Contentsquare data.
* **Power ML and AI workflows.** Use Contentsquare's behavioral data to train ML models or enrich AI agents.
* **Quick to set up.** Data Connect is self-serve and writes directly to your warehouse. No engineering work required to get started.
## How does it work?
* Data Connect syncs data to your warehouse on a fixed schedule. Each sync is incremental, automatically appending fresh data in batches.
* Data is organized using a structured [data schema](https://docs.contentsquare.com/en/connect/data-schema/), with each user interaction broken down into the following core tables: sessions, pageviews, and events.
* Supported warehouses: [Amazon Redshift, Google BigQuery, Snowflake, Amazon S3, Databricks](https://docs.contentsquare.com/en/connect/data-warehouses-overview/).
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"What is Data Connect?","description":"Connect Contentsquare data with your warehouse or data lake for deeper business reporting, in-depth analysis, and customer modeling","url":"https://docs.contentsquare.com/en/connect/","inLanguage":"en","dateModified":"2026-03-18T17:28:59+01:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: Getting Started - Cordova
description: Integrate Contentsquare SDKs into your Cordova apps in minutes (installation, user consent, screen tracking, and testing)
lastUpdated: 07 April 2026
source_url:
html: https://docs.contentsquare.com/en/cordova/
md: https://docs.contentsquare.com/en/cordova/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
## Install the SDK
The Contentsquare Plugin for Cordova is a plugin between the Contentsquare SDKs for iOS and Android, and your Cordova JavaScript code. It allows for the use of our solution both in native and JavaScript parts of your app. The Contentsquare functionality is provided through an NPM package including only the plugin and dependencies to specific versions of the SDKs.
See [Compatibility](compatibility/) for more information.
### Include the SDK
Install the plugin as follows, specifying the exact version you want to install if needed:
```shell
cordova plugin add @contentsquare/cordova-plugin
```
If your app is written in TypeScript, you can also install the types definitions package.
```shell
npm install -D @contentsquare/cordova-plugin-types
```
#### Use the plugin in your JavaScript code
The plugin defines a `ContentsquarePlugin` object.
Although the object is in the global scope, features provided by this plugin are not available until after the deviceready event.
```javascript
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// ContentsquarePlugin is now available
}
```
You do not need to do anything to start the SDK. Now that the SDK is a dependency of your app, it will autostart itself when your application starts.
### Validate SDK integration
Start your application, and check logs for this output:
* Android Studio
```text
CSLIB: Contentsquare SDK 0.3 starting in app: com.example.testapp
```
* Xcode
```text
CSLIB ℹ️ Info: Contentsquare SDK v0.3 starting in app: com.example.testapp
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Android Studio, Xcode, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing local logs in IDE
* Android
To view SDK logs:
1. Plug your Android phone into your computer (or use an emulator)
2. Open Android Studio and start your app
3. Open the `Logcat` view and select your phone or emulator
4. Filter logs by `CSLIB`

* iOS
1. Unless you are using a simulator, ensure the device you are using is connected to your Mac or is on the same Wi-Fi network.
2. Open the macOS Console app or Xcode.
For the macOS Console app, make sure info messages are included at [Choose Action > Include Info Messages ↗](https://support.apple.com/guide/console/customize-the-log-window-cnsl35710/mac).
3. Filter logs by `CSLIB`.

### Implement in app-features
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To allow Contentsquare users to enable in-app features, perform these tasks:
1. [Install the Cordova plugin to handle URL schemes](#1-install-the-cordova-plugin-to-handle-url-schemes)
2. [Call the SDK when your app is opened with the custom URL](#2-call-the-sdk-when-your-app-is-opened-with-the-custom-url)
#### 1. Install the Cordova plugin to handle URL schemes
In order for your application to open when you scan the QR code or enter the URL we provide in a web browser, you have to install a Cordova plugin which will handle the URL scheme.
```javascript
cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=cs-{package-id}
// Example:
// my package id is 'com.mycompany.myapp'
// cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=cs-com.mycompany.myapp
```
#### 2. Call the SDK when your app is opened with the custom URL
Then, you will need to link your app with our SDK. When your application is started via a deeplink, a specific global JavaScript function, handleOpenURL(), is automatically called in your App. You will have to define this function in the 'window' global scope and you will need to call a function of our API via the Contentsquare Cordova Plugin.
```javascript
window.handleOpenURL = function (url) {
console.log("received url: " + url);
ContentsquarePlugin.handleURL(url);
};
```
### Enable in-app features
To enable in-app features within your app, you have to **first make sure your app is launched in the background**. Then, follow the appropriate method described as follows.
#### On a device: scan the QR code
* Android
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

* iOS
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

#### On an emulator/simulator
* Android
In Contentsquare, select the Mobile icon in the menu top bar then select your app ID, and "Copy this ADB command".

* iOS
If you have access to the Contentsquare platform, you can open the in-app features modal from the menu then select your app ID, and select "Copy this link". Paste it in Safari on your simulator to trigger the in-app features.

### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.
* Android

* iOS

## Get user consent
Contentsquare collects usage data from your app users. To start tracking, you need your users' consent for being tracked.
Warning
You are responsible for handling the UI asking users for their consent and allowing them to manage their privacy settings. Consult our [Privacy Center ↗](https://contentsquare.com/privacy-center/) and [Privacy Policy ↗](https://contentsquare.com/privacy-center/privacy-policy/).
### User opt-in
The SDK treats users as **opted-out by default.**
To start tracking, use `optIn()`. The `optIn()` API enables tracking via Contentsquare by generating a user ID and initiating tracking. This method should be called after receiving consent from the user.
For example, call `optIn()` when the user accepts your app's privacy policy or tracking terms:
```javascript
import React, { useState } from "react";
import { View, Text, Button } from "react-native";
import Contentsquare from "@contentsquare/react-native-bridge";
const PolicyConsentScreen = () => {
const [isTrackingAccepted, setIsTrackingAccepted] = useState(false);
const handleAcceptPolicy = () => {
setIsTrackingAccepted(true);
Contentsquare.optIn(); // Opt-in for CS Tracking
};
return (
Please accept our privacy policy to proceed.
);
};
export default PolicyConsentScreen;
```
Going further
For advanced configuration regarding user consent or personal data handling, see [Privacy](https://docs.contentsquare.com/en/android/privacy/).
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a screenview event each time a new screen is displayed on the user's device.
```javascript
import { ContentsquareCDVPlugin } from '@contentsquare/cordova-plugin-types';
declare var ContentsquarePlugin: ContentsquareCDVPlugin;
ContentsquarePlugin.sendScreenName("ScreenName", (result)=>{
// Success
}, (err)=>{
// Handle error
});
```
### Implementation recommendations
From a functional perspective, a screenview should be triggered in the following cases:
* When the screen appears on the device
* When a modal or pop-up is displayed
* When a modal or pop-up is closed, returning the user to the screen
* When the app is brought back to the foreground (after being minimized)
#### Screen name handling
It is necessary to provide a name for each screen when calling the screenview API.
As a general rule, keep distinct screen names under 100. As they are used to map your app in Contentsquare, you will want something comprehensive. The screen name length is not limited on the SDK side. However, the limit is 2083 characters on the server side.
More on [screen name handling](https://docs.contentsquare.com/en/cordova/track-screens/#how-to-name-screens).
Tracking plan
To get the most out of your data, it's best to follow a tracking plan. This way, you'll capture every step of the user's journey without missing important interactions, giving you a complete picture of how your app is used.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Android Studio, Xcode, or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.
* Android

* iOS

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Sample app
To explore some of these features in context, check our Cordova sample apps.
### [cordova-sample-app](https://github.com/ContentSquare/cordova-sample-app)
[A sample app giving an example implementation of the Contentsquare SDK](https://github.com/ContentSquare/cordova-sample-app)
[TypeScript](https://github.com/ContentSquare/cordova-sample-app)
## Next steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Dynamic Variables](https://docs.contentsquare.com/en/cordova/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/cordova/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Integrate Contentsquare SDKs into your Cordova apps in minutes (installation, user consent, screen tracking, and testing)","url":"https://docs.contentsquare.com/en/cordova/","inLanguage":"en","dateModified":"2026-04-07T14:16:48+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: Getting Started - Flutter (classic)
description: Load and validate the Contentsquare Flutter SDK installation in your app
lastUpdated: 10 June 2026
source_url:
html: https://docs.contentsquare.com/en/flutter/
md: https://docs.contentsquare.com/en/flutter/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
The latest CSQ SDK is here! Learn how to [upgrade your app](https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/upgrade-from-cs-sdk/).
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
## Install the SDK
With Flutter CLI:
```shell
flutter pub add contentsquare
```
This will add a line like this to your package's pubspec.yaml (and run an implicit `flutter pub get`):
**pubspec.yaml**
```yaml
dependencies:
contentsquare: ^4.4.4
```
See [Compatibility](compatibility/) for more information.
## Start the SDK
1. Import the SDK
```dart
import 'package:contentsquare/contentsquare.dart';
```
2. Add a call to start the SDK as early as possible, ideally in the `main()` function of your app.
**main.dart**
```dart
import 'package:contentsquare/contentsquare.dart';
import 'package:flutter/material.dart';
void main() async {
await Contentsquare().start();
runApp(const MyApp());
}
```
Alternatively you can start the SDK after user consent, for example on a button press:
```dart
class UserConsentScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('User Consent'),
),
body: Center(
child: ElevatedButton(
onPressed: () async {
await Contentsquare().start();
},
child: Text('Agree with Terms and Conditions'),
),
),
);
}
}
```
3. After calling `start()` you need to call `optIn()` to start tracking.
```dart
class UserConsentScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('User Consent'),
),
body: Center(
child: ElevatedButton(
onPressed: () async {
await Contentsquare().start();
await Contentsquare().optIn();
},
child: Text('Agree with Terms and Conditions'),
),
),
);
}
}
```
## Validate SDK integration
Start your application, and check logs for this output:
```text
┌───────────────────────────────────────────────────────────────────────────────
│ 🔔 IMPORTANT 🔔 (CSLIB 4.4.4)
├───────────────────────────────────────────────────────────────────────────────
│ Contentsquare Flutter SDK 4.4.4 starting in app:
│ com.example.testapp
└───────────────────────────────────────────────────────────────────────────────
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Android Studio, Xcode, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing local logs in IDE
* Android Studio
To view SDK logs:
1. Plug your Android phone into your computer (or use an emulator)
2. Open Android Studio and start your app
3. Open the `Logcat` view and select your phone or emulator
4. Filter logs by `CSLIB`

* Xcode
1. Unless you are using a simulator, ensure the device you are using is connected to your Mac or is on the same Wi-Fi network.
2. Open the macOS Console app or Xcode.
For the macOS Console app, make sure info messages are included at [Choose Action > Include Info Messages ↗](https://support.apple.com/guide/console/customize-the-log-window-cnsl35710/mac).
1. Filter logs by `CSLIB`.

### Enable In-app features
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To enable in-app features within your app, you have to **first make sure your app is launched in the background**. Then, follow the appropriate method described as follows.
#### On a device: scan the QR code
* Android
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

* iOS
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

#### On an emulator/simulator
* Android
In Contentsquare, select the Mobile icon in the menu top bar then select your application ID, and "Copy this ADB command".

* iOS
In Contentsquare, select the Mobile icon in the menu top bar then select your Bundle ID, and select "Copy this link". Paste it in Safari on your simulator to trigger the in-app features.

### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.
* Android

* iOS

## Android permissions
When using the Contentsquare Flutter SDK on Android, the underlying native SDK requires specific permissions to function correctly.
These permissions are automatically included from the Contentsquare SDK into your app's `AndroidManifest.xml` at build time.
For the full list and detailed explanations, you can refer to the [Contentsquare Android SDK Required Permissions documentation](https://docs.contentsquare.com/en/android/security/#app-permissions).
Important
These permissions are mandatory and used exclusively for analytics purposes, in compliance with GDPR and CNIL (French regulation) requirements.
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a `screenview` each time a screen is displayed on the user's device.
Important
Sending at least one screen event is required to start tracking.
**home.dart**
```dart
import 'package:contentsquare/contentsquare.dart';
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State {
@override
void initState() {
super.initState();
Contentsquare().send('Home');
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Home'),
),
body: const Center(
child: Text('Welcome to Contentsquare!'),
),
);
}
}
```
### Implementation recommendations
For more detailed information on how to track screens, refer to the complete [screen tracking](https://docs.contentsquare.com/en/flutter/track-screens/) guide.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Android Studio, Xcode, or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.
* Android

* iOS

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Next Steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Custom Variables](https://docs.contentsquare.com/en/flutter/track-custom-variables/)Collect additional details about the screen or the user.
[Dynamic Variables](https://docs.contentsquare.com/en/flutter/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/flutter/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
[WebViews](https://docs.contentsquare.com/en/flutter/track-webviews/)For native apps which embark web applications or pages.
[Session Replay](https://docs.contentsquare.com/en/flutter/session-replay/)Collect data for Session Replay in compliance personal data masking.
[Error Analysis](https://docs.contentsquare.com/en/flutter/error-analysis/)Track API errors and application crashes with automated collection and privacy-safe debugging tools.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Load and validate the Contentsquare Flutter SDK installation in your app","url":"https://docs.contentsquare.com/en/flutter/","inLanguage":"en","dateModified":"2026-06-10T08:20:02+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: Getting Started - iOS (classic)
description: Integrate the Contentsquare SDK into your iOS app in minutes (installation, user consent, screen tracking, and testing)
lastUpdated: 01 July 2026
source_url:
html: https://docs.contentsquare.com/en/ios/
md: https://docs.contentsquare.com/en/ios/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
The latest CSQ SDK is here! Learn how to [upgrade your app](https://docs.contentsquare.com/en/csq-sdk-ios/experience-analytics/upgrade-from-cs-sdk/).
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
Warning
**CocoaPods is no longer supported.** If you're using CocoaPods, [migrate to Swift Package Manager](https://docs.contentsquare.com/en/ios/migrate-from-cocoapods/) to continue receiving updates.
## Install the SDK
Our iOS SDK is shipped as a `.xcframework` which you need to add as a dependency of your project.
See [Compatibility](compatibility/) for more information.
### Include the SDK
The SDK requires Xcode 16.0 or later. If you are using an earlier version of Xcode, contact your Contentsquare representative for more information.
* Swift Package Manager
1. In Xcode, add the following link via `File > Add Packages…`:
```plaintext
https://github.com/ContentSquare/CS_iOS_SDK.git
```
2. Remove `https://github.com/apple/swift-protobuf.git` if you added it before Contentsquare iOS SDK version 4.35.1.
3. To ensure the library can start properly you will need to add `-ObjC` as a linker flag under `Build Settings` > `Linking` > `Other Linker Flags`.
* Manual
Our SDK can be linked dynamically or statically:
#### Dynamic linking
##### Get the manual integration framework
1. Go to the [iOS SDK GitHub repository ↗](https://github.com/ContentSquare/CS_iOS_SDK/releases).
2. Find the newest version available (unless instructed otherwise by your CS contact).
3. Under `Assets` you should be able to find `ContentsquareModuleDynamicManually.xcframework.zip`, download the file.
##### Include the framework
1. Unzip `ContentsquareModuleDynamicManually.xcframework.zip` and you should see a folder named `ContentsquareModule` containing:
* `ContentsquareModule.xcframework`
* `CSSwiftProtobuf.xcframework`
* `CSCrashReporter.xcframework`
2. Copy `ContentsquareModule` to any folder in your project.
3. In your `target` -> `General` -> `Frameworks, Libraries and Embedded Content`, add `ContentsquareModule.xcframework`, `CSSwiftProtobuf.xcframework` and `CSCrashReporter.xcframework` by clicking "+" -> "Add Other..." -> "Add Files...".
4. Clean build folder and run.
#### Static linking
##### Get the manual integration framework
1. Go to the [iOS SDK GitHub repository ↗](https://github.com/ContentSquare/CS_iOS_SDK/releases).
2. Find the newest version available (unless instructed otherwise by your CS contact).
3. Under `Assets` you should be able to find `ContentsquareModuleStaticManually.xcframework.zip`, download the file.
##### Include the framework
1. Unzip `ContentsquareModuleStaticManually.xcframework.zip` and you should see a folder named `ContentsquareModule` containing:
* `ContentsquareModule.xcframework`
* `Resources/ContentsquareBundle.bundle`
* `CSSwiftProtobuf.xcframework`
* `CSCrashReporter.xcframework`
2. Copy `ContentsquareModule` to any folder in your project.
3. In your `target` -> `General` -> `Frameworks, Libraries and Embedded Content`, add `ContentsquareModule.xcframework`, `CSSwiftProtobuf.xcframework` and `CSCrashReporter.xcframework` by clicking "+" -> "Add Other..." -> "Add Files...".
4. Add `ContentsquareBundle.bundle` to your target, make sure it has been added to your `target` -> `Build Phases` -> `Copy Bundle Resources`.
5. To ensure the library can start properly you will need to add `-ObjC` as a linker flag under `Build Settings` > `Linking` > `Other Linker Flags`.
6. Clean build folder and run.
The SDK autostarts when your application launches, requiring no manual initialization.
### Validate SDK integration
Start your application, and check logs for this output:
```text
CSLIB ℹ️ Info: Contentsquare SDK v4.52.1 starting in app: com.example.testapp
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Xcode, the macOS Console app, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing logs in Xcode or the Console app
To view SDK logs:
1. If using an actual device, make sure it is plugged to your Mac or is on the same Wi-Fi network.
2. Start the macOS Console app or Xcode.
If using the Console app, make sure that info messages are included: [Choose Action > Include Info Messages ↗](https://support.apple.com/guide/console/customize-the-log-window-cnsl35710/mac).
3. Filter logs by `CSLIB`

### Implement in-app features
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To allow Contentsquare users to enable in-app features:
1. [Add the custom URL scheme in your app Info](#1-add-the-custom-url-scheme-in-your-app-info)
2. [Call the SDK when the app is launched via a deeplink](#2-call-the-sdk-when-the-app-is-launched-via-a-deeplink)
#### 1. Add the custom URL scheme in your app Info
You have to allow your app to be opened via a custom URL scheme which can be done using one of the following methods:
##### Xcode
1. Open your project settings
2. Select the app target
3. Select the `Info` settings
4. Scroll to `URL Types`
5. Set the URL scheme to `cs-$(PRODUCT_BUNDLE_IDENTIFIER)`
##### Text editor
1. Open the `Info.plist` of your project
2. Add the following snippet:
**Info.plist**
```xml
CFBundleURLTypesCFBundleURLSchemescs-$(PRODUCT_BUNDLE_IDENTIFIER)
```
#### 2. Call the SDK when the app is launched via a deeplink
Depending on the project, there are multiple ways to handle the deeplink opening. Choose the method matching your project structure:
* AppDelegate
In your `AppDelegate` class, complete or implement the function `application(app, open url:, options:)` with: `Contentsquare.handle(url: url)`
* SceneDelegate
In your `WindowSceneDelegate` class, you need to:
1. Update `func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)` with:
```swift
if let url = connectionOptions.urlContexts.first?.url {
Contentsquare.handle(url: url)
}
```
2. Complete or implement `func scene(_ scene: UIScene, openURLContexts URLContexts: Set)` with:
```swift
if let url = URLContexts.first?.url {
Contentsquare.handle(url: url)
}
```
* SwiftUI
In the `body` of your main App struct, add the `onOpenURL` modifier and call the `Contentsquare` SDK to handle the URL:
```swift
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
MyView()
.onOpenURL { url in
Contentsquare.handle(url: url)
}
}
}
}
```
### Enable in-app features
#### On a device: scan the QR code
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

#### On a simulator: with the custom link
If you are using a simulator, use the custom link to enable in-app features.
In Contentsquare, select the Mobile icon in the menu top bar then select your Bundle ID, and select "Copy this link". Paste it in Safari on your simulator to trigger the in-app features.

#### On a simulator: with the Terminal
In a Terminal console, open a URL in your current simulator with the following command (replacing `CUSTOM_LINK` with yours):
```shell
xcrun simctl openurl booted "CUSTOM_LINK"
```
### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.

## Get user consent
Contentsquare collects usage data from your app users. To start tracking, you need your users' consent for being tracked.
### User opt-in
The SDK treats users as **opted-out by default.**
To start tracking, forward user consent with `optIn()`. Calling this method generates a user ID and initiates tracking.
Handle user consent by implementing a UI for privacy preferences.
* Swift
```swift
Contentsquare.optIn()
```
* Objective-C
```objective-c
[Contentsquare optIn];
```
Going further
For advanced configuration regarding user consent or personal data handling, see [Privacy](https://docs.contentsquare.com/en/ios/privacy/).
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a `screenview` event each time a new screen is displayed on the user's device.
As a general rule of thumb, you should send your screenviews in `viewWillAppear(_ animate: Bool)` when using UIKit, in `.onAppear()` when using SwiftUI.
* Swift
```swift
import ContentsquareModule
Contentsquare.send(screenViewWithName: String, cvars: [CustomVar] = [])
```
* Objective-C
```objective-c
@import ContentsquareModule;
[Contentsquare sendWithScreenViewWithName:(NSString * _Nonnull)];
// or
[Contentsquare sendWithScreenViewWithName:(NSString * _Nonnull) cvars:(NSArray * _Nonnull)]; // To add custom variables to screen tracking
```
### Implementation recommendations
From a functional perspective, a screenview should be triggered in the following cases:
* When the screen appears on the device
* When a modal or pop-up is displayed
* When a modal or pop-up is closed, returning the user to the screen
* When the app is brought back to the foreground (after being minimized)
Specific triggers
Depending on how your app is built (Popups, Webviews, Redirections, etc...), you might need specific implementation use cases for triggering screenview events.
See the [dedicated section in our Guide](https://docs.contentsquare.com/en/ios/track-screens/#implementation-recommendations).
#### Tracking app launch
Most events collected by the SDK require a screenview event to be sent first so they can be associated with that screen; otherwise, they will be discarded. If you need to collect events from the moment the app launches, you should trigger a screenview event immediately after the SDK has started.
Refer to [our guide](https://docs.contentsquare.com/en/ios/track-screens/#when-to-send-your-first-screenview) for implementation examples.
#### Screen name handling
It is necessary to provide a name for each screen when calling the screenview API.
As a general rule, keep distinct screen names under 100. As they are used to map your app in Contentsquare, you will want something comprehensive. The screen name length is not limited on the SDK side. However, the limit is 2083 characters on the server side.
More on [screen name handling](https://docs.contentsquare.com/en/ios/track-screens/#how-to-name-screens).
Tracking plan
To get the most out of your data, it's best to follow a tracking plan. This way, you'll capture every step of the user's journey without missing important interactions, giving you a complete picture of how your app is used.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Xcode, macOS Console App, or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Sample app
To explore some of these features in context, check our iOS sample app.
### [iOS-sample-app](https://github.com/ContentSquare/iOS-sample-app)
[A sample app giving an example implementation of the Contentsquare SDK](https://github.com/ContentSquare/iOS-sample-app)
[Swift](https://github.com/ContentSquare/iOS-sample-app)
## Next Steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Custom Variables](https://docs.contentsquare.com/en/ios/track-custom-variables/)Collect additional details about the screen or the user.
[Dynamic Variables](https://docs.contentsquare.com/en/ios/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/ios/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
[WebViews](https://docs.contentsquare.com/en/ios/track-webviews/)For native apps which embark web applications or pages.
[Session Replay](https://docs.contentsquare.com/en/ios/session-replay/)Collect data for Session Replay in compliance personal data masking.
[Error Analysis](https://docs.contentsquare.com/en/ios/error-analysis/)Track API errors and application crashes with automated collection and privacy-safe debugging tools.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Integrate the Contentsquare SDK into your iOS app in minutes (installation, user consent, screen tracking, and testing)","url":"https://docs.contentsquare.com/en/ios/","inLanguage":"en","dateModified":"2026-07-01T21:01:22+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: Getting Started - React Native (classic)
description: Integrate the Contentsquare React Native bridge into your apps in minutes (installation, user consent, screen tracking, and testing)
lastUpdated: 10 June 2026
source_url:
html: https://docs.contentsquare.com/en/react-native/
md: https://docs.contentsquare.com/en/react-native/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
The latest CSQ SDK is here! Learn how to [upgrade your app](https://docs.contentsquare.com/en/csq-sdk-react-native/experience-analytics/upgrade-from-cs-sdk/).
Welcome to the SDK implementation guide!
This guide is designed to help you seamlessly integrate our SDK into your application. By following the outlined steps, you'll be able to collect and analyze data from your app, within just a few minutes.
React Native new architecture
If your app enables React Native's New Architecture, make sure to check our [compatibility](compatibility/) page for more details.
## Install the SDK
The Contentsquare Bridge for React Native integrates the Contentsquare SDKs for both iOS and Android with your React Native JavaScript code.
See [Compatibility](compatibility/) for more information.
### Include the SDK
The Contentsquare Bridge is available as an [NPM package ↗](https://www.npmjs.com/package/@contentsquare/react-native-bridge), which includes the bridge and the necessary dependencies for specific versions of the SDKs.
To install the bridge, open a terminal and run the following commands from your application's root directory:
```shell
npm install @contentsquare/react-native-bridge
cd ios && pod install
```
iOS Specific Note
Since React Native projects for iOS are in Objective-C and our SDK is in Swift, you need to embed the Swift standard libraries. In your project's target Build Settings, set **Embedded Content Contains Swift Code** to YES.
Ensure CocoaPods version 1.10.0 or later is installed (`pod --version`). If not, update with `[sudo] gem install cocoapods`. This is required to link the SDK and bridge, as CocoaPods only added support for XCFrameworks in late 2020.
### Importing the Bridge
The Contentsquare module is the main module and the default export of our bridge. The Currency module is only used to send Transactions, and contains all supported currencies.
```javascript
import Contentsquare, { Currency } from "@contentsquare/react-native-bridge";
```
### Start the SDK
Starting the SDK should happen as early as possible in your app's lifecycle, ideally in the main component or entry point of your React Native application.
1. Add a call to `Contentsquare.start()` within a `useEffect` hook in your main component, such as `App.js` or `index.js`:
```javascript
import { Contentsquare } from "@contentsquare/react-native-bridge";
useEffect(() => {
Contentsquare.start();
}, []);
```
2. Start your application, and check logs for this output:
```text
[INFO] CSQ 6.4.2 for Product Analytics is attempting to start.
```
## Get user consent
The CSQ SDK treats users as opted-out by default.
Implement the [`optIn()`](https://docs.contentsquare.com/en/react-native/privacy/#opt-in) API to forward user consent to the SDK and generate a user ID.
```javascript
import { Contentsquare } from "@contentsquare/react-native-bridge";
Contentsquare.optIn();
```
### Validate SDK integration
Start your application, and check logs for this output:
```text
[INFO] CSQ 6.4.2 for Product Analytics is attempting to start.
```
## Check the logs
Contentsquare provides logging capabilities that allow you to inspect the raw event data logged by your app in Android Studio, Xcode, or on the Contentsquare platform.
To view all logs, you must [enable in-app features](#enable-in-app-features): logging is linked to in-app features being enabled or disabled.
### Viewing local logs in IDE
* Android
To view SDK logs:
1. Plug your Android phone into your computer (or use an emulator)
2. Open Android Studio and start your app
3. Open the `Logcat` view and select your phone or emulator
4. Filter logs by `CSLIB`

* iOS
1. Unless you are using a simulator, ensure the device you are using is connected to your Mac or is on the same Wi-Fi network.
2. Open the macOS Console app or Xcode.
For the macOS Console app, make sure info messages are included at [Choose Action > Include Info Messages ↗](https://support.apple.com/guide/console/customize-the-log-window-cnsl35710/mac).
3. Filter logs by `CSLIB`.

### Enable in-app features
In-app features are essential for your implementation, as it includes key functionalities like screenshot creation and replay configuration.
To enable in-app features within your app, you have to **first make sure your app is launched in the background**. Then, follow the appropriate method described as follows.
#### On a device: scan the QR code
* Android
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

* iOS
In Contentsquare, select the Mobile icon in the menu top bar and scan the QR code with your phone.

#### On an emulator/simulator
* Android
In Contentsquare, select the Mobile icon in the menu top bar then select your application ID, and "Copy this ADB command".

* iOS
In Contentsquare, select the Mobile icon in the menu top bar then select your Bundle ID, and select "Copy this link". Paste it in Safari on your simulator to trigger the in-app features.

### Contentsquare Log Visualizer
Log Visualizer is a feature integrated into the Contentsquare SDK. As you navigate and interact with your app, it provides a live view of events detected by the SDK, visible directly on the [Contentsquare platform ↗](https://app.contentsquare.com/#/analyze/mobile-log).
Prerequisite
To use Log Visualizer, `Activate SDK logs stream` must be toggled on within in-app settings.
1. Start your app.
2. Select the Mobile icon in the menu top bar then select `Log Visualizer`.
3. Select the device to inspect.
At this stage, you should see an 'App start' or 'App show' event being logged.
* Android

* iOS

## Get user consent
Contentsquare collects usage data from your app users. To start tracking, you need your users' consent for being tracked.
### User opt-in
The SDK treats users as **opted-out by default.**
To start tracking, forward user consent with optIn(). Calling this method generates a user ID and initiates tracking.
For example, you can call `optIn()` when the user accepts your app's privacy policy or tracking terms.
```javascript
import React, { useState } from "react";
import { View, Text, Button } from "react-native";
import Contentsquare from "@contentsquare/react-native-bridge";
const PolicyConsentScreen = () => {
const [isTrackingAccepted, setIsTrackingAccepted] = useState(false);
const handleAcceptPolicy = () => {
setIsTrackingAccepted(true);
Contentsquare.optIn();
};
return (
Please accept our privacy policy to proceed.
);
};
export default PolicyConsentScreen;
```
Going further
For advanced configuration regarding user consent or personal data handling, see [Privacy](https://docs.contentsquare.com/en/android/privacy/).
## Android permissions
When using the Contentsquare Flutter/React Native SDK on Android, the underlying native SDK requires specific permissions to function correctly.
These permissions are automatically included from the Contentsquare SDK into your app's `AndroidManifest.xml` at build time.
For the full list and detailed explanations, you can refer to the [Contentsquare Android SDK Required Permissions documentation](https://docs.contentsquare.com/en/android/security/#app-permissions).
Important
These permissions are mandatory and used exclusively for analytics purposes, in compliance with GDPR and CNIL (French regulation) requirements.
## Track your first screens
Contentsquare aggregates the user behavior and engagement at the screen level. Start your SDK implementation by tracking key screens like the home screen, product list, product details, or conversion funnel.
### Sending screenview events
Screen tracking is achieved by sending a `screenview` event each time a new screen is displayed on the user's device.
#### Sending Screenview Events using the React Navigation Library
The sending of screenview events can be handled within the `NavigationContainer` in [React Navigation ↗](https://reactnavigation.org/docs/navigation-container/), which centralizes the logic and helps avoid unnecessary calls.
```javascript
// This associates the screen name sent to Contentsquare to the screen name defined in the code
const screenEventByScreenName: Record = {
Home: 'Home',
ProductList: 'Product List',
ProductDetails: 'Product #1',
};
export const Navigation = () => {
const navigationRef = useNavigationContainerRef();
const routeNameRef = useRef();
return (
{
// Getting initial route name from navigation and sending a screen view event with Contentsquare SDK
const currentRouteName = navigationRef.getCurrentRoute()?.name;
if (currentRouteName && screenEventByScreenName[currentRouteName]) {
Contentsquare.send(screenEventByScreenName[currentRouteName]);
}
}}
onStateChange={() => {
// Getting route name from navigation and sending a screen view event with Contentsquare SDK
const currentRouteName = navigationRef.getCurrentRoute()?.name;
routeNameRef.current = currentRouteName;
if (currentRouteName && screenEventByScreenName[currentRouteName]) {
Contentsquare.send(screenEventByScreenName[currentRouteName]);
}
}}
>
);
};
```
### Implementation recommendations
From a functional perspective, a screenview should be triggered in the following cases:
* When the screen appears on the device
* When a modal or pop-up is displayed
* When a modal or pop-up is closed, returning the user to the screen
* When the app is brought back to the foreground (after being minimized)
#### Tracking app launch
Most events collected by the SDK require a screenview event to be sent first to associate the events with the correct screen. If a screenview event is not sent, the events will be discarded. To ensure proper tracking from the moment the app launches, trigger a screenview event immediately after the SDK has started.
#### Screen name handling
It is necessary to provide a name for each screen when calling the screenview API.
As a general rule, keep distinct screen names under 100. As they are used to map your app in Contentsquare, you will want something comprehensive. The screen name length is not limited on the SDK side. However, the limit is 2083 characters on the server side.
More on [screen name handling](https://docs.contentsquare.com/en/react-native/track-screens/#how-to-name-screens).
Tracking plan
To get the most out of your data, though, it's best to follow a tracking plan. This way, you'll capture every step of the user's journey without missing important interactions, giving you a complete picture of how your app is used.
## Test your setup
Testing your SDK implementation is essential to make sure data is being accurately captured and reported.
To test your setup, simulate user interactions in your app and check that the events are logged correctly in our analytics platform.
You can also use debugging tools such as Android Studio, Xcode, or Log Visualizer to monitor data transmission and ensure everything is running smoothly.
### Visualize events in Contentsquare
Use [Log Visualizer](#contentsquare-log-visualizer) to view incoming events within the Contentsquare pipeline. This allows you to monitor the stream in real time.
By simulating user activity, you see incoming screenview and gesture events.
* Android

* iOS

### Visualize data in Contentsquare
Data availability
Data must be sessionized (meaning all events for a single session are gathered together) before it can be visualized. This requires the session to have ended, which happens 30 minutes after the last event is received. Therefore, you can expect to see the first replays 30 minutes after the last interaction with the app.
#### In Journey Analysis
[Open Journey Analysis ↗](https://app.contentsquare.com/#/analyze/navigation-path) in Contentsquare and visualize the user journeys main steps across your app, screen by screen.

See how to use Journey Analysis on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271761254161).
#### In Session Replay
[Open Session Replay ↗](https://app.contentsquare.com/#/session-replay) in Contentsquare and replay the full user session across your app.

See how to use Session Replay on the [Help Center ↗](https://support.contentsquare.com/hc/en-us/articles/37271667148561)
## Sample app
To explore some of these features in context, check our React Native sample apps.
### [react-native-sample-app](https://github.com/ContentSquare/react-native-sample-app)
[Sample apps illustrating how to use the Contentsquare Bridge for React Native in your app](https://github.com/ContentSquare/react-native-sample-app)
[TypeScript](https://github.com/ContentSquare/react-native-sample-app)
## Next Steps
While screen tracking gives an overview of user navigation, capturing session, screen, or user metadata provides a deeper understanding of the context behind user behavior.
Our SDK offers a wide range of features to enhance your implementation, including Session Replay, Error Monitoring, extended tracking capabilities, and personal data masking.
Proceed with these how-to's to refine your implementation.
[Custom Variables](https://docs.contentsquare.com/en/react-native/track-custom-variables/)Collect additional details about the screen or the user.
[Dynamic Variables](https://docs.contentsquare.com/en/react-native/track-dynamic-variables/)Collect additional information about the session.
[Transactions tracking](https://docs.contentsquare.com/en/react-native/track-transactions/)Associate user's session with their potential purchases and corresponding revenue.
[WebViews](https://docs.contentsquare.com/en/react-native/track-webviews/)For native apps which embark web applications or pages.
[Session Replay](https://docs.contentsquare.com/en/react-native/session-replay/)Collect data for Session Replay in compliance personal data masking.
[Error Analysis](https://docs.contentsquare.com/en/react-native/error-analysis/)Track API errors and application crashes with automated collection and privacy-safe debugging tools.
```json
{"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"Integrate the Contentsquare React Native bridge into your apps in minutes (installation, user consent, screen tracking, and testing)","url":"https://docs.contentsquare.com/en/react-native/","inLanguage":"en","dateModified":"2026-06-10T08:20:02+02:00","publisher":{"@type":"Organization","name":"Contentsquare","url":"https://www.contentsquare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://docs.contentsquare.com/#website","name":"Contentsquare Technical Documentation","url":"https://docs.contentsquare.com/"}}
```
---
title: The Main Tracking Tag - Web
description: The Contentsquare Main Tracking Tag or Main tag is the core 'pixel' or 'code snippet' to implement on your domain to collect analytics data
lastUpdated: 16 July 2026
source_url:
html: https://docs.contentsquare.com/en/web/
md: https://docs.contentsquare.com/en/web/index.md
---
> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.
The Contentsquare Main Tracking Tag or **Main tag** is the core 'pixel' or 'code snippet' that needs to be implemented on your domain to collect analytics data. It can be implemented **through a Tag Management System (TMS) or on the site's template**. Find step-by-step guides below.
before the implementation, you need to gather the following information:
* A **Contentsquare Tag ID** will be provided after kicking off the Contentsquare partnership. This 13-character unique ID can be used only on agreed domains — no data will be sent from elsewhere.
* You can provide **up to 20 custom variables** to enrich the analysis context with details about the pages or the user. They're usually collected from your datalayer or any other JavaScript object implemented throughout the site.
## AI-assisted setup
Use the Contentsquare wizard or skills to set up, update, and configure Web Tracking Tag with your AI coding assistant.
Disclaimer
This skill guides your AI coding agent through the SDK installation and implementation. The agent you use (Cursor, Claude Code, Copilot) is your own tool and operates under your settings and permissions. Contentsquare is not responsible for how your agent interprets or applies the instructions contained in these files.
### Contentsquare wizard
Run the wizard in your project directory. It configures your AI coding assistant, installs the matching Contentsquare integration, and verifies the installation.
```shell
npx @contentsquare/wizard install
```
Supports GitHub Copilot, Cursor, and Claude Code. Requires Node.js ≥ 18 and an AI coding agent with MCP support.
### Manual setup
Use this path when you prefer to configure your AI coding assistant yourself.
#### 1. Add the Contentsquare skill
Choose how to install the Contentsquare skill.
* Copilot CLI
Add the Contentsquare marketplace, then install the plugin for Web Tracking Tag:
```shell
copilot plugin marketplace add ContentSquare/agents
copilot plugin install contentsquare-web@contentsquare
```
* Claude Code
Add the Contentsquare marketplace, then install the plugin for Web Tracking Tag:
```shell
/plugin marketplace add ContentSquare/agents
/plugin install contentsquare-web@contentsquare
```
* Cursor
Install **contentsquare** from the [Cursor marketplace ↗](https://cursor.com/marketplace), or add the [Contentsquare agents repository ↗](https://github.com/ContentSquare/agents) directly. Cursor reads the `.cursor-plugin` catalog in the repository.
* Other agents
Install the Contentsquare skill pack with the open `skills.sh` ecosystem:
```shell
npx skills add contentsquare/agents
```
* From source
Download or clone the [Contentsquare agents repository ↗](https://github.com/ContentSquare/agents), then copy `skills/contentsquare-web-tag-install` into the location your AI coding assistant scans for skills:
| AI coding assistant | Skill location |
| - | - |
| GitHub Copilot | `.github/skills/` or `.agents/skills/` |
| Cursor | `.cursor/rules/` or the project root |
| Claude Code | `.claude/skills/` or the project root |
| Other compatible agents | `.agents/skills/` |
#### 2. Ask your AI coding assistant
After installing the skill, paste this prompt into your AI coding assistant:
```text
Add Contentsquare to my website using tag ID YOUR_TAG_ID.
```
Prefer to set things up manually? Use one of the following [Tag Management System](#google-tag-manager-template) guides, or the [Custom HTML](#custom-html) snippet.
## Google Tag Manager (Template)
1. Open your container and go to the **templates** section. 
2. Select **Search gallery**. 
3. Type in **`contentsquare`** and select the **Contentsquare - Main tag** option. 
4. Click **Add to workspace**. 
5. Confirm your choice by selecting **Add** 
6. Go to the Tags section and click the **New** button to create a new tag. 
7. Configure it by selecting the top-right button. 
8. Search for **`contentsquare`** and select the **Contentsquare - Main tag** template that you've previously added to your container. 
9. Give a title to the tag and input your Tag ID in the dedicated field. To configure Custom Variables, enter:
* The index, from 1 to 20 - unique numbers only.
* The name.
* The value itself, which will be taken from one of your GTM Variables.
* The scope — select `Page & Visit (2 & 3)`, or `Single Page App (nextPageOnly 4)` if your website/part of it is a Single Page Application. Check with Contentsquare contact if unsure.
10. Select the trigger: `All Pages` or `DOM Ready` (when data layer has been fully loaded). We suggest **All Pages**, as long as your selected variables will be populated by then.

11. (Optional) Mask Personal Data within the GTM GUI.
Select the appropriate Personal Data masking method, depending on the type of personal information you're looking to mask:
* **Define CSS Selectors** for text nodes. 
* **CSS Selectors** and **Data Attributes** for element attributes. 
12. Save your changes and go back to your container. You should now see both the template and the newly created tag. 
## Google Tag Manager (Custom HTML)
1. Add a **new tag** on your workspace. 
2. Select **"Choose a tag type to begin setup..."**. 
3. In the list, pick the **"Custom HTML"** tag. 
4. Depending on your data layer availability, take a look at the following code examples and populate it with the information required:
* Implementing the tag and **pushing** data layer variables to Contentsquare:
```html
```
* Implementing the tag **without pushing** data layer variables to Contentsquare:
```html
```

5. Select **"Choose a trigger to make this tag fire..."**. 
6. In the list, pick the "All pages" trigger, **provided the Datalayer will have been loaded** before firing our tag. 
7. Name your tag (for instance *Contentsquare Main Tag*), then click **"Save"**. 
## Tealium
1. Add a **new tag** to your containers by choosing "Contentsquare UX Analytics" 
2. Add your **"TAG ID"** and click "next" twice, keeping the default configuration. If you do not have custom variables, click **"Finish"** and the installation is over. 
3. (Optional) Add custom variables:
* Choose a datalayer Variable in the UDO list and select **Select Destination**
* Select "Custom"
* Add a variable Name
* Click **Add**
* Click **Close** and the mapped variable will appear


4. Click **"Apply"** or **repeat STEP 3 for additional variables**.

## Adobe Launch
### Installing the Contentsquare extension
1. Search for Contentsquare within **Extensions** and select **Install**. 
2. Enter your **Tag ID** (should be provided by your Contentsquare Implementation team).

If you want to disable the Contentsquare tag from being injected but still want to use other features, expand the **Additional Configuration** section and select the **Disable tag injection** checkbox. 
If you want to have your WebView tag automatically injected when in WebView mode, expand the **Additional Configuration** section, select the **Configure WebView Tag** checkbox and insert your WebView Tag ID (provided by Contentsquare). 
3. To pass information to Contentsquare via custom variables, select **Add New Variable** and fill the following fields:
* The index, from 1 to 20 - unique numbers only.
* The name.
* The value itself, which will be taken from one of your GTM Variables.
* The scope — select `Page & Visit (2 & 3)`, or `Single Page App (nextPageOnly 4)` if your website/part of it is a Single Page Application. Check with your Contentsquare contact if you're unsure.
Use **Data Elements** in the value fields, as they are the Launch built-in method of passing information between extensions.

4. (Optional) Select **Add P**II** Masking**.

5. Upon activating Personal Data Masking, select the appropriate masking method, depending on the type of personal information you're looking to mask:
* Masking textual Personal Data using CSS selectors:  Make sure that your CSS selectors are valid. 
* If non-textual personal information needs to be masked, use the below text box and template:

6. Save your changes to your working library and move to the next step.
### Firing the Main Tag
Navigate to **Rules**, and open an existing rule or create a new one.
### Event Configuration
Depending on your needs, [select the event](https://docs.contentsquare.com/en/web/custom-page-events/#adobe-launch) to be used from the **Core** extension.
### Default implementation
Take a look at some of the viable examples below:
#### Page Bottom

#### DOM ready

### Action Configuration
Select the **Main Tracking Tag Installation action** from the Contentsquare extension

If you don't need to further amend the path or the queries sent, **you can leave the action as it** is and press 'Keep Changes'

Should you need to override the path or the query, you can do so by selecting the element and writing the string to be used as a substitute. You can also create Data Elements and use them in these fields

Once you're done, your new rule should look similar to the following

You can now press save and move on to the next rule.
## Commanders Act
1. Add a **new tag** to your containers by choosing "Contentsquare - Tag Main (builder)". 
2. Add your previously provided Tag ID. 
3. Add the desired Custom Variables:
* At "Add customs variables" select "yes"
* Fill all request variables by adding a name and pick the matching variable from the datalayer. 
The Contentsquare Main Tag is ready to be deployed.
## Shopify
The Contentsquare Shopify app is the recommended installation method for all Shopify stores. It ensures comprehensive coverage of your storefront (Home, Product, Collections, etc.) and offers exclusive features for Shopify Plus merchants.
Follow [installation instructions](#shopify-installation) which include how to migrate from a [legacy setup](#shopify-legacy-manual-installation-deprecated).
### Available features
The Contentsquare Shopify app enables the following features based on your Shopify plan:
| | **Shopify non-Plus plans** | **Shopify Plus plan** |
| - | - | - |
| **On Storefront** | ✅ All Contentsquare capabilities | ✅ All Contentsquare capabilities |
| **On Checkout** | • pageview tracking • e-commerce events | All non-Plus features + **Session Replay** + **Zoning & Heatmaps** |
See the [Shopify pricing page ↗](https://www.shopify.com/pricing) for information about their plans.
### E-commerce tracking
The app automatically tracks e-commerce events at every step of the checkout process. This data is essential for building accurate mappings and segmenting your audience.
This works seamlessly for both single-page and multi-step checkout configurations.
**Data collected:**
* `orderID` — Unique transaction identifier
* `amount` — Transaction total
* `currency` — Transaction currency code
These data points become immediately available for segmentation and filtering in your Contentsquare workspace, for Contentsquare Pro and Enterprise plans.
### Installation
#### Step 0: Remove legacy integration
Warning
If you previously installed Contentsquare using the [custom web pixel](#shopify-legacy-manual-installation-deprecated), remove it before proceeding. Running both implementations will cause duplicate data collection.
1. Go to **Settings** > **Customer events**.
2. Find the Contentsquare pixel and select **Disconnect**.
#### Step 1: Install and configure the Contentsquare Shopify app
1. Install the [Contentsquare app ↗](https://apps.shopify.com/contentsquare) from the Shopify App Store.
2. In Shopify, open the Contentsquare app and go to the **Contentsquare data collection** section.
3. In **Data privacy contact**, enter the email address of the Data Protection Officer (DPO) or the person responsible for handling privacy requests. Contentsquare uses this address to forward privacy requests received from your visitors.
4. In **Connect to your Contentsquare projects**, map each automatically detected domain to a Tag ID:
* Find each Tag ID in the Contentsquare [Integration Catalog ↗](https://app.contentsquare.com/#/integrations/catalog) (search for **Shopify**).
* To send all of the store's domains to the same Contentsquare project, enter the same Tag ID for every domain.
* To split domains across several Contentsquare projects, enter the matching Tag ID for each domain.
* The same Shopify store can send data to several Contentsquare projects, and a single Contentsquare project can receive data from several Shopify stores or domains.
5. Click **Save**.
6. In the **Verify your domain configuration** dialog, review which domains will and will not be collected. Click **Go back and fix** to add missing Tag IDs, or **Save anyway** to confirm.
Unmapped domains lose checkout tracking
Checkout data is not collected for domains without a Tag ID. Storefront tracking continues for those domains as long as the Contentsquare tag is enabled on the storefront (see Step 2).
#### Step 2: Enable Contentsquare on storefront
Already using a TMS?
Skip this step if Contentsquare is already deployed via GTM or hard-coded. If GTM is also on checkout pages, exclude them from your GTM implementation to avoid duplicates.
1. Click **Add Contentsquare to storefront**.
2. In the Shopify theme editor, click **Save**.
#### Step 3: Enable Contentsquare on checkout
Warning
[Element Masking](https://docs.contentsquare.com/en/web/personal-data-handling/#remove-contentpersonal-data-from-the-collected-html) and [Element Unmasking](https://docs.contentsquare.com/en/web/personal-data-handling/#display-content-in-a-fully-masked-html-page) are not supported on Shopify checkout pages. Only Page Masking is supported.
1. Ensure **Page Masking (Automasking)** is applied to all checkout pages:
* Information
* Shipping
* Payment
* Thank you
* Order status
See how to manage page masking for [Free and Growth plans ↗](https://support.contentsquare.com/hc/en-us/articles/42799500061841-How-to-manage-tracking-data-collection-data-masking-and-IP-blocking) / [Pro and Enterprise plans ↗](https://support.contentsquare.com/hc/en-us/articles/40613380970385-How-to-set-up-and-manage-Page-Masking)
2. Click **Enable data collection on checkout** to capture pageviews on checkout pages. This also enables Session Replays, Heatmaps, and Zoning for Shopify Plus plans.
#### Advanced: Custom variables (Storefront)
To send custom variables to Contentsquare, define them before the main tracking tag loads.
Reference data from Liquid objects or tags:
```html
```
See [custom variables](https://docs.contentsquare.com/en/web/sending-custom-vars/#defining-custom-vars).
#### Advanced: Dynamic variables (Storefront)
Dynamic variables can be sent at any point during the pageview — they don't need to be defined before the Contentsquare tag loads.
Reference data from Liquid objects or tags:
```html
```
See [dynamic variables](https://docs.contentsquare.com/en/web/sending-dynamic-vars/#defining-dynamic-vars).
### Legacy manual installation (deprecated)
Deprecation notice
**This deployment method is deprecated.** Contentsquare has launched a [Shopify app](#shopify) that streamlines the implementation process for all Shopify customers.
**For Shopify Plus customers:** The Shopify app is required to capture user sessions during the checkout flow. Checkout session tracking is **only available** through the Contentsquare Shopify app on Shopify Plus plans. This legacy implementation method does not support checkout session capture.
Deprecated configuration (click to expand)
Note
To configure Contentsquare tags in your Shopify account, you need to be an admin on the account.
#### Base configuration
1. Within the main menu, select **Online Store > Themes**, then click the **Actions** drop-down menu, and **Edit Code**.

2. Under `Layout`, select the **theme.liquid** file.
3. Within the code editor, scroll down to the closing `` tag.
4. Copy the code below and replace `YOUR_TAG_ID` with your Contentsquare Tag ID:
```html
```
5. Paste the code above the closing `` tag.

6. Click `Save`.
#### Track the Checkout flow with Contentsquare Custom Web Pixel (Legacy)
Checkout liquid deprecations
Checkout Extensibility replaces `checkout.liquid`:
* For Checkout pages — deadline August 13, 2024,
* For Thank you and Order status pages — deadline August 28, 2025.
See how to deal with these changes below.
Tracking the Checkout flow is done via a custom pixel to add to your Shopify checkout. This custom pixel allows for sending a pageview and a dynamic variable to Contentsquare within each step of the checkout, for mapping and segmentation purposes, and track e-commerce transactions, all in one script.
This solution works for both single page and multi-step checkout scenarios.
Events collected are:
* `checkout_started`
* `checkout_contact_info_submitted`
* `checkout_address_info_submitted`
* `checkout_shipping_info_submitted`
* `payment_info_submitted`
* `checkout_completed`
* Ecommerce data:
* `orderID`
* `amount`
* `currency`
Once collected, these events are available for segmentation and filtering:

Limitations with Shopify Checkout Extensibility
* Custom variables are not part of the current pixel code tracking — you need to customize the script to send them in the checkout,
* No replay or Zoning metrics are available in the Checkout,
* The Contentsquare custom code in the checkout flow sends a pageview based on Shopify events. By default, it is **not subjected to user cookie consent**. Make sure to add your own cookie policy logic to the code provided below.
##### Adding the custom pixel to your checkout
1. Select `Settings` in the Shopify admin section.
2. Select `Customer events` then `Add custom pixel`.
3. Enter a name for the pixel such as `Contentsquare Checkout`.
4. Copy and paste the code below and replace `{{YOUR_TAG_ID}}` with your Contentsquare Tag ID:
```javascript
/*
*Name: Shopify CS Integration
*Version: 2.2.1
*/
const csTagID = "{{YOUR_TAG_ID}}";
const csTypeVendorPrefix = "CMS_SH_";
let submittedEvents = [];
function sendToCS(csKey, csValue, csPV, eventContext) {
csKey = csTypeVendorPrefix + csKey;
setTimeout(function () {
let setQuery;
127 collapsed lines
if (csPV && eventContext) {
const hash = eventContext.window.location.hash;
const query = eventContext.window.location.search;
setQuery = "?" + csPV;
if (hash) {
setQuery = hash.replace("#", "?__") + csPV;
} else {
if (query) {
setQuery = "?__" + csPV;
}
}
_uxa.push(["trackPageview", eventContext.window.location.pathname + setQuery]);
}
_uxa.push([
"trackDynamicVariable",
{
key: csKey,
value: csValue,
},
]);
}, 500);
}
function sendEcomCS(orderID, amount, currency) {
_uxa.push([
"ec:transaction:create",
{
id: orderID,
revenue: amount,
currency: currency,
},
]);
_uxa.push(["ec:transaction:send"]);
}
analytics.subscribe("page_viewed", (event) => {
if (
event.context.window.location.pathname.indexOf("/checkouts") > -1 &&
event.context.window.location.pathname.indexOf("/processing") === -1
) {
if (typeof CS_CONF === "undefined") {
window._uxa = window._uxa || [];
_uxa.push([
"setPath",
event.context.window.location.pathname +
event.context.window.location.hash.replace("#", "?__"),
]);
const mt = document.createElement("script");
mt.type = "text/javascript";
mt.async = true;
mt.src = "//t.contentsquare.net/uxa/" + csTagID + ".js";
document.getElementsByTagName("head")[0].appendChild(mt);
} else {
_uxa.push([
"trackPageview",
event.context.window.location.pathname +
event.context.window.location.hash.replace("#", "?__"),
]);
}
}
});
analytics.subscribe("checkout_started", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Checkout Started", "true", event.name, event.context);
}
});
analytics.subscribe("checkout_contact_info_submitted", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Checkout Contact Info Submitted", "true", event.name, event.context);
}
});
analytics.subscribe("checkout_address_info_submitted", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Checkout Address Info Submitted", "true", event.name, event.context);
}
});
analytics.subscribe("payment_info_submitted", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Payment Info Submitted", "true", event.name, event.context);
}
});
analytics.subscribe("checkout_shipping_info_submitted", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Checkout Shipping Info Submitted", "true", event.name, event.context);
}
});
analytics.subscribe("checkout_completed", (event) => {
if (!submittedEvents.includes(event.name)) {
submittedEvents.push(event.name);
sendToCS("Checkout Completed", "true", event.name, event.context);
const data = event.data || "";
const checkout = data.checkout || "";
const order = checkout.order || "";
const orderID = order.id;
const totalPrice = checkout.totalPrice || "";
const amount = totalPrice.amount;
const currency = totalPrice.currencyCode;
if (
typeof orderID != "undefined" &&
typeof amount != "undefined" &&
typeof currency != "undefined"
) {
sendEcomCS(orderID, amount, currency);
}
}
});
```
5. Select **Save** then **Connect**.
Note
If you are injecting the CS tags in the checkout via any other means (Tag Management System, or the soon to be deprecated "additional scripts" section in the Shopify checkout setting), make sure you block the firing of the CS Main Tag and E-Commerce tag from these other means.
For instance, if you have a CS E-Commerce tag in GTM, pause this tag in GTM as this new pixel you have just implemented tracks the entire checkout and the e-commerce transactions.
6. Test that pageviews are sent in the checkout. Make a transaction to test the e-commerce transaction is also sent as expected.
#### Sending custom variables
To send custom variables to Contentsquare, define them before the Contentsquare main tag.
Modify the keys and values to your needs: you can get values from your Liquid Objects or Liquid Tags.
```html
```
For more information, see the [setCustomVariable command](sending-custom-vars/).
#### Sending dynamic variables
You can send dynamic variables at any point in the pageview, they do not need to be set before the Contentsquare tag is loaded.
Modify the keys and values to your needs: you can get values from your Liquid Objects or Liquid Tags.
```html
```
For more information, see the [trackDynamicVariable command](sending-dynamic-vars/).
## Salesforce websites
Starting with Tracking Tag version `15.201.10`, Contentsquare supports Salesforce websites:
* **Lightning Web Components (LWC)** are supported out of the box.
* **Salesforce Experience Cloud websites** built with Experience Builder are supported when the tag is implemented with the privileged script tag and the expected Salesforce security settings.
* This scope includes both **Aura** and **Lightning Web Runtime (LWR)** templates.
* No Salesforce app, plugin, or AppExchange package is required: the standard Contentsquare tracking script is all that is needed, deployed via [HTML](#custom-html) or a tag manager.
For Experience Builder websites, follow these guidelines:
1. **Add Trusted URLs**
In **Salesforce Setup** (gear icon > Setup), search for **Trusted URLs** and add two entries:
**Contentsquare data collection**
* **API name:** `Contentsquare.net`
* **URL:** `https://*.contentsquare.net`
* **CSP Context:** All
* **Active:** Selected
* **CSP Directives:** `connect-src (scripts)`, `img-src (images)`, `frame-src (iframe content)`
**Contentsquare platform**
* **API name:** `Contentsquare.com`
* **URL:** `https://*.contentsquare.com`
* **CSP Context:** All
* **Active:** Selected
* **CSP Directives:** `connect-src (scripts)`, `frame-src (iframe content)`
2. **Configure CSP settings**
In **Experience Builder > Settings > Security & Privacy**, set **Security Level** to **Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts**. Then under **Trusted Sites for Scripts**, click **+ Add Trusted Site**, add Contentsquare (Name) and `https://t.contentsquare.net` (URL).
3. **Add the privileged script wrapper**
In **Experience Builder > Settings > Advanced > Head Markup**, place the following [privileged script tag ↗](https://developer.salesforce.com/docs/atlas.en-us.exp_cloud_lwr.meta/exp_cloud_lwr/advanced_privileged_script.htm). This is an empty wrapper required by Salesforce LWS to expose global variables through the shadow DOM — it does not load the tracking script itself:
```html
```
* `_uxa`: Required if you use Tag commands (for example, to mask sensitive data or track artificial pageviews).
* `CS_CONF`: Required if you use the [Tracking Setup Assistant extension ↗](https://chrome.google.com/webstore/detail/contentsquare-tracking-se/pfldcnnaiaiaogmpfdjjpdkpnigplfca).
* `UXAnalytics`: Prevents the tracking tag from initializing more than once.
4. **Add the Contentsquare tracking tag**
Add the standard Contentsquare tracking tag after the wrapper, either via your tag manager or directly in the same Head Markup field. The final Head Markup should look like this:
```html
```
### Troubleshooting
`Uncaught [object Object]` error when saving Head Markup
The tracking script payload was pasted inside the `` tag. Remove the payload. Only the empty wrapper should be in Head Markup. The tracking script belongs in your tag manager or as a separate `
```
This code creates a function which will add an asynchronous call to a script and then run the function. This is a way to avoid other elements loading being blocked on the page. This reduces the impact of the tag on the website's performance.
Note
**`async` vs `defer`**
The previous loader sets `mt.async = true` because `defer` has no effect on scripts created dynamically via `document.createElement`. The browser ignores it, and the script loads asynchronously by default.
If you are pasting a static `
```
`defer` is only honored on parser-inserted `
```
Position the tag before the closing `