Install Mixpanel
Overview
Installing Mixpanel is easy. This guide will show you how to do it with our SDKs.
Already collect product data? Connect your Data Warehouse or via 3rd Party Integrations.
Code
Choose from the methods below. Not sure how to choose? Read our guide.
Install the SDK
Under your app's root directory, run:
npm install mixpanel-react-native
Under your application's iOS folder, run:
pod install
Note: For XCode 12.5+, there is a known compile issue, please refer to this workaround (opens in a new tab).
Configure the SDK
Replace YOUR_TOKEN
with your project token. You can find your token here (opens in a new tab).
//Import Mixpanel API
import { Mixpanel } from "mixpanel-react-native";
// Set up an instance of Mixpanel
const trackAutomaticEvents = false;
const mixpanel = new Mixpanel("YOUR_TOKEN", trackAutomaticEvents);
mixpanel.init();
Was this page useful?