You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to the official Mixpanel React Native library.
21
25
The Mixpanel React Native library is an open-source project, and we'd love to see your contributions!
22
-
We'd also love for you to come and work with us! Check out **[Jobs](https://mixpanel.com/jobs/#openings)** for details
26
+
We'd also love for you to come and work with us! Check out **[Jobs](https://mixpanel.com/jobs/#openings)** for details.
23
27
24
28
## Quick Start Guide
25
29
@@ -31,10 +35,14 @@ Mixpanel's React Native SDK is a wrapper around Mixpanel’s native iOS and Andr
31
35
- React Native v0.6+
32
36
-[Setup development environment for React Native](https://reactnative.dev/docs/environment-setup)
33
37
#### Steps
34
-
1. Under your app's root directory, install Mixpanel React Native SDK
35
-
```npm install mixpanel-react-native```
38
+
1. Under your app's root directory, install Mixpanel React Native SDK.
39
+
```
40
+
npm install mixpanel-react-native
41
+
```
36
42
2. Under your application's ios folder, run
37
-
```pod install```
43
+
```
44
+
pod install
45
+
```
38
46
Please note: You do not need to update your Podfile to add Mixpanel.
39
47
3. For Xcode 12.5+, there is a known compile issue, please refer to this **[workaround](https://github.com/mixpanel/mixpanel-react-native/issues/43#issuecomment-829599732)**.
40
48
@@ -57,7 +65,7 @@ class YourClass extends React.Component {
57
65
```
58
66
Once you've called this method once, you can access `mixpanel` throughout the rest of your application.
59
67
### 3. Send Data
60
-
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](https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically). You can enable/disable automatic collection through your project settings. Also, Mixpanel automatically tracks some properties by default; [learn more](https://help.mixpanel.com/hc/en-us/articles/115004613766-Default-Properties-Collected-by-Mixpanel).
68
+
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](https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically). You can enable/disable automatic collection through your project settings. Also, Mixpanel automatically tracks some properties by default. [learn more](https://help.mixpanel.com/hc/en-us/articles/115004613766-Default-Properties-Collected-by-Mixpanel)
61
69
```js
62
70
// Track with event-name
63
71
mixpanel.track('Sent Message');
@@ -82,14 +90,12 @@ To preserve battery life and customer bandwidth, the Mixpanel library doesn't se
82
90
83
91
```
84
92
mixpanel.flush();
85
-
86
93
```
87
94
88
95
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](https://mixpanel.github.io/mixpanel-swift/Classes/MixpanelInstance.html#/s:8Mixpanel0A8InstanceC14loggingEnabledSbvp) to true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.
89
96
90
97
```
91
98
mixpanel.setLoggingEnabled(true);
92
-
93
99
```
94
100
95
101
**Starting with iOS 14.5, do I need to request the user’s permission through the AppTrackingTransparency framework to use Mixpanel?**
0 commit comments