---
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: 12 February 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
---

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

1. Initialize the Product Analytics configuration with your environment ID.

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


   void main() async {
    await CSQ().configureProductAnalytics(
      environmentId: 'YOUR_ENVIRONMENT_ID',
    );


    await CSQ().start();
   }
   ```

   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:

   ```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 In order to enable automatic capture of user interactions, add the option `enableInteractionsAutocapture: true` to your `ProductAnalyticsOptions` configuration:

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


   void main() async {
     await CSQ().configureProductAnalytics(
       environmentId: 'YOUR_ENVIRONMENT_ID',
       options: ProductAnalyticsOptions(
         enableInteractionsAutocapture: true,
       ),
     );
     await CSQ().start();
   }
   ```

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

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


   void main() async {
     await CSQ().configureProductAnalytics(
       environmentId: 'YOUR_ENVIRONMENT_ID',
       options: ProductAnalyticsOptions(
         baseUrl: 'https://mh.ba.contentsquare.net',
       ),
     );


     await CSQ().start();
   }
   ```

5. Add the `resumePreviousSession: true` and `disablePageviewAutocapture: true` options to the configuration.

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


   void main() async {
     await CSQ().configureProductAnalytics(
       environmentId: 'YOUR_ENVIRONMENT_ID',
       options: ProductAnalyticsOptions(
         resumePreviousSession: true,
         disablePageviewAutocapture: true,
       ),
     );


     await CSQ().start();
   }
   ```
