ο»Ώ

The Amplitude integration is available on the [Pro](πŸ”—ο»Ώ) plan.

Amplitude can be a useful integration tool for seeing all events and revenue that occur for your app even if it’s not active for a period of time. You can use Amplitude’s product analytics to find patterns in customer behavior and inform marketing strategies.

With our Amplitude integration, you can:

  • Create a behavioral cohort of customers based on specific actions, such as watching a specific episode of a show after subscribing. Follow a cohort throughout their lifecycle to realize overarching trends.

  • Measure the path of a user from marketing material to the purchase of a subscription.

With accurate and up-to-date subscription data in Amplitude, you'll be set to turbocharge your product analytics ⚑️

# Events

The Amplitude integration tracks the following events:

EventDefault Event NameDescriptionApp StorePlay StoreAmazonStripePromo
Initial Purchaserc_initial_purchase_eventA new subscription has been purchased.βœ…βœ…βœ…βœ…βŒ
Trial Startedrc_trial_started_eventThe start of an auto-renewing subscription product free trial.βœ…βœ…βœ…βœ…βŒ
Trial Convertedrc_trial_converted_eventWhen an auto-renewing subscription product converts from a free trial to normal paid period.βœ…βœ…βœ…βœ…βŒ
Trial Cancelledrc_trial_cancelled_eventWhen a user turns off renewals for an auto-renewing subscription product during a free trial period.βœ…βœ…βœ…βœ…βŒ
Renewalrc_renewal_eventAn existing subscription has been renewed or a lapsed user has resubscribed.βœ…βœ…βœ…βœ…βŒ
Cancellationrc_cancellation_eventA subscription or non-renewing purchase has been cancelled. See [cancellation reasons](πŸ”—ο»Ώ) for more details.βœ…βœ…βœ…βœ…βœ…
Uncancellationrc_uncancellation_eventA non-expired cancelled subscription has been re-enabled.βœ…βœ…βœ…βŒβŒ
Non Subscription Purchaserc_non_subscription_purchase_eventA customer has made a purchase that will not auto-renew.βœ…βœ…βœ…βœ…βœ…
Subscription pausedrc_subscription_paused_eventA subscription has been paused.βŒβœ…βŒβŒβŒ
Expirationrc_expiration_eventA subscription has expired and access should be removed. If you have [Platform Server Notifications](πŸ”—ο»Ώ) configured, this event will occur as soon as we are notified (within seconds to minutes) of the expiration. If you do not have notifications configured, delays may be approximately 1 hour.βœ…βœ…βœ…βœ…βœ…
Billing Issuesrc_billing_issue_eventThere has been a problem trying to charge the subscriber. This does not mean the subscription has expired. Can be safely ignored if listening to CANCELLATION event + cancel_reason=BILLING_ERRORβœ…βœ…βœ…βœ…βŒ
Product Changerc_product_change_eventA subscriber has changed the product of their subscription. This does not mean the new subscription is in effect immediately. See [Managing Subscriptions](πŸ”—ο»Ώ) for more details on updates, downgrades, and crossgrades.βœ…βœ…βŒβœ…βŒ

For events that have revenue, such as trial conversions and renewals, RevenueCat will automatically record this amount along with the event in Amplitude.

# Setup

## 1. Set Amplitude User Identity

If you're using the Amplitude SDK, you can set the User Id to match the RevenueCat App User Id. This way, events sent from the Amplitude SDK and events sent from RevenueCat can be synced to the same user.

Configure the Amplitude SDK with the same App User Id as RevenueCat or use the `.setUserId()` method on the Amplitude SDK.

ο»Ώ

## Send Amplitude User Identifiers to RevenueCat (Optional)

If your App User ID in RevenueCat is different than the User ID in Amplitude, you can use the Amplitude User ID and/or Amplitude Device ID to identify events by adding a key in [Subscriber Attributes](πŸ”—ο»Ώ).

KeyDescription
`$amplitudeDeviceId`The Amplitude [Device ID](πŸ”—ο»Ώ)ο»Ώ
`$amplitudeUserId`The Amplitude [User ID](πŸ”—ο»Ώ)ο»Ώ

If both keys are present, RevenueCat will send both the User ID and Device ID to identify events into Amplitude. If only one of the keys are present, RevenueCat will only send the available key. If no keys are present, RevenueCat will send the current RevenueCat App User ID. This property can be set and removed manually, like any other [Subscriber Attribute](πŸ”—ο»Ώ). For more information how Amplitude tracks unique users, view their docs [here](πŸ”—ο»Ώ).

## 2. Send RevenueCat Events to Amplitude

After you've set up the _Purchases SDK_ and Amplitude SDK to have the same user identity, you can "turn on" the integration and configure the event names from the RevenueCat dashboard.

  1. Navigate to your project in the RevenueCat dashboard and find the _Integrations_ card in the left menu. Select **+ New**

ο»Ώ

  1. Choose **Amplitude** from the Integrations menu

  2. Add your Amplitude API key

  3. Enter the event names that RevenueCat will send or choose the default event names

  4. Select whether you want sales reported as gross revenue (before app store commission), or after store commission and/or estimated taxes.

Amplitude configuration page
ο»Ώ

Amplitude configuration page

## Set Amplitude Region (Optional)

If your Amplitude account is hosted on EU servers, toggle the Amplitude Region field to `EU` in the Amplitude integration settings. The region defaults to `US`.

# Sample Event

Below are sample JSONs that are delivered to Amplitude for each event type.

ο»Ώ
ο»Ώ