public class Revenue
extends java.lang.Object
It enables revenue tracking from in-app purchases and other purchases in your application.
The Revenue object should be passed to the AppMetrica server by using the
YandexMetrica.reportRevenue(Revenue) method.
Revenue events are displayed in the AppMetrica Revenue report.
| Modifier and Type | Class and Description |
|---|---|
static class |
Revenue.Builder
Builder class for
Revenue objects. |
static class |
Revenue.Receipt
The class to store in-app purchases data.
|
| Modifier and Type | Field and Description |
|---|---|
java.util.Currency |
currency
Currency of the purchase.
|
java.lang.String |
payload
Additional information to be passed about the purchase.
|
java.lang.Double |
price
Deprecated.
Use
priceMicros instead. |
java.lang.Long |
priceMicros
Price of the products purchased in micros (price * 10^6).
|
java.lang.String |
productID
ID of the product purchased.
|
java.lang.Integer |
quantity
Quantity of products purchased.
|
Revenue.Receipt |
receipt
Information about the in-app purchase order from Google Play.
|
| Modifier and Type | Method and Description |
|---|---|
static Revenue.Builder |
newBuilder(double price,
java.util.Currency currency)
Deprecated.
Use
newBuilderWithMicros(long, Currency) instead. |
static Revenue.Builder |
newBuilderWithMicros(long priceMicros,
java.util.Currency currency)
Creates the new instance of
Revenue.Builder. |
@Deprecated @Nullable public final java.lang.Double price
priceMicros instead.It can be negative, e.g. for refunds.
EXAMPLE: 0.99
@Nullable public final java.lang.Long priceMicros
It can be negative, e.g. for refunds.
EXAMPLE: 990000 (equivalent to 0.99 in real currency)
@NonNull public final java.util.Currency currency
@Nullable public final java.lang.Integer quantity
The value cannot be negative. If the value is less than 0, the purchase is ignored.
NOTE: Revenue = quantity * price.Revenue.Builder.withQuantity(Integer)@Nullable public final java.lang.String productID
EXAMPLE: com.yandex.service.299
NOTE: The string value can contain up to 200 characters.Revenue.Builder.withProductID(String)@Nullable public final java.lang.String payload
It should contain the valid JSON string.
For instance, it can be used for categorizing your products.
NOTE: The maximum size of the value is 30 KB.Revenue.Builder.withPayload(String)@Nullable public final Revenue.Receipt receipt
@Deprecated @NonNull public static Revenue.Builder newBuilder(double price, @NonNull java.util.Currency currency)
newBuilderWithMicros(long, Currency) instead.Revenue.Builder.price - Price of the products purchasedcurrency - Currency of the purchaseRevenue.Builder objectprice,
currency@NonNull public static Revenue.Builder newBuilderWithMicros(long priceMicros, @NonNull java.util.Currency currency)
Revenue.Builder.priceMicros - Price of the products purchased in micros (price * 10^6)currency - Currency of the purchaseRevenue.Builder objectpriceMicros,
currency