ProductView

This is for:

Developer
In this article
Important

The Headless commerce engine, controllers, and actions are in open beta and therefore under active development. Reach out to your Coveo team for support in adopting them.

The ProductView controller provides an interface for triggering an analytics event for a product view.

Methods

view

Trigger a view event for the product.

Parameters

  • product: Product

    The product view event payload.

Initialize

buildProductView

Creates an ProductView controller instance.

Parameters

  • engine: CommerceEngine

    The headless commerce engine.

Returns ProductView

Product

Properties

  • additionalFields: Record<string, unknown>

    The requested additional fields for the product.

  • children: Omit<Product, 'children' | 'totalNumberOfChildren'>

    The child products of the product, fetched through product grouping.

  • clickUri: string

    The URL of the product.

  • permanentid: string

    The SKU of the product.

  • totalNumberOfChildren: number

    The total number of child products fetched through product grouping.

  • 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;Electronics|Televisions|4K Televisions").

    From the ec_category field.

  • ec_description?: string

    The description of the product.

    From the ec_description field.

  • ec_gender?: string

    The gender the product is intended for.

  • ec_images?: string[]

    The URLs of additional product images.

    From the ec_images field.

  • ec_in_stock?: boolean

    Whether the product is currently in stock.

    From the ec_in_stock field.

  • ec_item_group_id?: string

    The ID used for the purpose of 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.

    From the ec_price field.

  • ec_product_id?: string

    The product ID.

  • ec_promo_price?: number

    The promotional price of the product.

    From the ec_promo_price field.

  • ec_rating?: number

    The product rating, from 0 to 10.

    From the ec_rating field.

  • ec_shortdesc?: string

    A short description of the product.

    From the ec_shortdesc field.

  • ec_thumbnails?: string[]

    The URLs of the product image thumbnails.

    From the ec_thumbnails field.