Getting Started with Product Analytics
This quick start guide shows you how to get Contentsquare Product Analytics set up in an Android application.
AI-assisted setup
Section titled AI-assisted setupUse the Contentsquare wizard or skills to set up, update, and configure Android with your AI coding assistant.
Contentsquare wizard
Section titled Contentsquare wizardRun the wizard in your project directory. It configures your AI coding assistant, installs the matching Contentsquare integration, and verifies the installation.
npx @contentsquare/wizard installSupports GitHub Copilot, Cursor, and Claude Code. Requires Node.js ≥ 18 and an AI coding agent with MCP support.
Configure assistant manually
Section titled Configure assistant manuallyUse this path when you prefer to configure your AI coding assistant yourself.
1. Add the Contentsquare skill
Section titled 1. Add the Contentsquare skillChoose how to install the Contentsquare skill.
Add the Contentsquare marketplace, then install the plugin for Android:
copilot plugin marketplace add ContentSquare/agentscopilot plugin install contentsquare-android@contentsquareAdd the Contentsquare marketplace, then install the plugin for Android:
/plugin marketplace add ContentSquare/agents/plugin install contentsquare-android@contentsquareInstall contentsquare from the Cursor marketplace ↗, or add the Contentsquare agents repository ↗ directly. Cursor reads the .cursor-plugin catalog in the repository.
Install the Contentsquare skill pack with the open skills.sh ecosystem:
npx skills add contentsquare/agentsDownload or clone the Contentsquare agents repository ↗, then copy skills/contentsquare-android-sdk 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
Section titled 2. Ask your AI coding assistantAfter installing the skill, paste this prompt into your AI coding assistant:
Install Contentsquare for Android.Prefer to set things up manually? Continue with the steps below.
Manual setup
Section titled Manual setupOnce you've completed the setup process, the Contentsquare SDK will capture a wide variety of user interactions in your application with no additional code required.
Install the SDK
Section titled Install the SDK-
In your app-level
build.gradlefile, add the dependency for the CSQ SDK and the CSQ Compose SDK.build.gradle.kts dependencies {implementation("com.contentsquare.android:sdk:1.12.3")implementation("com.contentsquare.android:sdk-compose:1.12.3")}build.gradle dependencies {implementation 'com.contentsquare.android:sdk:1.12.3'implementation 'com.contentsquare.android:sdk-compose:1.12.3'} -
Add the Android View Autocapture Plugin to instrument your app code:
build.gradle.kts plugins {// ...id("io.heap.gradle") version "1.1.3"}build.gradle plugins {// ...id 'io.heap.gradle' version "1.1.3"} -
Once the dependencies and plugins have been added, sync Gradle and rebuild your application.
Start the SDK
Section titled Start the SDK-
Configure and start the SDK with
CSQ.start().- Product Analytics
- CSQ Experience Platform (Early Access)
Get Early Access to CSQ Experience Platform, our latest, all-in-one offering.
Reach out to your Customer Success Manager to join the Early Access Program.
MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(context = this,StartConfig.withEnvironmentId(id = "YOUR_ENVIRONMENT_ID"))}}MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(context = this,StartConfig.withDataSourceId(id = "YOUR_DATASOURCE_ID"))}} -
Enable autocapture by setting
enableViewAutocapturetotrue.- Product Analytics
- CSQ Experience Platform (Early Access)
Get Early Access to CSQ Experience Platform, our latest, all-in-one offering.
Reach out to your Customer Success Manager to join the Early Access Program.
MyApplication.kt CSQ.start(context = this,StartConfig.withEnvironmentId(id = "YOUR_ENVIRONMENT_ID",options = AnalyticsOptions(enableViewAutocapture = true)))MyApplication.kt CSQ.start(context = this,StartConfig.withDataSourceId(id = "YOUR_DATASOURCE_ID",options = AnalyticsOptions(enableViewAutocapture = true))) -
(Optional) For Jetpack Compose, register the Compose Autocapture SDK.
- Product Analytics
- CSQ Experience Platform (Early Access)
Get Early Access to CSQ Experience Platform, our latest, all-in-one offering.
Reach out to your Customer Success Manager to join the Early Access Program.
MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQimport io.heap.autocapture.compose.ComposeAutocaptureSDKclass MyApplication : Application() {override fun onCreate() {super.onCreate()ComposeAutocaptureSDK.register()CSQ.start(context = this,StartConfig.withEnvironmentId(id = "YOUR_ENVIRONMENT_ID",options = AnalyticsOptions(enableViewAutocapture = true)))}}MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQimport io.heap.autocapture.compose.ComposeAutocaptureSDKclass MyApplication : Application() {override fun onCreate() {super.onCreate()ComposeAutocaptureSDK.register()CSQ.start(context = this,StartConfig.withDataSourceId(id = "YOUR_DATASOURCE_ID",options = AnalyticsOptions(enableViewAutocapture = true)))}} -
(Optional) If your Product Analytics environment is hosted in the EU, set the
baseUrioption tohttps://mh.ba.contentsquare.net.- Product Analytics
- CSQ Experience Platform (Early Access)
Get Early Access to CSQ Experience Platform, our latest, all-in-one offering.
Reach out to your Customer Success Manager to join the Early Access Program.
MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(context = this,StartConfig.withEnvironmentId(id = "YOUR_ENVIRONMENT_ID",options = AnalyticsOptions(enableViewAutocapture = true,baseUri = URI.create("https://mh.ba.contentsquare.net"))))}}MyApplication.kt import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(context = this,StartConfig.withDataSourceId(id = "YOUR_DATASOURCE_ID",options = AnalyticsOptions(enableViewAutocapture = true,baseUri = URI.create("https://mh.ba.contentsquare.net"))))}} -
Implement the
optIn()API to forward user consent to the SDK, generate a user ID, and initiate tracking.- Product Analytics
- CSQ Experience Platform (Early Access)
Get Early Access to CSQ Experience Platform, our latest, all-in-one offering.
Reach out to your Customer Success Manager to join the Early Access Program.
import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(this, StartConfig.withEnvironmentId("YOUR_ENVIRONMENT_ID"))}}// ConsentActivityval optinButton: Button = findViewById(R.id.btn_accept_tracking)optinButton.setOnClickListener {CSQ.optIn()startActivity(Intent(this, MainActivity::class.java))}import android.app.Applicationimport com.contentsquare.CSQclass MyApplication : Application() {override fun onCreate() {super.onCreate()CSQ.start(this, StartConfig.withDataSourceId("YOUR_DATASOURCE_ID"))}}// ConsentActivityval optinButton: Button = findViewById(R.id.btn_accept_tracking)optinButton.setOnClickListener {CSQ.optIn()startActivity(Intent(this, MainActivity::class.java))}Once tracking has started, you're able to take full advantage of the CSQ SDK API to identify users, track custom events, and more.
Contentsquare's Product Analytics module will also automatically start tracking a wide range of user interactions, view controller changes, and app version changes without any additional code.
-
Start your application, and check logs for this output:
[INFO] CSQ 1.12.3 for Product Analytics is attempting to start.
Next steps
Section titled Next stepsOur SDK offers a wide range of features to enhance your implementation, including extended tracking capabilities, and personal data masking.
Session Replay and Error Monitoring are both available with the Experience Analytics extension, which you can purchase separately.

