Hi, this is Renat from Apphud . If you have an application with auto-renewable subscriptions or you are going to release your first application with subscriptions, sooner or later you will be faced with the question of how to correctly transfer revenue from subscriptions to your analytics. Let's talk about it.
Why do I need to count subscription sales revenue?
Subscription revenue must be considered in order to send it to product analytics and attribution systems that do not know how to do this: Amplitude, Mixpanel, AppsFlyer, Branch, Adjust. Your server will come in handy for you to track subscription events: conversions, renewals, cancellations - and send them to your analytics. Unfortunately, not all product analysts support the Server-to-Server API. For example, Firebase or Flurry. They do not have an API for sending events from their server, and they do not support tracking subscriptions. As they say, they themselves do not, and do not give others.
In this article I will tell you what difficulties you may encounter if you decide to do it yourself.
App Store Connect Subscription Analytics Doesnβt Encompass
In general, analytics in the App Store Connect is not analytics at all. You can only see the big picture: conversions, number of events and retention. Apple does not even claim to be a full-fledged competitor to product analysts. App Store Connect is primitive:
- You cannot associate data with users and traffic sources.
- you cannot build your own funnels and graphs;
- data is updated once a day.
App Store Connect Subscription Overview
Why sending subscription revenue from an iOS device is a bad idea
The main problem is that you cannot send subscription events when the application is not running. The funds are debited at the beginning of each subscription period, and it is not known when the user will launch the application. This can happen in a day, in a week or never. In the latter case, nothing will be sent.
Event types
At first glance, only two events are enough: the beginning of the trial and the write-off of funds. In fact, there are many events and they often occur. You can make up a set of 5 events, or you can from 20. It all depends on your needs.
The following is a sample set of subscription related events.
Renewals
Regular renewal, trial activation, registration of introductory and promotional offers (free and paid).
Regular Subscription Conversion
Conversion of trial, introductory and paid promotional offers (free and paid).
Expiration
expiration of a regular subscription, expiration of a trial, expiration of a paid introductory offer, expiration of a free promotional offer, expiration of a paid promotional offer
Returns
refund of a regular subscription, refund of a paid introductory offer, refund of a paid promotional offer
Other events
enable renewal, disable renewal, grace period transition, subscription upgrade
Quite a lot of events, right? Apphud tracks 19 types of events. You can give each event its own name and combine some charge-offs under one event.
Challenges to Pricing
The biggest difficulty is that the Apple check does not indicate the amount debited. Perhaps Apple will someday add this to the check, but so far we have to handle the following situations manually.
Price change
When increasing the cost of the subscription, the developer can indicate whether to apply new prices for new subscribers. If you choose to apply , then everything is simple. The subscription simply expires if the user has refused to increase the price. And if you choose not to apply , then for the old subscribers it is necessary to use the prices for which they initially subscribed. StoreKit does not return information about the price at which the user has subscribed, so you need to store the price for each user somewhere.
Subscription change
By subscribing, the user himself can change its duration and price in the subscription settings in the App Store application. You need to check the product identifier when renewing the subscription and get the price corresponding to it. There are three types of subscription changes: downgrade, cross-grade and upgrade. About this we wrote a separate article on Habr , you can also read the official documentation here .
Return Unused Subscription
Yes, it happens. For cross-grades and subscription upgrades, the unused paid portion is returned to the user, and the cost of the new subscription is immediately charged.
An example of a user in Apphud who has changed their subscription with the return of an unused portion
Different prices for different countries
In the App Store, Connect can create different prices for one subscription for different countries. Therefore, you need to store prices for each country separately and use the price corresponding to the user's country.
Different currencies
Not all product analysts support currency conversion. It is necessary to convert prices to the base currency (for example, USD) and use only it everywhere. At Apphud, we regularly update exchange rates using Open Exchange Rates .
Apple Commission
Apple commission is 30%. But after a year of using the subscription, Apple's commission is reduced to 15%. An important nuance: breaks in the subscription amounting to more than 60 days reset the date of continuous use.
Introductory sentence is not necessarily introductory
This means that the trial and paid introductory offers can be not only at the beginning of the subscription, they can also be issued upon returning to the subscription, if the user has not drawn up the introductory offer before.
Introductory offer prices
It is necessary to store prices and the type of introductory offers for each country on the server: trial, prepayment or payment as used. Read more about introductory sentences here .
Promotional Offers
Promotional offers can alternate and replace each other, because they can be used an unlimited number of times. It is necessary to store not only the price of the main subscription, but also the prices of all promotional offers for each country. Read more about promotional offers here .
An example of a user in Apphud who signed up with an introductory offer and then took advantage of a promotional offer.
Returns
It is necessary to calculate the transactions for which the return was made, and send negative amounts to the analysts.
Determining user ID when starting from another device.
The user can start the application from another device. It is important to correctly determine the user ID under which to send data to the analytics. In some cases, you will have to combine users on the server. Renewals must be sent using the correct user ID.
User check storage and scheduled check
Finally, you need to save user checks and check them before the expected expiration date and at events that Apple sends in its notifications.
Apphud Integrations
One of the functions of Apphud is the integration that allows you to send subscription events to product analytics through our server.
Product Analyst Integrations
To enable integration with Amplitude or Mixpanel , you need to add an API key in the Apphud settings.
After adding integration to your analytics, real-time events will come. You can find out ARPU, MRR, trial conversion rates, unsubscribes, etc. And, of course, associate all this with your own events within the application. Also, indicators for each user will be available to you: the amount spent by him, the number of transactions and others.
Example user in Mixpanel after adding integration in Apphud
Integration with attribution systems
If you are promoting your application or planning to do so, then integrating Apphud with AppsFlyer or Branch will help you track the effectiveness of your ad campaigns. You can compare traffic channels by total revenue from subscriptions and other metrics.
Subscription revenue from various traffic channels in Branch
Integrations with instant messengers
You can also receive information about new trials or renewals in real time in Slack or Telegram . Integration will take no more than one minute.
Conclusion
Itβs difficult to calculate the exact revenue from subscriptions yourself. In addition to having your own server, you will need to correctly calculate the amount charged. For implementation, you will spend a lot of time and resources that are worth spending on improving the product. Apphud will help you correctly calculate the revenue from subscriptions and send them to your analytics.