Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// })
// );
}
if (routeName === 'ExpandedAssetScreen') {
const { asset, type } = params;
paramsToTrack = {
assetContractAddress:
asset.address || get(asset, 'asset_contract.address'),
assetName: asset.name,
assetSymbol: asset.symbol || get(asset, 'asset_contract.symbol'),
assetType: type,
};
}
return analytics.screen(routeName, paramsToTrack);
}
}}
ref={ref}
onNavigationStateChange={(prevState, currentState) => {
const { params, routeName } = Navigation.getActiveRoute(currentState);
const prevRouteName = Navigation.getActiveRouteName(prevState);
// native stack rn does not support onTransitionEnd and onTransitionStart
if (
prevRouteName === 'ImportSeedPhraseSheet' &&
(routeName === 'ProfileScreen' || routeName === 'WalletScreen')
) {
StatusBar.setBarStyle('dark-content');
}
if (routeName === 'SettingsModal') {
let subRoute = get(params, 'section.title');
if (subRoute === 'Settings') subRoute = null;
return analytics.screen(
`${routeName}${subRoute ? `>${subRoute}` : ''}`
);
}
if (routeName !== prevRouteName) {
let paramsToTrack = null;
if (
prevRouteName === 'MainExchangeScreen' &&
routeName === 'WalletScreen'
) {
// store.dispatch(updateTransitionProps({ blurColor: null }));
} else if (
prevRouteName === 'WalletScreen' &&
routeName === 'MainExchangeScreen'
) {
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 screenHome = () => analytics.screen('Home')
const screenHome = () => analytics.screen('Home')
properties: ?Object,
) => {
const title = category + (name ? " " + name : "");
Sentry.captureBreadcrumb({
message: title,
category: "screen",
data: properties,
level: "info",
});
if (!storeInstance || !analyticsEnabledSelector(storeInstance.getState())) {
return;
}
if (ANALYTICS_LOGS)
console.log("analytics:screen", category, name, properties);
if (!token) return;
analytics.screen(title, {
...extraProperties(storeInstance),
...properties,
});
};
page(page: string, eventProperties: {}) {
if (!this.apiKey) {
return
}
const props = this.getProps(eventProperties)
Analytics.screen(page, props).catch((err) => {
this.Logger.error(TAG, 'Error tracking page', err)
})
}