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
Note: Swift Package Manager requires Xcode 12+ 1. In Xcode, select File > Swift Packages > Add Package Dependency. 2. Follow the prompts using the URL for this repository and must select a version greater than or equal to v4.0.0
Configure the SDK
Replace YOUR_TOKEN
with your project token. You can find your token here (opens in a new tab).
#import "Mixpanel/Mixpanel.h"
- (BOOL)application:(UIApplication _)application
didFinishLaunchingWithOptions:(NSDictionary _)launchOptions {
...
Mixpanel \*mixpanel = [Mixpanel sharedInstanceWithToken:@"YOUR_TOKEN"
trackAutomaticEvents: NO];
...
}
Was this page useful?