📘

Mixpanel provides event tracking and advanced reporting capabilities to gain insight to your data sets.

The following guide explains how to associate a UXCam session URL with Mixpanel event enabling you to see a step by step session replay for your every event.

Sign up and Integrate UXCam


UXCam website will walk you through how to sign up and set up UXCam. To create a Mixpanel account, visit Mixpanel's website.

For more information about 3rd party integration and best practices, visit our 3rd party integration guide.

Integrate with Mixpanel


  1. Set user identity
  2. Track UXCam session
  3. UXCam session URL in Mixpanel
  4. Log Mixpanel metadata with UXCam
  5. View your Mixpanel events from UXCam


Set User Identity

If your app requires registered user login, we highly encourage you to set user identity for UXCam and Mixpanel. By doing so, you can easily filter all the sessions for the user from UXCam user dashboard.

How to do It:

//Set user identity for mixpanel
Mixpanel.mainInstance().identify(distinctId: "[email protected]")

//Set user identity for UXCam
UXCam.setUserIdentity("[email protected]")
//Set user identity for mixpanel
Mixpanel *mixpanel = [Mixpanel sharedInstance];
[mixpanel identify:@"[email protected]"];

//Set user identity for UXCam
[UXCam setUserIdentity:@"[email protected]"];
//Set user identity for mixpanel
mixpanel.identify("[email protected]");

//Set user identity for UXCam
UXCam.setUserIdentity("[email protected]")

Track UXCam session

You can attach a UXCam session URL to Mixpanel on UXCam session start or conditionally when a certain event occurs.

How to do It:

//tracking on session start
UXCam.start(withKey: "APP-KEY", buildIdentifier: nil) { (status) in
    if (status){
        if let sessionURL = UXCam.urlForCurrentSession() {
            Mixpanel.mainInstance().track(event: "UXCam: Session Recording link", properties: ["session_url": sessionURL])
        }
        
        if let userURL = UXCam.urlForCurrentUser() {
            Mixpanel.mainInstance().people.set(properties: ["uxcam_user_url": userURL])
        }
    }
}

//tracking conditionally
if (purchased){
    if let sessionURL = UXCam.urlForCurrentSession() {
        Mixpanel.mainInstance().track(event: "purchased", properties: ["uxcam_session_url": sessionURL])
    }
}
//tracking on session start
[UXCam startWithKey:@"APP-KEY" buildIdentifier:nil completionBlock:^(BOOL started) {
    if (started){
        NSString* sessionURL = [UXCam urlForCurrentSession];
        NSString* userURL = [UXCam urlForCurrentUser];
        
        Mixpanel *mixpanel = [Mixpanel sharedInstance];
        [mixpanel track:@"UXCam: Session Recording link" properties:@{ @"session_url": sessionURL }];
        
        [mixpanel.people set:@{@"uxcam_user_url": userURL}];
    }
}];

//tracking conditionally
if (purchased) {
    NSString* sessionURL = [UXCam urlForCurrentSession];
    Mixpanel *mixpanel = [Mixpanel sharedInstance];
    [mixpanel track:@"purchased" properties:@{ @"uxcam_session_url": sessionURL }];
}
// Inside onCreate method of all activity that is an entry point to your app add
UXCam.startWithKey("APP-KEY");
UXCam.addVerificationListener(new UXCam.OnVerificationListener() {
    @Override
    public void onVerificationSuccess() {
        //Tag Mixpanel events with UXCam recording URLS. Example:
        JSONObject eventProperties = new JSONObject();
        try {
            eventProperties.put("uxcam_session_url", UXCam.urlForCurrentSession());
        } catch (JSONException exception) {
        }
        mixpanel.track("UXCam: Session Recording link", eventProperties);
        //Tag Mixpanel profile with UXCam user URLS. Example:
        mixpanel.getPeople().set("uxcam_user_url", UXCam.urlForCurrentUser());
    }
    @Override
    public void onVerificationFailed(String errorMessage) { }
});

//tracking conditionally
if (purchased) {
    JSONObject eventProperties = new JSONObject();
    try {
        eventProperties.put("uxcam_session_url", UXCam.urlForCurrentSession());
    } catch (JSONException exception) { }
    mixpanel.track("purchased", eventProperties);
}

UXCam session URL in Mixpanel

You can view your tracked event from Mixpanel activity feed.

Log Mixpanel metadata with UXCam

You can also bind Mixpanel with UXCam. For example, you can log Mixpanel user identity to UXCam which can identify your registered user for the session.

How to do it:

//Log mixpanel user id to UXCam
let user = Mixpanel.mainInstance().distinctId
UXCam.logEvent("mixpanel", withProperties: ["mixpanel-user-id": user])
//Log mixpanel user id to UXCam
NSString* userId = [mixpanel distinctId];
[UXCam logEvent:@"mixpanel" withProperties: @{@"mixpanel-user-id": userId}];
//Log mixpanel user id to UXCam
String userId = mixpanel.distinctId;
JSONObject eventProperties = new JSONObject();
eventProperties.put("mixpanel-user-id", userId);
UXCam.logEvent("mixpanel", eventProperties);

View your Mixpanel events from UXCam

You can filter events related to Mixpanel from your events dashboard.