Mixpanel Analytics iOS

Posted By : Nitin Bhatt | 17-May-2016

Mixpanel Analytics : - 

 

Mixpanel is the most advance analytics platform for mobile and web. Its helps you analyze the actions people take in your application.

->  Mixpanel lets you measure any “action” a customer takes in you app.

->  Data in Mixpanel available withIn a second.

->  Mixpanel provides better event tracking model . Their events are easier to understand, more flexible, and simpler to report on.

 

Create Mixpanel account :-

 

Mixpanel Link : -  https://mixpanel.com/

 

 

 

When user successfully sign up in Mixapnel, this screen will appear

 

 

To get Token from the Mixpanel click on Accout(Top left) -> Projects -> (Copy your Token) 

 

 

When click on view you data(left menu) this screen will appear

 

 

 

Installation using CocoaPods : -

 

platform :ios, ‘9.0’

use_frameworks!

pod ‘Mixpanel'

 

Create new project in Xcode , In this example i have taken the submit to track event.

 

 

Write this code in ViewController.swift : -

 import UIKit
import Mixpanel

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    Mixpanel.sharedInstanceWithToken("ee0a33311eae2a08683aea9c0a1bb616");
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func submitButtonTapped(sender: AnyObject) {
         Mixpanel.sharedInstance().track(
            "Submit Button Tapped"
        )
    }
}

 

 

Run your app , click on submit button then open your mixpanel account , click on Live view (on left menu)

 

 

Github link :- https://github.com/nits9012/Mixpanel

 

Thanks 

 

About Author

Author Image
Nitin Bhatt

Nitin is an Assistant Project Manager specializing in iOS Application Development. He is an avid reader.

Request for Proposal

Name is required

Comment is required

Sending message..