How to use the react-native-mixpanel.setOnce 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
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 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');
Mixpanel.reset();
Mixpanel.getDistinctId((id) => (id));