Product Events (Sales Insights)

 

Foreword

This tagging documentation only applies to Tracker from version 5.18.0.

Before beginning implementation of Sales Insights, please make sure you have read the events’ getting started.
If you can’t see the “Ecommerce” menu entry in Explorer, please get in touch with us so we get this activated for you.

 

Product Events

The plugin provides different useful functions for measuring:

  • display of products
  • display of product pages

    It is possible to enable in addition an automatic tagging for SalesTracker viewed products by overloading a setup variable “autoSalesTracker” available in sub-object “Ecommerce“:

    var config = {
        Ecommerce: {
            autoSalesTracker: true
        }
    };
    var tag = new ATInternet.Tracker.Tag(config);
  • clicks on products
  • addition or deletion of products in cart.

See the full list of setup variables that can be overloaded at the bottom of the page.

 

Product display

The Tracker has one declaration method:

  • tag.ecommerce.displayProduct.products.set()

Measuring a product display is done via declaring a product table.

The product table can include one or several products.

A product is an object that can have the following properties:

  • “id” – String: Product ID (this parameter is mandatory).
  • “variant” – String: Product variant (size, color, etc.).
  • “$” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “pricetaxincluded” – Float: Product price, tax incl.
  • “pricetaxfree” – Float: Product price, tax excl.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “category1” – String: Product’s level 1 category (up to 6 tree structure levels possible; from “category1” to “category6”).

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.displayProduct.products.set([{
    "id": "1",
    "variant": "1",
    "$": "laptop_A56",
    "brand": "ACER",
    "discount": 1,
    "pricetaxincluded": 549,
    "pricetaxfree": 456.2,
    "currency": "EUR",
    "stock": 1,
    "category1": "Computers_and_Networking",
    "category2": "Computers",
    "category3": "Laptops"
}]);
tag.dispatch();
 

Product page display

The Tracker has one declaration method:

  • tag.ecommerce.displayPageProduct.products.set()

Measuring a product page display is done via declaring a product table.

The product table can include one or several products.

A product is an object that can have the following properties:

  • “id” – String: Product ID (this parameter is mandatory).
  • “variant” – String: Product variant (size, color, etc.).
  • “$” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “pricetaxincluded” – Float: Product price, tax incl.
  • “pricetaxfree” – Float: Product price, tax excl.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “category1” – String: Product’s level 1 category (up to 6 tree structure levels possible; from “category1” to “category6”).

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.displayPageProduct.products.set([{
    "id": "1",
    "variant": "1",
    "$": "laptop_A56",
    "brand": "ACER",
    "discount": 1,
    "pricetaxincluded": 549,
    "pricetaxfree": 456.2,
    "currency": "EUR",
    "stock": 1,
    "category1": "Computers_and_Networking",
    "category2": "Computers",
    "category3": "Laptops"
}]);
tag.dispatch();
 

Product addition

The Tracker has two declaration methods:

  • tag.ecommerce.addProduct.cart.set()
  • tag.ecommerce.addProduct.products.set()

Measuring the addition of a product to a shopping cart is done via declaring a cart object and a product table.

The shopping cart is declared as an object with the following property:

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

A product is declared as an object that can have the following properties:

  • “id” – String: Product ID (this parameter is mandatory).
  • “variant” – String: Product variant (size, color, etc.).
  • “$” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “pricetaxincluded” – Float: Product price, tax incl.
  • “pricetaxfree” – Float: Product price, tax excl.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “quantity” – Number: Number of products to add to cart.
  • “category1” – String: Product’s level 1 category (up to 6 tree structure levels possible; from “category1” to “category6”).
  • “cartcreation” – Boolean: Cart creation (0 for no; 1 if the “add to cart” action results in the creation of a cart).

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.addProduct.cart.set({"id": "34"});
tag.ecommerce.addProduct.products.set([{
    "id": "1",
    "variant": "1",
    "$": "laptop_A56",
    "brand": "ACER",
    "discount": 1,
    "pricetaxincluded": 549,
    "pricetaxfree": 456.2,
    "currency": "EUR",
    "stock": 1
    "quantity": 1,
    "category1": "Computers_and_Networking",
    "category2": "Computers",
    "category3": "Laptops",
    "cartcreation": 1
}]);
tag.dispatch();
 

Product removal

The Tracker has two declaration methods:

  • tag.ecommerce.removeProduct.cart.set()
  • tag.ecommerce.removeProduct.products.set()

Measuring a product’s removal from a cart is done via declaring a cart object and a product table.

The cart is declared as an object with the property:

  • “id” – String: Cart ID (this parameter is mandatory).

A product is declared as an object that can have the following properties:

  • “id” – String: Product ID (this parameter is mandatory).
  • “variant” – String: Product variant (size, color, etc.).
  • “$” – String: Product name.
  • “brand” – String: Product brand.
  • “discount” – Boolean: Discounted product (0 for no; 1 for yes).
  • “pricetaxincluded” – Float: Product price, tax incl.
  • “pricetaxfree” – Float: Product price, tax excl.
  • “currency” – String: Currency.
  • “stock” – Boolean: Product in stock (0 for no; 1 for yes).
  • “quantity” – Number: Number of products to remove from cart.
  • “category1” – String: Product’s level 1 category (up to 6 tree structure levels possible; from “category1” to “category6”).

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.removeProduct.cart.set({"id": "34"});
tag.ecommerce.removeProduct.products.set([{
    "id": "1",
    "variant": "1",
    "$": "laptop_A56",
    "brand": "ACER",
    "discount": 1,
    "pricetaxincluded": 549,
    "pricetaxfree": 456.2,
    "currency": "EUR",
    "stock": 1,
    "quantity": 1,
    "category1": "Computers_and_Networking",
    "category2": "Computers",
    "category3": "Laptops"
}]);
tag.dispatch();
 

Appendices

 

Tagging methods

  • tag.ecommerce.displayProduct.products.set
  • tag.ecommerce.displayPageProduct.products.set
  • tag.ecommerce.addProduct.cart.set
  • tag.ecommerce.addProduct.products.set
  • tag.ecommerce.removeProduct.cart.set
  • tag.ecommerce.removeProduct.products.set
 

Setup variables

NameDefault valueDescriptionVersion
Ecommerce.collectDomain“”Sales Insights collect domain >= 5.13.0
Ecommerce.autoSalesTrackerfalseEnable automatic SalesTracker order content measurement on a transaction confirmation event >= 5.13.0
 

Was this post helpful?

Last update: 13/08/2019