Skip to content
Unofficial Swift Mixpanel client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Mixpanel Version 0.2.1 Dec 12, 2017
.gitignore Setup tests and watchOS target Jun 22, 2015
Cartfile.resolved Update for Swift 4.2 Sep 20, 2018
Readme.markdown Update for Swift 4.2 Sep 20, 2018



Version Swift Version Carthage compatible

Unofficial Mixpanel client written in Swift 4.2 for iOS and Mac.

This is a very simple client that just implements tracking events and identifying the current user. A network request is initiated whenver you call track. If it fails, nothing happens. Eventually, it would be cool if it stored these and retried at some point.


Carthage is the recommended way to install Mixpanel. Add the following to your Cartfile:

github "soffes/Mixpanel"


import Mixpanel

// Setup a client
let mixpanel = Mixpanel(token: "your app token")

// Identify the current user. This doesn't make a network request. It simply
// will add their identifer to the next event tracked.

// Track an event

// Track an event with parameters
mixpanel.track("Share", parameters: [
  "service": "Twitter",

// You can also customize the time the event happened and add a completion
// handler if you want.
mixpanel.track("Import photo", parameters: [
  "source": "Photo library"
], time: someTime, completion: (success) in {
  println("Tracked event successfully: \(success)")


You can’t perform that action at this time.