open class DYResult(
val status: ResultStatus,
val warnings: List<Warning>? = null,
val error: Exception? = null,
val rawNetworkData: RawNetworkData? = null
)
Property
Description
Type
status
The status of the Choose call. If the type is WARNING, the request was successful but contains warnings.
ResultStatus: SUCCESS, ERROR, WARNING
warnings
List of warnings returned from the server. Each item includes a code and a message.
The current location: URL (web), route (SPA), or screen name (mobile apps). Used for targeting.
String
pageData
Additional data for non-homepage pages: SKU for PRODUCT, category for CATEGORY, SKUs for CART, or page ID for OTHER.
List
pageReferrer
The previous location: URL (web), route (SPA), or screen name (mobile).
String?
locale
Page locale code.
String?
ChooseOptions
data class ChooseOptions(
val isImplicitPageview: Boolean? = null,
val returnAnalyticsMetadata: Boolean? = null,
val isImplicitImpressionMode: Boolean? = null,
)
Property
Description
Type
isImplicitPageview
Determines whether to report a new pageview with the given context. Default is false. Set to true to report a new pageview when DY script is not reporting automatically.
Boolean
returnAnalyticsMetadata
Returns additional metadata (display names and IDs for all entities). Useful for reporting to analytics tools.
Boolean
isImplicitImpressionMode
Reports the impression of the chosen variation. Default is true, except for Restaurants where the default is false.
Boolean
Facets
// Base type for facets. Use valuesType to determine the concrete type.
open class Facet(
open val column: String,
open val displayName: String,
val valuesType: FacetValuesType
)
Property
Description
Type
column
Column identifier the facet applies to
String
displayName
Human-readable label for the facet
String
valuesType
Facet value category
FacetValuesType:number, string
NumberFacet
data class NumberFacet(
override val column: String,
override val displayName: String,
val min: Float,
val max: Float
) : Facet(
column = column,
displayName = displayName,
valuesType = FacetValuesType.number
)