From 0e86bebaff15cd00fb8131f6d553cb507d2f1509 Mon Sep 17 00:00:00 2001
From: Zihe Jia Please note: You do not need to update your Podfile to add Mixpanel.
3. For Xcode 12.5+, there is a known compile issue, please refer to this workaround. To start tracking with the library you must first initialize with your project token. To initialize the library, first add To start tracking with the library you must first initialize with your project token. You can get your project token from project settings. Once you've called this method once, you can access Let's get started by sending event data. You can send an event from anywhere in your application. Better understand user behavior by storing details that are specific to the event (properties). After initializing the library, Mixpanel will automatically collect common mobile events. You can enable/disable automatic collection through your project settings. Also, Mixpanel automatically tracks some properties by default. learn more Let's get started by sending event data. You can send an event from anywhere in your application. Better understand user behavior by storing details that are specific to the event (properties). After initializing the library, Mixpanel will automatically track some properties by default. learn more Open up Live View in Mixpanel to view incoming events.
Once data hits our API, it generally takes ~60 seconds for it to be processed, stored, and queryable in your project.
I want to stop tracking an event/event property in Mixpanel. Is that possible?(async, static)
-
Parameters:
+
+
+Initializes Mixpanel and return an instance of Mixpanel the given project token.
+const mixpanel = new Mixpanel('your project token');
+mixpanel.init();
+
Parameters:
Parameters:
Parameters:
c
Parameters:
Parameters:
flushSource:
getDisti
Parameters:
getPeople
get
ha
Parameters:
(async) init(Optional)
+
+
+
+
+
+
+Parameters:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+
+ Optional
+
+
+boolean
+
+
+
+
+
+
+
+
+
+ Whether or not Mixpanel can start tracking by default. See optOutTracking()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
optInTra
optOutT
Parameters:
Parameters:
Parameters:
resetSource:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Home
Classes
new Mixp
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Home
Classes
new PeopleSource:
Parameters:
clearChar
deleteUser<
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Home
Classes
Steps
2. Initialize Mixpanel
-import { Mixpanel }
and call Mixpanel.init(token)
with your project token as it's argument.import { Mixpanel } from 'mixpanel-react-native';
-...
-class YourClass extends React.Component {
- constructor(props) {
- super(props);
- this.configMixpanel();
- }
-
- configMixpanel = async () => {
- this.mixpanel = await Mixpanel.init("Your mixpanel token");
- }
-...
+
+const mixpanel = new Mixpanel("Your Project Token");
+mixpanel.init();
+
mixpanel
throughout the rest of your application.3. Send Data
-// Track with event-name
mixpanel.track('Sent Message');
// Track with event-name and property
@@ -117,6 +111,29 @@
4. Check for Success
Complete Code Example
+
+import React from 'react';
+import { Button, SafeAreaView } from "react-native";
+import { Mixpanel } from 'mixpanel-react-native';
+
+const mixpanel = new Mixpanel("Your Project Token");
+mixpanel.init();
+
+const SampleApp = () => {
+ return (
+ <SafeAreaView>
+ <Button
+ title="Select Premium Plan"
+ onPress={() => mixpanel.track("Plan Selected", {"Plan": "Premium"})}
+ />
+ </SafeAreaView>
+ );
+}
+
+export default SampleApp;
+
+
FAQ
Yes, in Lexicon, you can intercept and drop incoming events or properties. Mixpanel won’t store any new data for the event or property you select to drop. See this article for more information.FAQ
To preserve battery life and customer bandwidth, the Mixpanel library doesn't send the events you record immediately. Instead, it sends batches to the Mixpanel servers every 60 seconds while your application is running, as well as when the application transitions to the background. You can call flush() manually if you want to force a flush at a particular moment.
mixpanel.flush();
-If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call setLoggingEnabled to true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.
+If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call setLoggingEnabled with true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.
mixpanel.setLoggingEnabled(true);
Starting with iOS 14.5, do I need to request the user’s permission through the AppTrackingTransparency framework to use Mixpanel?
@@ -137,7 +154,7 @@
No worries, here are some links that you will find useful:
Have any questions? Reach out to Mixpanel Support to speak to someone smart, quickly.
@@ -156,7 +173,7 @@