Mixpanel

Integration

Smartlook can be easily integrated into Mixpanel using Notifications:

NotificationCenter.default.addObserver(forName: Session.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
	if let smartlook = notification.object as? Smartlook,
 		 let sessionUrl = smartlook.user.session.url {
       
        mixpanel?.track(event: "Smartlook session URL", properties: [ "session_url": sessionUrl])
 	}
}

NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
	if let smartlook = notification.object as? Smartlook {
    let visitorUrl = smartlook.user.url

        mixpanel?.people.set(property: "smartlook_visitor_url", to: visitorUrl)
  }
}

A Smartlook visitor URL will be added as a new property called the Smartlook visitor dashboard URL into a Mixpanel user.

1459

Full Mixpanel documentation with examples can be found on the official website.