Cart Events (Sales Insights)

 

Foreword

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

 

Cart Events

The plugin provides different useful functions for measuring:

  • cart displays

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

    var config = {
        Ecommerce: {
            autoSalesTracker: true
        }
    };
    var tag = new ATInternet.Tracker.Tag(config);
  • cart updates
  • shipping and payment steps

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

 

Cart display

The Tracker has two declaration methods:

  • tag.ecommerce.displayCart.cart.set()

Measurement of a cart display is done via declaring a cart object and a product table.
The cart is displayed as an object that can have the following properties:

  • “id” – String: Cart ID (this parameter is mandatory).
  • “currency” – String: Currency.
  • “turnoverTaxIncluded” – Float: Total cart amount, tax incl.
  • “turnoverTaxFree” – Float: Total cart amount, tax excl.
  • “quantity” – Number: Number of products in cart.
  • “nbDistinctProduct” – Number: Number of distinct products in cart.

The product table can include one or several products.

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

  • “id” – String: Product ID (this parameter is mandatory).
  • “name” – String: Product name.
  • “priceTaxIncluded” – Float: Product price, tax incl.
  • “priceTaxFree” – Float: Product price, tax excl.
  • “quantity” – Number: Number of products in cart.
  • “category1” – String: Product’s level 1 category (up to 6 tree structure levels possible; from “category1” to “category6”).

Product declaration is optional for Ecommerce analysis. The products, if declared, will only enrich the analysis of sales/orders for SalesTracker. The parameters to be declared are therefore limited to those required for SalesTracker tagging.

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.displayCart.cart.set({
    "id": "34",
    "currency": "EUR",
    "turnoverTaxIncluded": 549,
    "turnoverTaxFree": 456.2,
    "quantity": 1,
    "nbDistinctProduct": 1
});
tag.ecommerce.displayCart.products.set([{
    "id": "1",
    "name": "laptop_ACER_A56",
    "priceTaxIncluded": 549,
    "priceTaxFree": 456.2,
    "quantity": 1,
    "category1": "Home",
    "category2": "Computers_and_Networking",
    "category3": "Computers",
    "category4": "Laptops",
    "category5": "Acer",
    "category6": "Chromebook"
}]);
tag.dispatch();
 

Cart update

The Tracker has two declaration methods:

  • tag.ecommerce.updateCart.cart.set()

Measurement of a cart update is done via declaring a cart object.

The cart is declared as an object that can have the following properties:

  • “id” – String: Cart ID (this parameter is mandatory).
  • “currency” – String: Currency.
  • “turnoverTaxIncluded” – Float: Total cart amount, tax incl.
  • “turnoverTaxFree” – Float: Total cart amount, tax excl.
  • “quantity” – Number: Number of products in cart.
  • “nbDistinctProduct” – Number: Number of distinct products in cart.

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.updateCart.cart.set({
    "id": "34",
    "currency": "EUR",
    "turnoverTaxIncluded": 1098,
    "turnoverTaxFree": 912.4,
    "quantity": 2,
    "nbDistinctProduct": 1
});
tag.dispatch();
 

Display of shipping step

The Tracker has the following declaration methods:

  • tag.ecommerce.deliveryCheckout.cart.set()
  • tag.ecommerce.deliveryCheckout.shipping.set()

Measurement of the shipping step is done via declaring a cart object and a shipping object.

The cart is declared as an object that can have the following properties:

  • “id” – String: Cart ID (this parameter is mandatory).
  • “currency” – String: Currency.
  • “turnoverTaxIncluded” – Float: Total cart amount, tax incl.
  • “turnoverTaxFree” – Float: Total cart amount, tax excl.
  • “quantity” – Number: Number of products in cart.
  • “nbDistinctProduct” – Number: Number of distinct products in cart.

Shipping information is declared as an object that can have the following properties (to be filled in if known at this step):

  • “delivery” – String: Name of delivery provider
  • “costTaxIncluded” – Float: Shipping fees, tax incl.
  • “costTaxFree” – Float: Shipping fees, tax excl.

Delivery data only needs to be entered once, either in the delivery step or in the payment step.

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.deliveryCheckout.cart.set({
    "id": "34",
    "currency": "EUR",
    "turnoverTaxIncluded": 557.4,
    "turnoverTaxFree": 463.2,
    "quantity": 1,
    "nbDistinctProduct": 1
});
tag.ecommerce.deliveryCheckout.shipping.set({
    "delivery": "My carrier",
    "costTaxIncluded": 8.4,
    "costTaxFree": 7
});
tag.dispatch();
 

Display of payment step

The Tracker has the following declaration methods:

  • tag.ecommerce.paymentCheckout.cart.set()
  • tag.ecommerce.paymentCheckout.shipping.set()

Measurement of the payment step is done via declaring a cart object and a shipping object.

The cart is declared as an object that can have the following properties:

  • “id” – String: Cart ID (this parameter is mandatory).
  • “currency” – String: Currency.
  • “turnoverTaxIncluded” – Float: Total cart amount, tax incl.
  • “turnoverTaxFree” – Float: Total cart amount, tax excl.
  • “quantity” – Number: Number of products in cart.
  • “nbDistinctProduct” – Number: Number of distinct products in cart.

Shipping information is declared as an object that can have the following properties:

  • “delivery” – String: Name of delivery provider.
  • “costTaxIncluded” – Float: Shipping fees, tax incl.
  • “costTaxFree” – Float: Shipping fees, tax excl.

Delivery data only needs to be entered once, either in the delivery step or in the payment step.

Example

var tag = new ATInternet.Tracker.Tag();
tag.ecommerce.paymentCheckout.cart.set({
    "id": "34",
    "currency": "EUR",
    "turnoverTaxIncluded": 557.4, //Shipping fees included
    "turnoverTaxFree": 463.2, //Shipping fees included
    "quantity": 1,
    "nbDistinctProduct": 1
});
tag.ecommerce.paymentCheckout.shipping.set({
    "delivery": "My carrier",
    "costTaxIncluded": 8.4,
    "costTaxFree": 7
});
tag.dispatch();
 

Appendices

 

Tagging methods

  • tag.ecommerce.displayCart.cart.set
  • tag.ecommerce.displayCart.products.set
  • tag.ecommerce.updateCart.cart.set
  • tag.ecommerce.deliveryCheckout.cart.set
  • tag.ecommerce.deliveryCheckout.shipping.set
  • tag.ecommerce.paymentCheckout.cart.set
  • tag.ecommerce.paymentCheckout.shipping.set
 

Setup variables

Name Default value Description Version
Ecommerce.collectDomain “” Sales Insights collect domain  >= 6.1.0
Ecommerce.autoSalesTracker false Enable automatic SalesTracker order content measurement on a transaction confirmation event  >= 6.1.0
Was this post helpful?
Yes
No
Last update: 08/01/2019