InteractiveResult (Product Listing Engine)

This is for:

Developer
In this article

The InteractiveResult controller provides an interface for triggering desirable side effects, such as logging UA events to the Coveo Platform, when a user selects a query result.

Methods

beginDelayedSelect

Prepares to select the result after a certain delay, sending analytics if it was never selected before.

In a DOM context, it’s recommended to call this method on the touchstart event.

cancelPendingSelect

Cancels the pending selection caused by beginDelayedSelect.

In a DOM context, it’s recommended to call this method on the touchend event.

select

Selects the result, logging a UA event to the Coveo Platform if the result wasn’t selected before.

In a DOM context, it’s recommended to call this method on all of the following events: * contextmenu * click * mouseup * mousedown

Initialize

buildInteractiveResult

Creates an InteractiveResult controller instance.

Parameters

  • engine: ProductListingEngine

    The headless engine.

  • props: InteractiveResultProps

    The configurable InteractiveResult properties.

Returns InteractiveResult

InteractiveResultProps

The configurable InteractiveResult properties.

Properties

InteractiveResultOptions

The options for the InteractiveResult controller.

Properties

  • result: ProductRecommendation

    The query result.

  • debounceWait?: number

    The number of seconds for which the debounced function should continue catching subsequent calls.

    Default: 1000

  • selectionDelay?: number

    The amount of time to wait before selecting the result after calling beginDelayedSelect.

    Default: 1000

ProductRecommendation

Properties

  • additionalFields: Record<string, unknown>

    An object containing the requested additional fields for the product.

  • childResults: ProductRecommendation[]

    A list of child product recommendations in a product grouping context.

  • clickUri: string

    A direct link to the product in URL format.

  • documentUri: string

    This parameter is no longer used by the Coveo Usage Analytics service.

  • documentUriHash: string

    Document UriHash in the index. Useful for analytics.

  • permanentid: string

    The SKU of the product.

  • totalNumberOfChildResults: number

    The total number of items in the group.

  • ec_brand?: string

    The brand of the product.

    From the ec_brand field.

  • ec_category?: string

    The category of the product (e.g., "Electronics", "Electronics|Televisions", or "Electronics|Televisions|4K Televisions").

    From the ec_category field.

  • ec_images?: string[]

    Additional product images in URL format.

    From the ec_images field.

  • ec_in_stock?: boolean

    The availability of the product (i.e., whether it’s in stock).

    From the ec_in_stock field.

  • ec_item_group_id?: string

    The id used for Product Grouping.

    From the ec_item_group_id field.

  • ec_name?: string

    The name of the product.

    From the ec_name field.

  • ec_price?: number

    The base price of the product or variant.

    From the ec_price field.

  • ec_promo_price?: number

    The promotional price of the product or variant.

    From the ec_promo_price field.

  • ec_rating?: number

    A rating system. Ratings range from 0-10.

    From the ec_rating field.

  • ec_shortdesc?: string

    A short description of the product.

    From the ec_shortdesc field.

  • ec_thumbnails?: string[]

    Product images in URL format.

    From the ec_thumbnails field.