How to use the @segment/analytics-react-native.screen function in @segment/analytics-react-native

To help you get started, we’ve selected a few @segment/analytics-react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rainbow-me / rainbow / src / screens / Routes.js View on Github external
//   })
          // );
        }

        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}
github rainbow-me / rainbow / src / screens / Routes.js View on Github external
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'
        ) {
github segmentio / analytics-react-native / packages / test-app / seed / App.tsx View on Github external
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'
  })
}
github segmentio / analytics-react-native / packages / test-app / App.js View on Github external
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'
	})
}
github LedgerHQ / ledger-live-mobile / src / analytics / segment.js View on Github external
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,
  });
};
github celo-org / celo-monorepo / packages / react-components / analytics / CeloAnalytics.tsx View on Github external
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)
    })
  }