How to use the react-native-mixpanel.track function in react-native-mixpanel

To help you get started, we’ve selected a few react-native-mixpanel 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 mikelambert / dancedeets-monorepo / js / store / track.js View on Github external
function initMixpanel() {
  if (!trackingEnabled) {
    return;
  }
  let mixpanelApiKey = null;
  if (__DEV__) {
    mixpanelApiKey = '668941ad91e251d2ae9408b1ea80f67b';
  } else {
    mixpanelApiKey = 'f5d9d18ed1bbe3b190f9c7c7388df243';
  }

  const mixpanel = Mixpanel.sharedInstanceWithToken(mixpanelApiKey);
  // Don't use global track(), since this is a Mixpanel-only event:
  Mixpanel.track('$app_open');
  return mixpanel;
}
github DefinitelyTyped / DefinitelyTyped / types / react-native-mixpanel / react-native-mixpanel-tests.ts View on Github external
import * as Mixpanel from 'react-native-mixpanel';

Mixpanel.sharedInstanceWithToken('1234567890');
Mixpanel.track('Event name');
Mixpanel.trackWithProperties('Click Button', { button_type: 'yellow button', button_text: 'magic button' });
Mixpanel.createAlias('123456');
Mixpanel.identify('123456');
Mixpanel.set({ $email: 'elvis@email.com' });
Mixpanel.setOnce({ $email: 'elvis@email.com', Created: new Date().toISOString() });
Mixpanel.timeEvent('Image Upload');
Mixpanel.track('Image Upload');
Mixpanel.registerSuperProperties({ 'Account type': 'Free', 'User Type': 'Vendor' });
Mixpanel.registerSuperPropertiesOnce({ Gender: 'Female' });
Mixpanel.trackCharge(399);
Mixpanel.trackChargeWithProperties(399, { product: 'ACME Wearable tech' });
Mixpanel.increment("Login Count", 1);
Mixpanel.setPushRegistrationId('1234567890abc');
Mixpanel.initPushHandling('123456666');
Mixpanel.clearPushRegistrationId();
Mixpanel.addPushDeviceToken('1234567890abc');
github arjunkomath / Feline-for-Product-Hunt / App / DrawerWidget.js View on Github external
donate: function () {
        Mixpanel.track("Choose Donate");
        InAppBilling.open()
            .then(() => InAppBilling.subscribe('buy_me_a_coffee'))
            .then((details) => {
                console.log("You purchased: ", details)
                Mixpanel.track("Donate Success");
                return InAppBilling.close()
            })
            .catch((err) => {
                Mixpanel.track("Donate Failure");
                console.log(err);
                return InAppBilling.close()
            });
    },
github arjunkomath / Feline-for-Product-Hunt / App / CollectionsMain.js View on Github external
componentDidMount: function() {
        this.fetchData();
        GoogleAnalytics.trackScreenView('Collections Page');
        Mixpanel.track("Collections Page");
    },
github mikelambert / dancedeets-monorepo / js / store / track.js View on Github external
export function track(eventName: string, params: ?Params) {
  if (!trackingEnabled) {
    return;
  }
  if (params != null) {
    const firebaseSafeParams = {};
    for (let key of Object.keys(params)) {
      firebaseSafeParams[firebaseSafe(key)] = params[key];
    }
    AppEventsLogger.logEvent(eventName, 1, params);
    Mixpanel.trackWithProperties(eventName, params);
    Analytics.logEvent(firebaseSafe(eventName), firebaseSafeParams);
  } else {
    AppEventsLogger.logEvent(eventName, 1);
    Mixpanel.track(eventName);
    Analytics.logEvent(firebaseSafe(eventName));
  }
}
github arjunkomath / Feline-for-Product-Hunt / App / SinglePost.js View on Github external
DB.starred.add(save).then(() => {
                    this.setState({starred: true})
                    Mixpanel.track("Star Post");
                    ToastAndroid.show('Post has been starred', ToastAndroid.LONG);
                });
            }
github arjunkomath / Feline-for-Product-Hunt / App / DatePicker.js View on Github external
componentDidMount: function() {
        BackAndroid.addEventListener('hardwareBackPress', this.navigatorPop);
        GoogleAnalytics.trackScreenView('Date Picker');
        Mixpanel.track('Date Picker');
    },
github goldennetwork / golden-wallet-react-native / app / Handler / MixpanelHandler.js View on Github external
track(eventName) {
    if (__DEV__) return
    if (!MainStore.appState.allowDailyUsage) return
    Mixpanel.track(eventName, TOKEN_API)
  }
github arjunkomath / Feline-for-Product-Hunt / App / Pages / ProfilePage.js View on Github external
componentDidMount: function() {
        BackAndroid.addEventListener('hardwareBackPress', this.navigatorPop);
        GoogleAnalytics.trackScreenView('Profile Page');
        Mixpanel.track("Profile Page");
    },