Package io.appmetrica.analytics
Class Revenue
java.lang.Object
io.appmetrica.analytics.Revenue
The class to store revenue data.
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
AppMetrica.reportRevenue(Revenue) method.
Revenue events are displayed in the AppMetrica Revenue report.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class forRevenueobjects.static classThe class to store in-app purchases data. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CurrencyCurrency of the purchase.final StringAdditional information to be passed about the purchase.final longPrice of the products purchased in micros (price * 10^6).final StringID of the product purchased.final IntegerQuantity of products purchased.final Revenue.ReceiptInformation about the in-app purchase order from Google Play. -
Method Summary
Modifier and TypeMethodDescriptionstatic Revenue.BuildernewBuilder(long priceMicros, Currency currency) Creates the new instance ofRevenue.Builder.
-
Field Details
-
priceMicros
public final long priceMicrosPrice of the products purchased in micros (price * 10^6).It can be negative, e.g. for refunds.
EXAMPLE: 990000 (equivalent to 0.99 in real currency)
-
currency
Currency of the purchase. -
quantity
Quantity of products purchased.The value cannot be negative. If the value is less than 0, the purchase is ignored.
NOTE: Revenue = quantity * price.- See Also:
-
productID
ID of the product purchased.EXAMPLE: com.yandex.service.299
NOTE: The string value can contain up to 200 characters.- See Also:
-
payload
Additional information to be passed about the purchase.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.- See Also:
-
receipt
Information about the in-app purchase order from Google Play.
-
-
Method Details
-
newBuilder
Creates the new instance ofRevenue.Builder.- Parameters:
priceMicros- Price of the products purchased in micros (price * 10^6)currency- Currency of the purchase- Returns:
- The
Revenue.Builderobject - See Also:
-