Once you begin sending revenue events to Amplitude, there are a few different configuration options which are outlined in this article.
Table of Contents
- Sending Revenue Events
- Revenue Properties
- Receipt Validation
- In-App Purchases (IAPs)
- Revenue Charts
Important Note: Amplitude currently does not support currency conversion. All revenue data should be normalized to your currency of choice, before being sent to Amplitude.
Sending Revenue Events
All Revenue events that send price and quantity as revenue properties will appear in the Revenue tab (including both Verified and Unverified events). See the following documentation for more information on sending revenue events:
Each revenue property is prefixed with a "$" to denote it is a revenue property. We calculate revenue using price times quantity. All events that have price and quantity revenue properties will appear in the Revenue charts. For example if you send a server-side event with price, quantity, and/or revenue but the event type name is not '[Amplitude] Revenue', then it will still be pulled into revenue charts because it has a revenue property name.
|price||Double||Required: The price of the products purchased (can be negative).
Note: revenue = quantity * price
|productId||String||Optional: An identifier for the product (we recommend something like the Google Play Store product ID).||null|
|quantity||Integer||Required: The quantity of products purchased. Defaults to one if not specified.
Note: revenue = quantity * price
|revenueType||String||Optional: The type of revenue (e.g. tax, refund, income).||null|
|eventProperties||Object||Optional: An object of event properties to include in the revenue event.
Note: You will only be able to segment on these properties in the Events Segmentation tab.
Note that these properties must be explicitly sent by you via our SDKs when you log revenue events.
To enable revenue verification, copy your iTunes Connect In App Purchase Shared Secret or your Google Play License Public Key into the Settings section of your project in Amplitude. You must put a key for every single app in Amplitude where you want revenue verification. See each SDK's verification documentation (linked in the above section) for more information. There are three different types of revenue events in Amplitude:
- '[Amplitude] Revenue': This event will always be logged for revenue events, regardless if revenue validation is turned on or not. However, this event will not populate the '$revenue' property as the'[Amplitude] Revenue (Verified/Unverified)' events do. If you have revenue verification turned on, and only see an '[Amplitude] Revenue' event in the user activity stream (with no '[Amplitude] Revenue (Verified/Unverified)', this means that the revenue failed verification.
- '[Amplitude] Revenue (Verified)': This verified event will be logged whenever there is a legitimate transaction. As a result, the difference between [Amplitude] Revenue and [Amplitude] Revenue (Verified) are the number of illegitimate app purchases being made. By default Revenue events recorded on the SDKs appear in Amplitude dashboards as unverified revenue events.
Note: You can only turn on validation for mobile. Web will always track [Amplitude] Revenue and [Amplitude] Revenue (Unverified).
We show any revenue that doesn't fail verification, which includes verified and unverified.
We validate based on the receipt from Apple or Google. Here is more information on how Apple and Google verify receipts:
- Apple: https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1
- Google: https://developer.android.com/google/play/billing/billing_integrate.html#Purchase
In-App Purchases (IAPs)
Tracking Revenue For Non-In-App Purchases (IAPs)
- Use our SDKs to call
- Use our HTTP API to send a purchase event with revenue as one of its parameters.
Note: Verified revenue checks are only done for IAPs.
The discrepancy between reports in the app store and Amplitude can be attributed to factors like time zone differences, event generation bugs, or even piracy.
If the discrepancy is minor and consistent on a day-to-day basis, the likely cause is the difference in time zone reporting between the app store and Amplitude. Because Amplitude uses UTC, a purchase event uploaded on a certain day according to Amplitude may be reported by the app store as occurring on a different day if the app store is using a different time zone, and vice versa. No data are being lost.
Major discrepancies can be the result of client-side errors such as the store purchase callback getting called multiple times for a single purchase. A good practice is to only call these events upon return from a successful store purchase. An example call, which tracks the event property and revenue amount, is:
Another cause for major discrepancies is piracy. A user can circumvent the app store and make purchases that don't show up in the app store reports. To avoid seeing pirated revenue events in your data, we recommend using our revenue verification way to track revenue events. If you suspect your data are being skewed heavily because of piracy, please contact us here.