Kotlin SDK References and Release notes

Classes

DYResult

Open class DYResult(
    val status: ResultStatus,
    val warnings: List<Warning>? = null,
    val error: Exception? = null,
    val rawNetworkData: RawNetworkData? = null
)
PropertyDescriptionType
statusThe status of the Choose call. If the type is "WARNING," it indicates that the request was successful, but there are warnings associated with the response.ResultStatus:
SUCCESS, ERROR, WARNING
warningsList of warnings returned from the server. Every warning item has a code and message.List<Warning>?
errorError and exception.Exception?
rawNetworkDataNetwork-related data (for debugging purposes).RawNetworkData?

Page

class Page(
    pageType: PageType,
    pageLocation: String,
    pageData: List<String> = listOf(),
    pageReferrer: String? = "",
    locale: String? = null,
)
PropertyDescriptionType
pageTypeThe current page typePageType
pageLocationThe current location. URL (for web), location (for SPA), or screen name (for mobile apps). Enables targeting the current page/screen.String
pageDataAdditional data for non-homepage pages: The SKU for a PRODUCT page, the category for a CATEGORY page, SKUs for the CART page, and the page ID in OTHER.List
pageReferrerThe previous location. URL (for web), location (for SPA), or screen name (for mobile apps). Enables targeting the previous page/screen.String?
localePage locale codeString?

ChooseOptions

data class ChooseOptions(  
    val isImplicitPageview: Boolean? = null,  
    val returnAnalyticsMetadata: Boolean? = null,  
    val isImplicitImpressionMode: Boolean? = null,  
)
PropertyDescriptionType
isImplicitPageviewDetermine whether to report a new pageview with the given context. Default is false. Set to true to report a new pageview with the given context. Keep as false if the Dynamic Yield script is implemented on the page. It reports the new pageview from the browser.Boolean
returnAnalyticsMetadataReturn additional metadata (display names & IDs for all entities). Useful for reporting to analytics tools. Set to true to return additional metadata (display names & IDs for all entities) for reporting to analytics tools.Boolean
isImplicitImpressionModeReport an impression of the chosen variation. This is set to true by default, which means that the user's impression of the variation is reported immediately when the variation is chosen. Pass this as false to report the impression explicitly in an Engagement call.Boolean

Enums

Channel

enum class Channel(val valueStr: String) {
    APP("APP"),
    KIOSK("KIOSK"),
    DRIVE_THRU("DRIVE-THRU");
}

DeviceType

enum class DeviceType {
    SMARTPHONE,
    TABLET,
    KIOSK,
    ODMB;
}

PageType

enum class PageType {
    HOMEPAGE,
    CATEGORY,
    PRODUCT,
    CART,
    OTHER
}