App Growth
August 1 2016

Discovering your app's revenue data with AppMetrica

If your application offers in-app purchases, you probably want to analyze its revenue data.

AppMetrica uses custom events to record and analyze in-app purchases. The collected statistics are shown in the Events report, which can be segmented like any other report. You can also use the purchase event to segment other reports.

If an app has a lot of options available for purchase, they can be categorized for convenience. Note that the number of nesting levels for events is limited by 5 for each event.

How it works

To start collecting statistics in AppMetrica for in-app purchases, you just need to send a message when each purchase is made:

String eventParameters ="
{
 {\"IAP_ID\":\"currency\":
  {\"currency_name\":\"cost\"
  }
 }
}
";

YandexMetrica.reportEvent("Purchase", eventParameters);

Where:
IAP_ID is the name of the purchase.
currency_name is the name of the currency.
cost is the price in the currency.

We have given you an Android example. In iOS, the process is similar.

By sending an event to AppMetrica after each payment, you can find out how many times users have made purchases. The total revenue is equal to the number of purchases multiplied by the product price.

This approach works for the simplest purchase scenario, when payment is made immediately after tapping on the item in the store. If the user puts multiple items into a shopping cart before completing the payment, you will need a different algorithm. We’ll look at a more integrated approach that works with a shopping cart, using the example of a free2play game for Android with an in-app store.

Usage example

Let’s say our city-building game has a store that sells building materials for real money. Users can buy bricks, steel reinforcement, or timber in three price categories: bronze, silver, and gold.

To make it easy to view statistics later, we’ll create the Purchase event with the following sequence of actions:

Since we’re looking at the Android version of the game, we’ll need to send a JSON event message after each purchase. The event message will look like this:

String eventParameters ="
{
 {\"value\":\"ID\":
  {\"currency\":\"cost\"
  }
 }
}
";

YandexMetrica.reportEvent("Purchase", eventParameters);

For value, ID, currency and cost, we’ll need to dynamically substitute the item value (bronze/silver/gold), the ID (brick/steel/timber), the currency for processing the payment, and the price in the currency, respectively.

As mentioned earlier, the shopping cart scenario is more complicated than a standard purchase. Keep in mind that an event message must be sent every time an item unit is purchased. If a user put 3 bricks and 2 units of timber in the cart, then when the payment is completed, 3 messages must be sent for brick purchases and 2 messages for timber purchases.

Viewing statistics

Now we can use the web interface to assess which items of a particular value are most popular in the store.

From the statistics, we can see that users most often buy bronze-level bricks for U.S. dollars. To calculate the revenue from these sales, we multiply the price of each purchase by the number of similar purchases and total the results:

100*5 + 50*10 + 20*15 = 1300$

To get the base ARPPU for each bronze brick buyer, we divide the total revenue by the number of devices:

1300 / 100 = 13$

The same item might have variations in price, as shown in our example. After all, we could be running seasonal promotions and testing different business models. Each price will be displayed in a separate row in the report, which is convenient for analysis.

Working with reports

– Audience segmentation

The Users reports (Active users and New users) can pull out the paying users. To see this segment, you just need to go to the list of events in the Conditions menu and select the Purchase event.

Microsegmentation also works in our case. In order to analyze user preferences, we can filter purchases by item parameters (bricks, steel, and timber):

The Events report is broken down into segments using a variety of parameters. For example, if you break down revenue data by country, you can find out which regions have the most active paying audience.

Another useful report view is Engagement → Session length. You can use it to compare how much time is spent in the app by the paying audience versus the non-paying audience. To do this, break down session statistics using the same Purchase event.

For more information about segmentation features, see the AppMetrica documentation.

– Evaluating purchase conversions from a traffic source

You can use the Traffic Sources report to analyze app install conversions, but you can also use it for a target event. When you choose the purchase event as the target, you can find out which advertising partner most effectively attracts a paying audience to the app.

This is how the report will look in the AppMetrica interface:

Now you know how to use our service to get your application’s revenue data and related metrics.

If you have more questions, send us email at appmetrica@yandex-team.com.