Mixpanel
This guide describes how to add and configure Mixpanel integration.
Mixpanel is a powerful mobile analytics service. Send events to Mixpanel via Apphud, analyze your users behavior and make necessary decisions.

How to Add Integration?

Please make sure that Mixpanel Collection common mobile events is Disabled. See step 4 for details.
Step 1
2
3
4
5
6
7
✅ 8
In order not to receive Mixpanel automatic In-App purchase events disable collection common mobile events. Otherwise, if user, for example, starts a trial period Mixpanel will consider this as a revenue.
At Apphud go to "Integrations" section and add Mixpanel:
Paste Mixpanel Token into the "Mixpanel production app token" field. The token is the same as you use in your app.
You may have one more app created in Mixpanel used for testing purposes not to mix test and live data. If you have such app you can paste it's Mixpanel Token into "Mixpanel test app token" field.
You can enter your custom event names or disable some:
Enable integration:
If you want to send Revenue information to Mixpanel, check "Send Revenue properties to Mixpanel". Click "Save":

Match User IDs

Here is an example of initialising both SDKs with User IDs matching.
Swift
Objective-C
Java
1
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2
3
Apphud.start(apiKey: "YOUR_API_KEY")
4
Apphud.setDelegate(self)
5
6
Mixpanel.initialize(token: mixpanel_token)
7
Mixpanel.mainInstance().identify(distinctId: Apphud.userID())
8
9
return true
10
}
11
12
func apphudDidChangeUserID(_ userID: String) {
13
// Match again
14
Mixpanel.mainInstance().identify(distinctId: Apphud.userID())
15
}
Copied!
1
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2
// Override point for customization after application launch.
3
4
[Apphud startWithApiKey:@"APPHUD_API_KEY" userID:nil];
5
[Apphud setDelegate:self];
6
7
[Mixpanel sharedInstanceWithToken:@"MIXPANEL_TOKEN"];
8
[Mixpanel.sharedInstance identify:Apphud.userID];
9
10
return YES;
11
}
12
13
- (void)apphudDidChangeUserID:(NSString *)userID {
14
[Mixpanel.sharedInstance identify:Apphud.userID];
15
}
Copied!
1
Apphud.start(apiKey: "YOUR_API_KEY");
2
MixpanelAPI mixpanel = MixpanelAPI.getInstance(context, MIXPANEL_TOKEN);
3
mixpanel.identify(Apphud.userID());
Copied!

Events Cheat Sheet

This is a list of all possible events and their parameters that are being sent to Mixpanel.
You can read more about subscription events here and parameters here.
Trial
Cancellations
Introductory Offer
Regular
Promo Offer
Other Events

Trial period started

Default event name: [Apphud] trial_started
Parameters:
    product_id: String
    unit: String
    units_count: Integer

Successful conversion from trial period to regular subscription

Default event name: [Apphud] trial_converted
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float

Failed conversion from trial period to regular subscription

Default event name: [Apphud] trial_expired
Parameters:
    product_id: String
    reason: String

Trial Canceled

Default event name: [Apphud] trial_canceled
Parameters:
    product_id: String

Subscription Canceled

Default event name: [Apphud] subscription_canceled
Parameters:
    product_id: String

Autorenew disabled (Deprecated)

Default event name: [Apphud] autorenew_disabled
Parameters:
    product_id: String

Autorenew enabled

Default event name: [Apphud] autorenew_enabled
Parameters:
    product_id: String

Introductory offer started

Default event name: [Apphud] intro_started
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String
    unit: String
    units_count: Integer

Introductory offer renewed

Default event name: [Apphud] intro_renewed
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String
    unit: String
    units_count: Integer

Successful conversion from introductory offer to regular subscription

Default event name: [Apphud] intro_converted
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String

Failed conversion from introductory offer to regular subscription or failed renew

Default event name: [Apphud] intro_expired
Parameters:
    product_id: String
    reason: String
    offer_type: String

Refund during introductory offer

Default event name: [Apphud] intro_refunded
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    reason: String
    offer_type: String

Subscription started

Default event name: [Apphud] subscription_started
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float

Subscription renewed

Default event name: [Apphud] subscription_renewed
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float

Subscription expired

Default event name: [Apphud] subscription_expired
Parameters:
    product_id: String
    reason: String

Subscription refunded

Default event name: [Apphud] subscription_refunded
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    reason: String

Promotional offer started

Default event name: [Apphud] promo_started
Parameters:
    product_id: String
    offer_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String
    unit: String
    units_count: Integer

Promotional offer renewed

Default event name: [Apphud] promo_renewed
Parameters:
    product_id: String
    offer_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String
    unit: String
    units_count: Integer

Successful conversion from promotional offer to regular subscription

Default event name: [Apphud] promo_converted
Parameters:
    product_id: String
    offer_id: String
    local_price: Float
    currency: String
    usd_price: Float
    offer_type: String

Failed conversion from promotional offer to regular subscription or failed renew

Default event name: [Apphud] promo_expired
Parameters:
    product_id: String
    offer_id: String
    reason: String
    offer_type: String

Refund during promotional offer

Default event name: [Apphud] promo_refunded
Parameters:
    product_id: String
    offer_id: String
    local_price: Float
    currency: String
    usd_price: Float
    reason: String
    offer_type: String

Non renewing purchase

Default event name: [Apphud] non_renewing_purchase
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float

Non renewing purchase refunded

Default event name: [Apphud] non_renewing_refunded
Parameters:
    product_id: String
    local_price: Float
    currency: String
    usd_price: Float
    reason: String

Billing issue

Default event name: [Apphud] billing_issue
Parameters:
    product_id: String

Billing issue Resolved

Default event name: [Apphud] billing_issue_resolved
Parameters:
    product_id: String
These events:
    [Apphud] trial_converted,
    [Apphud] intro_started,
    [Apphud] intro_renewed,
    [Apphud] intro_converted,
    [Apphud] intro_refunded,
    [Apphud] subscription_started
    [Apphud] subscription_renewed,
    [Apphud] subscription_refunded,
    [Apphud] promo_started,
    [Apphud] promo_renewed,
    [Apphud] promo_converted,
    [Apphud] promo_refunded,
can be optionally sent to Mixpanel with Mixpanel's build-in Revenue parameter converted to USD. This option is off by default, but you can enable this feature in integration settings:
You can also choose between sending revenue as sales or proceeds (without Apple 15%-30% commission).
You can read more how Apple calculates commission here.

User Properties

In the table below you can see the list of user properties that are sent to Mixpanel.
More information about user properties can be found here.
Parameter
Type
[Apphud] status-group_name
String
[Apphud] autorenew-group_name
Boolean
[Apphud] total_spent
Float
[Apphud] paying
Boolean
[Apphud] payments_count
Integer

Sending Test Event

You may send test event to Mixpanel to check if integration is set up correctly. Click "…" and then in dropdown click on "Send test event":
You will see new user in "Live view" report:
Last modified 1yr ago