log Purchase
In order to log a purchase, switch to logPurchase. Using this method will by default log a purchase with a quantity of one.
See also
In order to log a purchase, switch to logPurchase.
See also
Reports that the current user made an in app purchase. Useful for tracking and segmenting users more likely to make purchases.
Note: The productId and currencyCode are trimmed of any whitespace characters before being sent to Braze.
Note: Querying the Google Play store for SKU details may return the price of a in-app purchases in micros. Therefore, a purchase of price 0.99USD will be returned as 9900000. To pass this value to Braze, be sure to convert it to a BigDecimal before attempting to convert it from micros to a decimal value in order to avoid integer division rounding errors.
val priceInMicro = BigDecimal(9900000L);
val priceInDecimal = priceInMicro.divide(new BigDecimal(10e6));
Parameters
The String identifier for the product purchased. Usually the Google Play SKU.
Currencies should be represented as an ISO 4217 currency code. Supported currency symbols can be found in com.braze.support.ValidationUtils. Any other provided currency symbol will result in a logged warning and no other action taken by the SDK.
The price paid. Base units depend on the currency. As an example, USD should be reported as Dollars.Cents, whereas JPY should be reported as a whole number of Yen. All provided BigDecimal values will have RoundingMode.HALF_UP rounding applied such that a maximum of two digits exist after the decimal point. May be negative.
The quantity of items purchased expressed as a whole number. Must be greater than zero.
A map of key-value properties describing this purchase. Property names are non-empty strings <= 255 characters, with no leading dollar signs. Property values can be integers, floats, booleans, dates (of the formats "%FT%T%z", "%Y-%m-%d %H:%M:%S", "%Y-%m-%d", "%m/%d/%Y"), or strings <= 255 characters.