Amplitude

This guide describes how to add and configure Mixpanel integration.

Amplitude is a powerful mobile analytics service. Send events to Amplitude via Apphud, analyze your users behavior and make necessary decisions.

How to Add Integration?

Step 1
2
3
4
5
✅ 6
Step 1
  • Integrate Apphud SDK.

  • Integrate Amplitude SDK.

  • Match User IDs between Apphud and Amplitude. If you set your custom User ID keep in mind that Amplitude requires user id to be minimum 5 characters.

2

At Apphud go to "Integrations" section and add Amplitude:

3

Enter Amplitude API Key at the "Amplitude production app API Key" field:

4

You may have one more app created in Amplitude used for testing purposes not to mix test and live data. If you have such app you can paste it's Amplitude API Key into "Amplitude test app API key" field.

5

You can enter your custom event names or disable some:

✅ 6

Enable integration and Save:

Match User IDs

Here is an example of initialising both SDKs with User IDs matching.

Swift
Objective-C
Kotlin
Java
Swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Apphud.start(apiKey: "YOUR_API_KEY")
Apphud.setDelegate(self)
Amplitude.instance()?.initializeApiKey("AMPLITUDE_API_KEY", userId: Apphud.userID())
return true
}
func apphudDidChangeUserID(_ userID: String) {
// Match again
Amplitude.instance()?.setUserId(userID)
}
Objective-C
[Apphud startWithApiKey: @"API_KEY" userID: @"USER_ID_OR_NIL"];
[[Amplitude] instance] initializeApiKey:@"API_KEY" userId:@"USER_ID"];
Kotlin
Apphud.start(apiKey: "YOUR_API_KEY")
Amplitude.getInstance().initialize(this, "AMPLITUDE_API_KEY", "USER_ID");
Java
Apphud.start(apiKey: "YOUR_API_KEY");
Amplitude.getInstance().initialize(this, "AMPLITUDE_API_KEY", "USER_ID");

Events Cheat Sheet

This is a list of all possible events and their parameters that are being sent to Amplitude.

You can read more about subscription events here and about parameters here.

Trial
Cancellations
Introductory Offer
Regular
Promo Offer
Other Events
Trial

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

Cancellations

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

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

Regular

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

Promo Offer

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

Other Events

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_purchase_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 Amplitude with additional parameters. You can enable Amplitude's built-in revenue tracking events. More information can be found here. Using this you will be able to use Amplitude's built-in revenue tracking reports. Revenue tracking 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 or Google 15%-30% commission).

You can read more how Apple calculates commission here.

These are parameters that are sent with these events:

Parameter

Type

Description

productID

String

Product ID

quantity

Integer

Quantity of products. Always equals 1

price

Float

The price of purchase in US dollars.

revenueType

String

Name of event. Possible value: trial_converted, intro_started, intro_renewed, intro_converted, intro_refunded, subscription_started, subscription_renewed, subscription_refunded, promo_started, promo_renewed, promo_converted, promo_refunded

User Properties

In the table below you can see the list of user properties that are sent to Amplitude.

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 Amplitude to check if integration is set up correctly. Click "…" and click on "Send test event":

You will see new user under "User Look-Up" report: