How to use the @segment/analytics-react-native.track 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 / components / send / SendAssetFormField.js View on Github external
onPressButton: ({ onPressButton }) => (event) => {
      analytics.track('Clicked "Max" in Send flow input');

      if (onPressButton) {
        onPressButton(event);
      }
    },
  }),
github rainbow-me / rainbow / src / screens / ImportSeedPhraseSheet.js View on Github external
.then(success => {
            if (success) {
              toggleImporting(false);
              analytics.track('Imported seed phrase', {
                hadPreviousAddressWithValue: isEmpty,
              });
              navigate('WalletScreen');
            } else {
              toggleImporting(false);
            }
          })
          .catch(error => {
github rainbow-me / rainbow / src / components / settings-menu / LanguageSection.js View on Github external
onSelectLanguage: ({ settingsChangeLanguage }) => (language) => {
      settingsChangeLanguage(language);
      analytics.track('Changed language', { language });
    },
  }),
github rainbow-me / rainbow / src / screens / QRScannerScreenWithData.js View on Github external
handleScanSuccess = async ({ data }) => {
    const {
      walletConnectOnSessionRequest,
      navigation,
      setSafeTimeout,
    } = this.props;

    if (!data) return null;
    this.setState({ enableScanning: false });
    Vibration.vibrate();

    const address = await addressUtils.getEthereumAddressFromQRCodeData(data);

    if (address) {
      analytics.track('Scanned address QR code');
      navigation.navigate('WalletScreen');
      navigation.navigate('SendSheet', { address });
      return setSafeTimeout(this.handleReenableScanning, 1000);
    }

    if (data.startsWith('wc:')) {
      analytics.track('Scanned WalletConnect QR code');
      await walletConnectOnSessionRequest(data);
      return setSafeTimeout(this.handleReenableScanning, 2000);
    }

    analytics.track('Scanned broken or unsupported QR code', { qrCodeData: data });
    return Alert({
      callback: this.handleReenableScanning,
      message: lang.t('wallet.unrecognized_qrcode'),
      title: lang.t('wallet.unrecognized_qrcode_title'),
github rainbow-me / rainbow / src / screens / SendSheet.js View on Github external
onChangeAssetAmount = assetAmount => {
    if (isString(assetAmount)) {
      this.props.sendUpdateAssetAmount(assetAmount);
      analytics.track('Changed token input in Send flow');
    }
  };
github rainbow-me / rainbow / src / screens / SendSheet.js View on Github external
.then(() => {
        this.setState({ isAuthorizing: false });
        analytics.track('Sent transaction', {
          assetName: selected.name,
          assetType: selected.isNft ? 'unique_token' : 'token',
          isRecepientENS: toLower(recipient.slice(-4)) === '.eth',
        });
        sendClearFields();
        navigation.navigate('ProfileScreen');
      })
      .catch(() => {
github rainbow-me / rainbow / src / components / settings-menu / BackupSection.js View on Github external
.then((keychainValue) => {
            setSeedPhrase(keychainValue);
            analytics.track('Viewed backup seed phrase text');
          })
          .catch(hideSeedPhrase);
github mapswipe / mapswipe / src / shared / actions / index.js View on Github external
export function commitGroupSuccess(projectId: string, groupId: string): CommitGroupSuccess {
    analytics.track('Mapswipe Mobile - Completed Group', {
      projectId,
      groupId,
    });
    return { type: COMMIT_GROUP_SUCCESS, projectId, groupId };
}
github rainbow-me / rainbow / src / screens / SendSheetWithData.js View on Github external
onResetAssetSelection = () => {
    analytics.track('Reset asset selection in Send flow');
    this.sendUpdateSelected({});
  };
github mapswipe / mapswipe / src / shared / actions / index.js View on Github external
export function commitGroupFailed(
    projectId: string,
    groupId: string,
    error: {},
): CommitGroupFailed {
    analytics.track('Mapswipe Mobile - Failed Group ', {
      projectId,
      groupId,
      error,
    });
    return {
        type: COMMIT_GROUP_FAILED,
        projectId,
        groupId,
        error,
    };
}