How to use the react-native-mixpanel.trackWithProperties 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 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();
github mikelambert / dancedeets-monorepo / mobile / js / store / track.js View on Github external
export function track(eventName: string, params: ?Params) {
  if (!trackingEnabled) {
    return;
  }
  console.log('Tracking', eventName, params);
  if (params != null) {
    const firebaseSafeParams = {};
    for (const key of Object.keys(params)) {
      firebaseSafeParams[firebaseSafe(key)] = params[key];
    }
    AppEventsLogger.logEvent(eventName, 1, params);
    Mixpanel.trackWithProperties(eventName, params);
    firebase.analytics().logEvent(firebaseSafe(eventName), firebaseSafeParams);
  } else {
    AppEventsLogger.logEvent(eventName, 1);
    Mixpanel.track(eventName);
    firebase.analytics().logEvent(firebaseSafe(eventName));
  }
}
github arjunkomath / Feline-for-Product-Hunt / App / PostsMain.js View on Github external
var url = 'https://api.producthunt.com/v1/categories/'+this.state.category+'/posts?day=' + day;
        } else {
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth()+1; //January is 0!
            var yyyy = today.getFullYear();
            var day = yyyy+'-'+mm+'-'+dd;
            var pass_day = yyyy+'/'+mm+'/'+dd;

            this.setState({ date_text: 'TODAY', date: pass_day });

            var url = 'https://api.producthunt.com/v1/categories/'+this.state.category+'/posts?days_ago=0';
        }

        Mixpanel.trackWithProperties('View Posts Page', {
            category: this.state.category
        });

        var requestObj = {
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
                'Authorization': 'Bearer ' + this.state.access_token,
                'Host': 'api.producthunt.com'
            }
        };
        fetch(url, requestObj)
        .then((response) => response.json())
        .then((responseData) => {
            console.log(responseData.posts);
            this.setState({ posts: responseData.posts });
github arjunkomath / Feline-for-Product-Hunt / App / SinglePost.js View on Github external
share: function () {
        Mixpanel.trackWithProperties('Share Post', {
            share_text: this.state.post.name,
            share_URL: this.state.post.redirect_url
        });
        Share.open({
            share_text: this.state.post.name,
            share_URL: this.state.post.redirect_url,
            title: "Sharing is Caring"
        }, function (e) {
            console.log(e);
        });
    },
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 / SearchPage.js View on Github external
getPosts: function () {
        this.setState({
            posts: [],
            searching: true
        });
        this.helper.setQuery(this.state.keyword).search();
        Mixpanel.trackWithProperties('Search', {
            keyword: this.state.keyword
        });
    },
github goldennetwork / golden-wallet-react-native / app / Handler / MixpanelHandler.js View on Github external
trackWithProperties(eventName, props) {
    if (__DEV__) return
    if (!MainStore.appState.allowDailyUsage) return
    Mixpanel.trackWithProperties(eventName, props, TOKEN_API)
  }
}
github arjunkomath / Feline-for-Product-Hunt / App / SinglePost.js View on Github external
componentDidMount: function () {
        this.fetchData();
        this.getStarredPosts();
        BackAndroid.addEventListener('hardwareBackPress', this.navigatorPop);
        GoogleAnalytics.trackScreenView('Post Page');
        Mixpanel.trackWithProperties('View Post', {
            post_title: this.props.post.name
        });
    },
github arjunkomath / Feline-for-Product-Hunt / App / ProductWebPage.js View on Github external
componentDidMount: function() {
        BackAndroid.addEventListener('hardwareBackPress', this.navigatorPop);
        GoogleAnalytics.trackScreenView('WebView');
        Mixpanel.trackWithProperties('WebView', {
            url: this.props.url,
            title: this.props.title
        });
    },