RetailEventTemplate
Retail event template. Use with com.urbanairship.analytics.CustomEvent.newBuilder or com.urbanairship.analytics.customEvent to create a custom event with retail template properties.
Example (Kotlin):
customEvent(
RetailEventTemplate.Type.Purchased,
RetailEventTemplate.Properties(
id = "sku-123",
category = "shoes",
eventDescription = "Running Shoes",
brand = "Nike"
)
) {
setEventValue(99.99)
setTransactionId("txn-456")
}.track()Content copied to clipboard
Example (Java):
RetailEventTemplate.Properties properties = RetailEventTemplate.Properties.newBuilder()
.setId("sku-123")
.setCategory("shoes")
.setDescription("Running Shoes")
.setBrand("Nike")
.build();
CustomEvent.newBuilder(RetailEventTemplate.Type.Purchased, properties)
.setEventValue(99.99)
.setTransactionId("txn-456")
.build()
.track();Content copied to clipboard
See also
Types
Link copied to clipboard
class Properties(val id: String? = null, val category: String? = null, val type: String? = null, val eventDescription: String? = null, val brand: String? = null, val isNewItem: Boolean? = null, val currency: String? = null, val isLTV: Boolean = false) : JsonSerializable