How to use react-native-mixpanel - 10 common examples

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 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 mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
function initMixpanel() {
  if (!trackingEnabled) {
    return;
  }
  let mixpanelApiKey = null;
  if (__DEV__) {
    mixpanelApiKey = '668941ad91e251d2ae9408b1ea80f67b';
  } else {
    mixpanelApiKey = 'f5d9d18ed1bbe3b190f9c7c7388df243';
  }

  Mixpanel.sharedInstanceWithToken(mixpanelApiKey);
  if (DeviceInfo.getModel() === 'Calypso AppCrawler') {
    Mixpanel.registerSuperProperties({ $ignore: true });
  }
  // Don't use global track(), since this is a Mixpanel-only event:
  Mixpanel.track('$app_open');
}
github mikelambert / dancedeets-monorepo / js / store / track.js View on Github external
async function setupPersonProperties() {
  const token = await AccessToken.getCurrentAccessToken();
  if (!token) {
    return;
  }
  Crashlytics.setUserIdentifier(token.userID);
  Mixpanel.identify(token.userID);
  Analytics.setUserId(token.userID);

  const user = await performRequest('GET', 'me', {fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link'});
  const now = new Date().toISOString().slice(0,19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    '$first_name': user.first_name,
    '$last_name': user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    '$email': user.email,
    'Last Login': now,
  });
github mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
async function setupPersonProperties() {
  const token = await AccessToken.getCurrentAccessToken();
  if (!token) {
    return;
  }
  Crashlytics.setUserIdentifier(token.userID);
  Mixpanel.identify(token.userID);
  firebase.analytics().setUserId(token.userID);

  const user = await performRequest('GET', 'me', {
    fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link',
  });
  const now = new Date().toISOString().slice(0, 19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    $first_name: user.first_name,
    $last_name: user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    $email: user.email,
github mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
const token = await AccessToken.getCurrentAccessToken();
  if (!token) {
    return;
  }
  Crashlytics.setUserIdentifier(token.userID);
  Mixpanel.identify(token.userID);
  firebase.analytics().setUserId(token.userID);

  const user = await performRequest('GET', 'me', {
    fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link',
  });
  const now = new Date().toISOString().slice(0, 19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    $first_name: user.first_name,
    $last_name: user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    $email: user.email,
    'Last Login': now,
  });
  Mixpanel.setOnce({ $created: now });

  firebase.analytics().setUserProperty('FBFirstName', user.first_name);
  firebase.analytics().setUserProperty('FBLastName', user.last_name);
  firebase.analytics().setUserProperty('FBGender', user.gender);
  firebase.analytics().setUserProperty('FBLocale', user.locale);
  firebase.analytics().setUserProperty('FBTimezone', user.timezone.toString());
  firebase.analytics().setUserProperty('FBEmail', user.email);
github mikelambert / dancedeets-monorepo / js / store / track.js View on Github external
async function setupPersonProperties() {
  const token = await AccessToken.getCurrentAccessToken();
  if (!token) {
    return;
  }
  Crashlytics.setUserIdentifier(token.userID);
  Mixpanel.identify(token.userID);
  Analytics.setUserId(token.userID);

  const user = await performRequest('GET', 'me', {fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link'});
  const now = new Date().toISOString().slice(0,19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    '$first_name': user.first_name,
    '$last_name': user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    '$email': user.email,
    'Last Login': now,
  });
  Mixpanel.setOnce({'$created': now});

  Analytics.setUserProperties({
    'FBFirstName': user.first_name,
    'FBLastName': user.last_name,
    'FBGender': user.gender,
    'FBLocale': user.locale,
    'FBTimezone': user.timezone.toString(),
github mikelambert / dancedeets-monorepo / js / store / track.js View on Github external
const user = await performRequest('GET', 'me', {fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link'});
  const now = new Date().toISOString().slice(0,19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    '$first_name': user.first_name,
    '$last_name': user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    '$email': user.email,
    'Last Login': now,
  });
  Mixpanel.setOnce({'$created': now});

  Analytics.setUserProperties({
    'FBFirstName': user.first_name,
    'FBLastName': user.last_name,
    'FBGender': user.gender,
    'FBLocale': user.locale,
    'FBTimezone': user.timezone.toString(),
    'FBEmail': user.email,
    'LastLogin': now,
  });

}
github mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
fields: 'id,name,first_name,last_name,gender,locale,timezone,email,link',
  });
  const now = new Date().toISOString().slice(0, 19); // Trim off the fractional seconds from our ISO?UTC time

  Crashlytics.setUserName(user.name);
  Crashlytics.setUserEmail(user.email);
  Mixpanel.set({
    $first_name: user.first_name,
    $last_name: user.last_name,
    'FB Gender': user.gender,
    'FB Locale': user.locale,
    'FB Timezone': user.timezone,
    $email: user.email,
    'Last Login': now,
  });
  Mixpanel.setOnce({ $created: now });

  firebase.analytics().setUserProperty('FBFirstName', user.first_name);
  firebase.analytics().setUserProperty('FBLastName', user.last_name);
  firebase.analytics().setUserProperty('FBGender', user.gender);
  firebase.analytics().setUserProperty('FBLocale', user.locale);
  firebase.analytics().setUserProperty('FBTimezone', user.timezone.toString());
  firebase.analytics().setUserProperty('FBEmail', user.email);
  firebase.analytics().setUserProperty('LastLogin', now);
}
github mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
function initMixpanel() {
  if (!trackingEnabled) {
    return;
  }
  let mixpanelApiKey = null;
  if (__DEV__) {
    mixpanelApiKey = '668941ad91e251d2ae9408b1ea80f67b';
  } else {
    mixpanelApiKey = 'f5d9d18ed1bbe3b190f9c7c7388df243';
  }

  Mixpanel.sharedInstanceWithToken(mixpanelApiKey);
  if (DeviceInfo.getModel() === 'Calypso AppCrawler') {
    Mixpanel.registerSuperProperties({ $ignore: true });
  }
  // Don't use global track(), since this is a Mixpanel-only event:
  Mixpanel.track('$app_open');
}