Integrate, analyze and improve subscriptions in your iOS app

Dev notes

How to properly track subscriptions revenue in iOS apps

If you have an iOS app with auto-renewable subscriptions or you’re working on it, then this article is for you. Here we describe what difficulties you will face with while calculating revenue of your subscriptions based app.

Why do I need to track subscriptions revenue?

You will need to track revenue to be able to send this data to your mobile product analytics or marketing platforms, such as Amplitude, Mixpanel, AppsFlyer, Branch, Adjust. They all don’t support subscriptions revenue tracking. So you will need your own server to track subscription events, such as trial conversion, renewal, cancellation, etc. Then you will need to send data to your analytics using server to server API. Unfortunately, not all analytics platforms have such feature. For example, Firebase and Flurry don’t have API for receiving server events, and they don’t support subscriptions. Double kill.

In this article I will explain all the difficulties that you will meet if you decide to make your own implementation. And will try to convince you in favor of our ready-to-use solution.

But there is App Store Connect analytics…

Well, I wouldn’t call it analytics at all. App Store Connect has just overview data: conversions, events and retention charts. But:

  • you can not tie this data with your users and traffic sources;
  • you can not create your own charts and cohorts;
  • data is being refreshed once per day;
Subscription overview in App Store Connect Trends

Why sending subscription revenue from iOS device is a bad idea

Main problem is that you can’t send subscription events when the app is not running. You could probably send events when user has launched the app, but this may happen in a week, in a month or, perhaps, never. And your data won’t be up to date and some events will be lost.

Subscription events

You may think that two events – trial conversion and renewal – are enough. But that’s not true. There are plenty of subscription events and all of them occur frequently. It’s up to you, how many events you identify. It can be 5 events or 20.

Here is a list of a possible set of events.

Renewal: regular renewal, trial activation, paid introductory offer renewal, trial promotional offer renewal, paid promotional offer renewal.

Conversion: trial conversion, paid introductory offer conversion, trial promotional offer conversion, paid promotional offer conversion.

Expiration: regular subscription expiration, trial expiration, paid introductory offer expiration, trial promotional offer expiration, paid promotional offer expiration.

Refund: regular subscription refund, paid introductory offer refund, paid promotional offer refund.

Other events: autorenew enabled, autorenew disabled, billing grace period started, subscription upgraded

Quite a lot of events, right? In Apphud we have our own set of 19 events. You can set custom event names, so that you can send all paid renewals under one event if needed.

Difficulties with getting charge amount

The main difficultly is that you can’t know how much Apple charged user in each transaction. Maybe someday Apple will add “charge amount” field in the receipt, but until that day we have to solve problems below by ourselves.

Subscription price change

When developer increases price, he can choose whether to apply new price for existing subscribers or not. If he chooses to apply, everything is simple. If user agreed with a new price, then you set a higher price for new transactions, otherwise his subscription will expire. In case a developer decides to keep current prices, it requires a bit more work. Unfortunately, StoreKit doesn’t allow us to get the original price of the subscription that user purchased. So you should save original prices for all subscribers.

Change subscription plan

Users can manage their subscriptions in App Store app to choose a different duration and price.

When fetching new transactions, you should also check for product identifier in a receipt and get according price. Subscription change can be of three types: upgrade, downgrade and cross-grade. We will write a separate article about this, for now you get more info about subscription levels here.

Refund of unused portion of subscription period

When a user upgrades to a higher level of subscription, he upgrades immediately and gets a refund of the prorated amount of previous subscription.

Example of the user in Apphud with subscription upgrade and refund of a prorated amount

Different prices for different territories

As you know, App Store Connect has 155 territories and you can create different prices for them. So you have to keep prices for each territory and use according price.

Different currencies

Not all product analytics support automatic currency conversion. You have to manually convert prices into a basic currency, for example, USD. In Apphud we regularly refresh currencies rates using Open Exchange Rates.

Apple commission

Apple commission is 30%. However, after a year of paid uninterrupted service, it decreases to 15%. If a subscription was interrupted for more than 60 days in total, then paid service date resets.

Introductory can be not introductory

It means that introductory offer can be applied not only at the beginning of the original subscription, but also after re-activating a subscription, if introductory offer hasn’t yet been used.

Introductory offer prices

You have to keep all introductory types and prices for each country. Introductory offer can be of the following types: trial, pay up front or pay as you go. You can read more about introductory offers here.

Subscription offers

Subscription offers, aka promotional offers, can be applied as many times as developer wants and can change each other. So you have to keep prices for all subscription offers as well. You can read more about promotional offers here.

Example of user in Apphud who purchased subscription with introductory offer and then purchased promotional offer

Refunds

You have to track refunds as well, and send to your analytics negative amount.

Detect user ID when launching from another device

A user can launch your app from another device. And you don’t want in your analytics to appear two paid users, you want all renewals to be sent only from the first user. That’s not an easy job. In some cases you will need to merge users in your server.

Keep receipts and schedule validations

That’s fundamental task. You have to store receipts data, shared secrets and validate receipts at their expiration dates.

Integrations in Apphud

One of the features in Apphud are integrations. They let you to send subscription events, such as trial conversions, renewals and cancellations to your mobile analytics from our server.

Product analytics integrations

To enable integration with Amplitude or Mixpanel you just need to add API key to according integration page in Apphud.

After you add integration you will begin to receive subscription events in real time. You will know subscription key metrics, such as ARPU, MRR, trial conversion, churn rate, etc. And to tie these metrics with your custom events in your app. Besides that you will see total spent, transactions count and other important properties for each user.

Example of user in Mixpanel after adding integration in Apphud

Marketing platforms integrations

If you have ad campaigns or planning to start advertising your app, you should add integration with AppsFlyer or Branch. You will be able to track campaign effectiveness and compare your traffic sources by real revenue, trial conversion or other metrics.

Subscriptions revenue compared by traffic sources in Branch

Messengers integrations

You can also receive real-time information about new trials or renewals in Slack or Telegram. Integration process will take you less than a minute.

Conclusion

Tracking and sending subscriptions revenue by yourself is not easy. Besides having your own server, you will need to calculate correct charge amount. It will take plenty of time and resources for implementation, which better to spend for improving your product. Apphud will help you to correctly track subscriptions revenue and send it to your analytics.

Besides integrations, we are working on other features, such as winning back lapsed subscribers. More features are coming, so join Apphud using this link.

Subscribe to our newsletter!