In-App purchases and subscriptions

AppMetrica helps you estimate revenue from the app's paid features: for example, purchases of items in a game or subscriptions to an online cinema. You'll be able to see what users buy, how often they renew their subscription, and which acquisition sources bring revenue.

To get started, determine which payments and subscription changes you need to track. Then pass the task to the developer and check the result in the reports. Below is a general instruction and separate technical sections for configuration.

In-App Revenue and subscription events are basic: they're free, don't consume the custom events limit or the paid Data Stream API limit. Learn more about pricing.

What you want to track

Task

What to configure

One-time in-app purchases

Sending payment information — In-App Revenue. The developer will choose automatic collection or sending information about each purchase.

App Store or Google Play subscriptions

Sending purchase information and connecting the store to receive renewals, cancellations, and other subscription changes.

Payments through your own payment system

Separate sending of payment information. Connecting App Store or Google Play doesn't collect payments made outside these stores.

How to set up collection

  1. Describe the task. List the paid products, where the user pays for them, and what you want to analyze: the first purchase, repeat payments, subscription renewals, or cancellations.
  2. Agree on the data. For purchases, you'll need information about the product, amount, and currency. For subscriptions, additionally determine the required status changes. For example, for an online cinema — the start of the trial period, the first payment, renewal, and cancellation.
  3. Pass the task to the developer. For subscriptions, you'll also need an employee with access to the app store settings. Technical instructions are at the end of the article and in a separate MD file.
  4. Agree on verification. Test purchases need to be separated from working statistics: otherwise, they'll change the overall metrics. Ask the developer to prepare a separate sending for testing.

How a subscription differs from a one-time purchase

For a one-time purchase, it's enough to receive payment information. For a subscription, you need to track what happens after the first payment: whether the subscription is renewed, whether the user canceled the next charge, whether access ended, and whether there was a refund.

Canceling renewal and subscription expiration are different events. For example, a user canceled renewal on October 10, but the paid access is valid until October 31. Until the end of this period, they can still use the paid feature.

Sending a payment as In-App Revenue by itself doesn't replace tracking all subscription changes. For App Store and Google Play, the developer separately connects receiving these changes.

If store notifications aren't connected, subscription information may arrive with a delay of up to 24 hours, and some events will be unavailable. Check with the developer which method is configured.

How to check the result

  1. Run the agreed test scenario: buy a product or take out a subscription in the store's test environment or your payment system.
  2. Open the In-app and Ad Revenue report. Check the product, amount, currency, and number of purchases.
  3. Make sure that one payment isn't counted twice. If several transfer methods are used, ask the developer to check their combined operation.
  4. For a subscription, check not only the first payment but also the required changes: for example, renewal and cancellation. Compare the events with the store's test scenario.

In the Settings → Revenue section, you can choose which purchases to show in the reports: collected automatically, sent manually, or both. This choice changes the display, not the collection of events itself. It also affects reports for past periods.

Which metrics to look at

Metric

What question it answers

In-App Revenue

How much revenue purchases and subscriptions brought.

Paying users

How many users made a purchase.

In-App ARPU

How much revenue from purchases falls on average per user.

In-App ARPPU

How much revenue from purchases falls on average per paying user.

Average order

What is the average purchase amount.

Which subscription changes you can see

The set of available events depends on the store and integration settings. For analysis, use the event names displayed in AppMetrica.

Event

What it means

Trial subscription started

The trial period started.

Intro subscription started

The subscription was taken out under an introductory offer.

Promo subscription started

The subscription was taken out under a promo offer.

Subscription converted

The user switched from the introductory offer to the full price.

Subscription started

The subscription was taken out without an introductory offer.

Subscription renewed

A new subscription period was paid.

Subscription cancelled

Renewal was canceled; paid access may still be valid.

Subscription uncancelled

Renewal was re-enabled in the Apple ID settings.

Subscription expired

The subscription term ended.

Subscription billing issues

A payment error occurred during renewal.

Refund

A refund was issued for a subscription or one-time purchase.

How to use events in analysis

In the funnel, you can compare the number of users who started the trial period and then switched to the full price. To do this, select the Trial subscription started and Subscription converted events.

In the In-app and Ad Revenue report, compare revenue by products and purchase types. In cohort analysis — revenue and repeat payments of users over time.

In User Acquisition and Remarketing, compare acquisition sources. Revenue metrics in these reports are calculated over the user's entire lifetime: the selected period determines the install or re-engagement date.

Why amounts may differ from the store

Payments can arrive in different currencies. AppMetrica converts them into the report currency at the rate for the day before the payment; conversion into rubles and euros is done through US dollars. The rate may differ from the app store's rate, so amounts reduced to one currency may differ.

Instructions for the developer

Pass these instructions to the developer: they'll connect the transfer of purchases and store notifications. You just need to agree on the scenarios and check the result using the steps above.

Download the instructions for the developer (TXT): in-app-developer-en.txt

For the developer — purchases and transfer verification

Choose a collection method

  1. Make sure the AppMetrica SDK is connected and activated. Determine which payments come through the stores and which through your system.
  2. For automatic purchase collection, StoreKit on iOS and Google Play Billing on Android are used. Enable the corresponding SDK setting: revenueAutoTrackingEnabled on iOS or withRevenueAutoTrackingEnabled on Android.
  3. For manual sending, transfer In-App Revenue using your platform's SDK. Instructions: Android, iOS, Flutter, React Native, Unity.
  4. If information comes from the server, use loading In-App Revenue via the Post API. This method is suitable for your own payment system and your own subscription logic.
  5. For subscriptions, separately configure receiving statuses using the Google Play and App Store instructions below. An automatically received first purchase doesn't mean that all renewals and cancellations are already tracked.

