---
title: Set up Product Analytics data capture - Flutter
description: Access to acquisition analysis and lifetime metrics by implementing the Product Analytics data capture using the CSQ SDK
lastUpdated: 02 June 2026
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/set-up-product-analytics-data-capture/
  md: https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/set-up-product-analytics-data-capture/index.md
---

> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.

This page instructs how to set up Product Analytics data capture in combination with Experience Analytics.

1. Initialize the CSQ SDK with your environment ID.

   * Standalone

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withEnvironmentId(
           id: 'YOUR_ENVIRONMENT_ID',
         ),
       );
     }
     ```

   * CSQ Experience Platform

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withDatasourceId(
           id: 'YOUR_DATASOURCE_ID',
         ),
       );
     }
     ```

   Find your environment ID

   `YOUR_ENVIRONMENT_ID` is either provided to you by Contentsquare or you can find it in **Account** > **Manage** > **Projects** > \[Select your project] > **Environments** within the [Product Analytics web app ↗](https://heapanalytics.com/app/).

2. Recommended To capture screen views automatically, add the `CSQNavigatorObserver` to your app's navigator observers:

   **main.dart**

   ```dart
   import 'package:contentsquare/csq.dart';


   MaterialApp(
     navigatorObservers: [
       CSQNavigatorObserver(),
     ],
     home: MyHomePage(),
   )
   ```

   More details in [Track screens](https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/track-screens/).

3. Recommended To enable automatic capture of user interactions, add the option `enableInteractionsAutocapture: true` to your `AnalyticsOptions` configuration:

   * Standalone

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withEnvironmentId(
           id: 'YOUR_ENVIRONMENT_ID',
           options: AnalyticsOptions(
             enableInteractionsAutocapture: true,
           ),
         ),
       );
     }
     ```

   * CSQ Experience Platform

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withDatasourceId(
           id: 'YOUR_DATASOURCE_ID',
           options: AnalyticsOptions(
             enableInteractionsAutocapture: true,
           ),
         ),
       );
     }
     ```

4. (Optional) If your Product Analytics environment is hosted in the EU, set the `baseUrl` option to `https://mh.ba.contentsquare.net`.

   * Standalone

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withEnvironmentId(
           id: 'YOUR_ENVIRONMENT_ID',
           options: AnalyticsOptions(
             baseUrl: Uri.parse('https://mh.ba.contentsquare.net'),
           ),
         ),
       );
     }
     ```

   * CSQ Experience Platform

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withDatasourceId(
           id: 'YOUR_DATASOURCE_ID',
           options: AnalyticsOptions(
             baseUrl: Uri.parse('https://mh.ba.contentsquare.net'),
           ),
         ),
       );
     }
     ```

5. Add the `disablePageviewAutocapture: true` option to the configuration.

   * Standalone

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withEnvironmentId(
           id: 'YOUR_ENVIRONMENT_ID',
           options: AnalyticsOptions(
             disablePageviewAutocapture: true,
           ),
         ),
       );
     }
     ```

   * CSQ Experience Platform

     **main.dart**

     ```dart
     import 'package:contentsquare/csq.dart';


     void main() async {
       await CSQ().start(
         startConfig: StartConfig.withDatasourceId(
           id: 'YOUR_DATASOURCE_ID',
           options: AnalyticsOptions(
             disablePageviewAutocapture: true,
           ),
         ),
       );
     }
     ```
