Set up Product Analytics data capture
This page instructs how to set up data capture in the context of the User Lifecycle Extension for Experience Analytics.
-
Add your Product Analytics Environment ID using
CSQ.configureProductAnalytics().App.js import { CSQ } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.configureProductAnalytics({envId: "YOUR_ENVIRONMENT_ID",});}, []); -
Recommended To capture screenviews automatically, enable autocapture by setting
enableRNAutocapturetotrue.App.js import { CSQ } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.configureProductAnalytics({envId: "YOUR_ENVIRONMENT_ID",enableRNAutocapture: true,});}, []); -
Recommended To capture user interactions automatically, add the option
disableInteractionAutocapture: false:App.js import { CSQ } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.configureProductAnalytics({envId: "YOUR_ENVIRONMENT_ID",enableRNAutocapture: true,disableInteractionAutocapture: false,});CSQ.start();}, []); -
(Optional) If your Product Analytics environment is hosted in the EU, set the
baseUrioption tohttps://mh.ba.contentsquare.net.App.js import { CSQ } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.configureProductAnalytics({envId: "YOUR_ENVIRONMENT_ID",enableRNAutocapture: true,disableInteractionAutocapture: false,baseUrl: "https://mh.ba.contentsquare.net",});}, []); -
Add the
resumePreviousSession: trueanddisablePageviewAutocapture: trueoptions to the configuration.App.js import { CSQ } from "@contentsquare/react-native-bridge";useEffect(() => {CSQ.configureProductAnalytics({envId: "YOUR_ENVIRONMENT_ID",enableRNAutocapture: true,disableInteractionAutocapture: false,resumePreviousSession: true,disablePageviewAutocapture: true,});}, []);