Note
Cette page est affichée en anglais car elle n'est pas disponible dans votre langue.
A newer version of this documentation is available. Switch to the
latest version
docs.
Analyze your data from anywhere in the customer journey using your Adobe Analytics segments.
Contentsquare allows you to use your Adobe Analytics segments in every Contentsquare feature (Journey Analysis, Page Comparator, Zoning Analysis, Session Replay).
Attention
Sessions without at least one screenview will be discarded.
You should implement your screen tracking plan first, to have your Adobe Analytics integration work.
See Track screens .
Follow the instructions from Adobe Analytics for mobile apps ↗
Add the React Native AEP ↗ to your project
Note
Adobe SDK code requirements
On the native Android and iOS parts of your React Native project, make sure you have registered at least Edge Network
and Edge Identity
extension before starting MobileCore
.
Check React Native AEP repository ↗ for the code to put in the Android and iOS native parts.
Why 30 minutes before sending a new csMatchingKey
30 minutes is Contentsquare default session duration.
Setting a value higher than 30 minutes would cause overlapping on our sessions, and would impact negatively the data import from Adobe.
Setting a value lower than 30 minutes would make you to send more data to Adobe.
This could cause the variable to reach Adobe’s threshold, causing Adobe to filter values, and potentially impact your billing.
See Low-traffic value in Adobe Analytics ↗
Add the following code snippet in your application code.
import { Edge , ExperienceEvent } from '@adobe/react-native-aepedge' ;
import Contentsquare from '@contentsquare/react-native-bridge' ;
// TODO: Use local storage you prefer here
import AsyncStorage from '@react-native-async-storage/async-storage' ;
export async function sendCSMatchingKeyIfNeeded () {
const csMatchingKeyRecord = await AsyncStorage . getItem (
'csMatchingKey_creation_ts'
if ( ! csMatchingKeyRecord) {
await submitNewCsMatchingKey () ;
const { timestamp } = JSON . parse (csMatchingKeyRecord) ;
if (Date . now () - timestamp > 30 * 60 * 1000 ) {
// if the key is not valid anymore, submit a new one
await submitNewCsMatchingKey () ;
// if the key is still valid, do nothing
async function submitNewCsMatchingKey () {
// Generate the matching key and store it in the local storage
const csMatchingKeyValue = ` ${ Math . random () } _ ${ Date . now () } ` ;
const newCsMatchingKeyRecord = {
csMatchingKey : csMatchingKeyValue ,
await AsyncStorage . setItem (
'csMatchingKey_creation_ts' ,
JSON . stringify (newCsMatchingKeyRecord)
// Submit the matching key to Contentsquare and Adobe
Contentsquare . sendDynamicVar ( 'csMatchingKey' , csMatchingKeyValue) ;
const xdmData = { eventType : 'csMatchingKey_state' };
const data = { csMatchingKey : csMatchingKeyValue };
const experienceEvent = new ExperienceEvent (xdmData , data) ;
Edge . sendEvent (experienceEvent) ;
Add a call to the sendCSMatchingKeyIfNeeded()
from within the index.js
file of your project root folder when app state changes to ‘active’.
import { AppState } from 'react-native' ;
import { sendCSMatchingKeyIfNeeded } from './adobe-analytics.js' ;
// Listen for app state changes to foreground
AppState . addEventListener ( 'change' , (nextAppState) => {
if (nextAppState === 'active' ) {
sendCSMatchingKeyIfNeeded () ;
How to use deprecated React Native AEP Analytics Extension Add the following code snippet in your application code. Add a call to the updateCsMatchingKey()
from within the index.js
file of your project root folder.
import { ACPCore } from '@adobe/react-native-acpcore' ;
import Contentsquare from '@contentsquare/react-native-bridge' ;
// TODO: Use local storage you prefer here
import AsyncStorage from '@react-native-community/async-storage' ;
export async function updateCsMatchingKey () {
const csMatchingKeyRecord = await AsyncStorage . getItem (
'csMatchingKey_creation_ts'
if ( ! csMatchingKeyRecord) {
await submitNewCsMatchingKey () ;
const { timestamp } = JSON . parse (csMatchingKeyRecord) ;
if (Date . now () - timestamp > 30 * 60 * 1000 ) {
// if the key is not valid anymore, submit a new one
await submitNewCsMatchingKey () ;
// if the key is still valid, do nothing
async function submitNewCsMatchingKey () {
// Generate the matching key and store it in the local storage
const csMatchingKeyValue = ` ${ Math . random () } _ ${ Date . now () } ` ;
const newCsMatchingKeyRecord = {
csMatchingKey : csMatchingKeyValue ,
await AsyncStorage . setItem (
'csMatchingKey_creation_ts' ,
JSON . stringify (newCsMatchingKeyRecord)
// Submit the matching key to Contentsquare and Adobe
Contentsquare . sendDynamicVar ( 'csMatchingKey' , csMatchingKeyValue) ;
ACPCore . trackState ( 'csMatchingKey_state' , {
csMatchingKey : csMatchingKeyValue ,