trackConversion

fun trackConversion(    itemName: String,     customerId: String,     revenue: Double?,     searchTerm: String = Constants.QueryConstants.TERM_UNKNOWN,     sectionName: String? = null,     conversionType: String? = null,     isCustomType: Boolean? = null,     displayName: String? = null,     analyticsTags: Map<String, String>? = null)

Tracks conversion (a.k.a add to cart) events.

Example:

ConstructorIo.trackConversion("Fashionable Toothpicks", "1234567-AB", 12.99, "tooth", "Products", "add_to_cart")

Parameters

itemName

the name of the converting item i.e. "Kabocha Pumpkin"

customerId

the identifier of the converting item i.e "PUMP-KAB-0002"

searchTerm

the search term that lead to the event (if adding to cart in a search flow)

sectionName

the section that the results came from, i.e. "Products"

conversionType

the type of conversion, i.e. "add_to_cart"

isCustomType

if the conversion is custom (required for displayName)

displayName

display name of custom conversion type (required for isCustomType)

analyticsTags

Additional analytics tags to pass


fun trackConversion(    itemName: String,     customerId: String,     variationId: String?,     revenue: Double?,     searchTerm: String = Constants.QueryConstants.TERM_UNKNOWN,     sectionName: String? = null,     conversionType: String? = null,     isCustomType: Boolean? = null,     displayName: String? = null,     analyticsTags: Map<String, String>? = null)

Tracks conversion (a.k.a add to cart) events.

Example:

ConstructorIo.trackConversion("Fashionable Toothpicks", "1234567-AB", "1234567-AB-RED", 12.99, "tooth", "Products", "add_to_cart")

Parameters

itemName

the name of the converting item i.e. "Kabocha Pumpkin"

customerId

the identifier of the converting item i.e "PUMP-KAB-0002"

variationId

the variation identifier of the clicked item variation i.e "PUMP-KAB-0002-RED"

searchTerm

the search term that lead to the event (if adding to cart in a search flow)

sectionName

the section that the results came from, i.e. "Products"

conversionType

the type of conversion, i.e. "add_to_cart"

isCustomType

if the conversion is custom (required for displayName)

displayName

display name of custom conversion type (required for isCustomType)

analyticsTags

Additional analytics tags to pass