Transfer via the Post API

  1. Get a Post API key in Settings → Main. Use different keys for the test and production environments.
  2. Prepare the event parameters according to the method description. Check the specific features and limitations.
  3. Send the event via /logs/v1/import/revenue or a CSV batch via /logs/v1/import/revenue.csv. Historical events can only be loaded for the last 14 days.
  4. Check the API response and the appearance of the event in the report. Fix authorization and required parameter errors before resending.

Purchase validation

Validation confirms the fact of payment and helps identify purchases from hacked apps. Add the required keys in the Revenue settings and transfer information for validation according to the SDK documentation of the selected platform.

With validation enabled, the revenue metrics include purchases that passed the check, as well as purchases sent without parameters for verification. For purchases that didn't pass the check, separate metrics "Invalid revenue" and "Users with invalid revenue" are used. Therefore, the presence of a purchase in regular revenue by itself doesn't mean it was verified.

Testing and duplicates

For test events, use a separate API key; when sending via the SDK — a reporter. In AppMetrica, you can't separate test events from working ones if they've already been sent to one main API key. Android reporter, iOS reporter.

Check the product, amount, currency, and number of purchases. If manual and automatic collection are enabled simultaneously, check for the absence of double counting and the selection of sources in Settings → Revenue. This setting changes the display, including past periods, but doesn't stop event collection.

For the developer — Google Play subscriptions

Connect a service account and a Google notification channel so that AppMetrica can receive subscription changes. You'll need access to Google Cloud, Google Play Console, and the app settings in AppMetrica.

Create a service account

  1. Open or create a project in Google Cloud.
  2. Find Service accounts, click Create service account, and set the account name.
  3. Assign the Basic → Editor role according to the current AppMetrica instructions.
  4. In the Actions → Manage keys menu, select Add key → Create new key, type JSON. Save the key file for uploading to AppMetrica.

Grant access to the app

  1. Open Users and permissions in Google Play Console and click Invite new users.
  2. Specify the email of the created service account.
  3. On the Account permissions tab, enable: View app information and download bulk reports (read-only); View financial data, orders, and cancellation survey responses; Manage orders and subscriptions.
  4. On the App permissions tab, select the required app via Add app, then Invite user → Send Invite.
  5. In AppMetrica, open Settings → Revenue → Google Play subscription tracking and validation and upload the service account JSON file.

Connect change notifications

A Cloud Pub/Sub topic is a channel through which Google sends messages about subscription changes. In AppMetrica, choose the appropriate option.

  • Create a new topic. Suitable if other services don't yet receive notifications. Copy the name of the created topic and paste it into Google Play Console → Monetization setup → Topic name.
  • Use an existing topic. If it's already configured for another service, copy the name from Google Play Console → Monetization setup → Topic name into the Revenue settings in AppMetrica. You can't specify two topics for an app in Google Play Console at the same time.
  • Don't use a topic. Not recommended: AppMetrica will check statuses once a day, data may be delayed up to 24 hours, and some events will be unavailable.

Make sure the topic exists and Google can publish notifications to it. Check the permissions according to the Google documentation. Save the settings and enable tracking in AppMetrica.

If a Pub/Sub error occurs

The error PERMISSION_DENIED: Cloud Pub/Sub API has not been used in project before or it is disabled means that the Pub/Sub API isn't enabled in the project. Follow the link from the error message, click Enable, then return to AppMetrica and click Save and enable tracking again.

Check the result

Run a Google Play test scenario and check the required status changes in the report. Verify not only the first purchase but also the renewal, cancellation, and expiration of the subscription. Take into account the selected method of receiving notifications.

For the developer — App Store subscriptions

To check statuses, AppMetrica uses the App Store Shared Secret, and to receive changes — App Store Server Notifications. You'll need access to App Store Connect and the app settings in AppMetrica.

Add a Shared Secret

Shared Secret is an app key that AppMetrica uses to verify a purchase and subscription status.

  1. In App Store Connect, open Apps and select the app.
  2. Go to Features → Subscriptions.
  3. In the App-Specific Shared Secret section, click Manage, create and copy the key.
  4. In AppMetrica, open Settings → Revenue and paste the key into the App Store Shared Secret field.

Connect server notifications

  1. Copy the notification address from Settings → Revenue in AppMetrica: https://apple.inapp.appmetrica.yandex.net.
  2. In App Store Connect, select the app and open General → App Information.
  3. In the App Store Server Notifications block, next to Production Server URL, click Edit.
  4. Paste the AppMetrica address, select Version 2 Notifications, and click Save.

If server notifications aren't connected, information may arrive with a delay of up to 24 hours, and some events will be unavailable. Take this into account if notifications are already directed to another service.

Check the result

Run a store test scenario and make sure the required events arrive in AppMetrica. Distinguish between canceling auto-renewal and the end of paid access. Check the amounts, currency, product, and the absence of double counting of payment.

Manual sending of subscription data

If subscriptions don't go through Google Play or App Store, or you track subscriptions yourself, use loading In-App Revenue via the Post API. This method is suitable for your own payment system and your own subscription logic.

Specify the event type in the required revenue_event_type field. For example, pass subscription_started when taking out a subscription without an introductory offer, subscription_renewed — on renewal, cancellation — on cancellation.

Revenue events loaded via the Post API don't pass validation and are always considered valid.

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

Contact support Suggest an improvement for documentation