Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const trackOrder = () => {
analytics.track('Order Completed')
analytics.track('Order Cancelled', {
order_id: 323
})
analytics.identify('userIdOnly')
analytics.identify('userId', {
age: 32
})
analytics.alias('newlyAliasedId')
analytics.screen('User Login Screen', {
method: 'google'
})
}
const trackOrder = () => {
analytics.track('Order Completed')
analytics.track('Order Cancelled', {
order_id: 323
})
analytics.identify('userIdOnly')
analytics.identify('userId', {
age: 32
})
analytics.alias('newlyAliasedId')
analytics.screen('User Login Screen', {
method: 'google'
})
}
const trackOrder = () => {
analytics.track('Order Completed')
analytics.track('Order Cancelled', {
order_id: 323
})
analytics.identify('userIdOnly')
analytics.identify('userId', {
age: 32
})
analytics.alias('newlyAliasedId')
analytics.screen('User Login Screen', {
method: 'google'
})
}
const trackOrder = () => {
analytics.track('Order Completed')
analytics.track('Order Cancelled', {
order_id: 323
})
analytics.identify('userIdOnly')
analytics.identify('userId', {
age: 32
})
analytics.alias('newlyAliasedId')
analytics.screen('User Login Screen', {
method: 'google'
})
}
collectDeviceId: false,
},
ios: {
trackAdvertising: false,
trackDeepLinks: false,
},
});
}
const { user, created } = await getOrCreateUser();
storeInstance = store;
if (created) {
if (ANALYTICS_LOGS) console.log("analytics:identify", user.id);
if (token) {
await analytics.reset();
await analytics.identify(user.id, extraProperties(store));
}
}
track("Start", extraProperties(store), true);
};
handleInitializeAnalytics = async () => {
const storedIdentifier = await keychain.loadString('analyticsUserIdentifier');
if (!storedIdentifier) {
const identifier = await RNIOS11DeviceCheck.getToken()
.then((deviceId) => deviceId)
.catch(() => nanoid());
await keychain.saveString('analyticsUserIdentifier', identifier);
analytics.identify(identifier);
}
await analytics.setup(REACT_APP_SEGMENT_API_WRITE_KEY, {
ios: {
trackDeepLinks: true,
},
trackAppLifecycleEvents: true,
trackAttributionData: true,
});
}