Getting Started with Product Analytics
This quick start guide shows you how to get Contentsquare Product Analytics set up in a React Native application.
AI-assisted setup
Section titled AI-assisted setupUse the Contentsquare wizard or skills to set up, update, and configure React Native 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 React Native:
copilot plugin marketplace add ContentSquare/agentscopilot plugin install contentsquare-reactnative@contentsquareAdd the Contentsquare marketplace, then install the plugin for React Native:
/plugin marketplace add ContentSquare/agents/plugin install contentsquare-reactnative@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-reactnative-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 React Native.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 SDKThe CSQ React Native SDK is available as an NPM package ↗, which includes the bridge and the necessary dependencies for specific versions of the SDKs.
To install the CSQ React Native SDK, open a terminal and run the following commands from your application's root directory:
yarn add @contentsquare/react-native-bridgecd ios && pod installnpm install @contentsquare/react-native-bridgecd ios && pod installAdd the React Native Babel Autocapture Plugin to instrument your app code:
In your babel.config.js file, add @contentsquare/react-native-bridge/babel to the plugins array:
module.exports = { presets: ['module:@react-native/babel-preset'], plugins: ['@contentsquare/react-native-bridge/babel'],};Make sure to add the plugin to all relevant babel.config.js files in your project, including those in any packages that contain React Native code.
Start the SDK
Section titled Start the SDK-
Configure and start the SDK with
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.
App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withEnvironmentId("YOUR_ENVIRONMENT_ID"));}, []);App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withDataSourceId("YOUR_DATASOURCE_ID"));}, []); -
To capture interactions and screenviews automatically, enable autocapture by setting
enableRNAutocapturetotrue. Review supported navigation libraries in the compatibility section.- 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.
App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withEnvironmentId("YOUR_ENVIRONMENT_ID", {enableRNAutocapture: true,}));}, []);App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withDataSourceId("YOUR_DATASOURCE_ID", {enableRNAutocapture: true,}));}, []); -
(Optional) If your Product Analytics environment is hosted in the EU, set the
baseUrloption 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.
App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withEnvironmentId("YOUR_ENVIRONMENT_ID", {enableRNAutocapture: true,baseUrl: "https://mh.ba.contentsquare.net",}));}, []);App.js import { CSQ, StartConfig } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.start(StartConfig.withDataSourceId("YOUR_DATASOURCE_ID", {enableRNAutocapture: true,baseUrl: "https://mh.ba.contentsquare.net",}));}, []); -
Implement the
optIn()API to forward user consent to the SDK, generate a user ID, and initiate tracking.import React, { useState } from "react";import { View, Text, Button } from "react-native";import { CSQ } from "@contentsquare/react-native-bridge";const PolicyConsentScreen = () => {const [isTrackingAccepted, setIsTrackingAccepted] = useState(false);const handleAcceptPolicy = () => {setIsTrackingAccepted(true);CSQ.optIn();};return (<View><Text>Please accept our privacy policy to proceed.</Text><Button title="Accept Policy" onPress={handleAcceptPolicy} /></View>);};export default PolicyConsentScreen;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 6.5.0 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.

