Product events (Sales Insights)

 

Foreword

If you can’t see the “Sales Insights” menu entry in Explorer, please get in touch with us so we can activate this for you.

 

Product events

With the tracker, an ECommerce object is available, exposing different objects and methods useful for measuring:

  • Product displays
  • Product page displays

    Additionally, it’s possible to enable automatic tagging of SalesTracker viewed products by overriding the “autoSalesTracker” configuration variable:

  • Add-to-cart or remove-from-cart actions

The Sales Insights collection domain must be indicated via the “collectDomain” configuration variable:

See the full list of Ecommerce configuration variables that can be overridden at the end of this page.

 

Product display

Measuring product display is done by creating a DisplayProduct object, to which the following is associated:

  • A list of products, Products, which can contain one or several ECommerceProduct-type products.

A product’s properties should be declared as a HashMap-type collection, with different keys:

  • “id” – String: Product ID (mandatory).
  • “variant” – String: Product variant (size, colour, etc.).
  • “name” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “priceTaxIncluded” – Float: Price, including tax.
  • “priceTaxFree” – Float: Price, excluding tax.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “category1” – String: The product’s level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).

Example

 

Product page display

Measuring the display of a product page is done by creating a DisplayPageProduct object, to which the following is associated:

  • an ECommerceProduct-type product.

A product’s properties should be declared as a HashMap-type collection, with different keys:

  • “id” – String: Product ID (mandatory).
  • “variant” – String: Product variant (size, colour, etc.).
  • “name” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “priceTaxIncluded” – Float: Price, including tax.
  • “priceTaxFree” – Float: Price, excluding tax.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “category1” – String: The product’s level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).

Example

 

Product addition

Measuring the addition of a product to the cart is done by creating an AddProduct object, to which the following are associated:

  • an ECommerceCart-type cart
  • an ECommerceProduct-type product

A cart must contain a property:

  • “id” – String: Product ID (mandatory).

A product’s properties should be declared as a HashMap-type collection, with different keys:

  • “id” – String: Product ID (mandatory).
  • “variant” – String: Product variant (size, colour, etc.).
  • “name” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “priceTaxIncluded” – Float: Price, including tax.
  • “priceTaxFree” – Float: Price, excluding tax.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “quantity” – Number: Number of products to add.
  • “category1” – String: The product’s level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).
  • “cart.creation” – Boolean: Cart creation (true if the action of adding a product has resulted in cart creation).

Example

 

Product deletion

Measuring the deletion of a product from the cart is done by creating a RemoveProduct object, to which the following are associated:

  • an ECommerceCart-type cart
  • an ECommerceProduct-type product

A cart must contain a property:

  • “id” – String: Product ID (mandatory).

A product’s properties should be declared as a HashMap-type collection, with different keys:

  • “id” – String: Product ID (mandatory).
  • “variant” – String: Product variant (size, colour, etc.).
  • “name” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “priceTaxIncluded” – Float: Price, including tax.
  • “priceTaxFree” – Float: Price, excluding tax.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “quantity” – Number: Number of products to add.
  • “category1” – String: The product’s level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).

Example

 

Appendix

 

Configuration variables

Name Default value Description Version
collectDomain “” Sales Insights collection domain  >= 2.11.0
autoSalesTracker false Enable automatic measurement of SalesTracker products viewed upon product page display events  >= 2.11.0
Was this post helpful?
Yes
No
Last update: 08/01/2019