Ecommerce Tracking
  • 31 Mar 2022
  • 4 Minutes to read
  • Contributors
  • Dark
    Light

Ecommerce Tracking

  • Dark
    Light

Whenever a product is involved there are certain properties and activities that are relevant for tracking. The following properties and interactions lift your ecommerce data off.

A product can be tracked in the following interaction types:

  • productview
  • addtocart
  • removefromcart
  • cartview
  • checkout
  • order
  • productimpression
  • productlist
  • productlistclick
  • search

The type property in a product object is a reserved namespace. A product must always define a type value.

Dependencies and Consistency

With JENTIS you can use a linear way to push data to be used with ecommerce tracking. That means all commands and objects to be tracked must be called in a certain order, so they are all part of the same interaction and type.

The following example will make this process more clear.

Here we have a page where a product was purchased, so it is part of an “order”. We track first all products that were purchased with “type”:”order” and an “track”:”order” with an order.id (“order_1”).

At the same time on that page a product is displayed in a product list (“suggested-products”). This product has the type “productlist”, so it is clearly not a product from that order.

_jts.push({
    "track"        :    "product",
    "type"        :    "order",
    "id"        :    "12345567",
    "name"        :    "Baby Oil"
});
_jts.push({
    "track"        :    "order",
    "id"        :    "order_1"
});

_jts.push({
    "track"        :    "product",
    "type"        :    "productlist",
    "id"        :    "7890",
    "name"        :    "Baby Shoes"
});
_jts.push({
    "track"        :    "productlist",
    "listname"    :    "suggested-products"
});

_jts.push({
    "track"        :    "submit"
});

As you can see, the products have always a type property, that defines more on the context of where that product was interacted with.

A more detailed description on the connection of tracked objects and properties can be found here: States Manual.

In a visual representation the following displays the relation between a product, type-objects and the summary of all information into a single state. That is created on track:submit call.

In this example we can see a pageview is tracked with a title “Detail Page”. Additionally three products are tracked. One is type: productview and two others are part of a type : listview

Product A is related to a productview, this document type has no more properties or values and therefor there is only a single track: productview command.

Product B and C are related to a listview. Additionally the track: listview command has a property on the Listview object: listname: Related Prods .

All is summarized by the track: submit command at the end.

Product Object Schema

A product can have certain object properties. This is a default defined by JENTIS. Feel free to add property keys and values to the same objects. You can then use them as new variables in your JTM.

Trackingcommand: “product”

Properties

NameDescriptionTypeMandatoryExample
idUnique ID per productstringyesab12
typeThe type is defined as the ecommerce-function the product is linked to (f.e. productview, currentcart, …)stringyescurrentcart
nameA meaningful name for the productstringnoBaby Oil
groupThe product groups in which the product is listed according to the ERP system.arrayno["Small Sortiment","Baby"]
bruttoThe price of the product including VAT.decimalno14.90
nettoThe price of the product excluding VAT.decimalno12.42
positionThe position of the product in a list of products.intno4
oldbruttoIf the product has been discounted, state the original price of the product including VAT heredecimalno18.90
oldnettoIf the product has been discounted, state the original price of the product excluding VAT heredecimalno16.90
brandThe brand of the productstring|arrayno["Milka","Cholatex"]
quantityThe amount of the productintno3

Example

_jts.push({
    "track"        :    "product",
    "type"        :    "order",
    "id"        :    "12345567",
    "name"        :    "Baby Oil",
    "group"        :    ["Small Sortiment","Baby"],
    "brutto"    :    123.90,
    "netto"        :    110.90,
    "oldbrutto"    :    150.00,
    "oldnetto"    :    140.00,
    "brand"        :    "Milka",
    "quantity"    :    3,
    "position"    :    2
});

Product Type Schemas and Interactions

The following objects can be defined in context with products to be tracked. They must match a products type property, so the product and that tracked interaction are connected.

productlist

Multiple products displayed in a list can be tracked as type: 'productlist'.

Trackingcommand: “productlist”

Properties:

NameDescriptionTypemandatoryExample
listnameA meaningful name for the liststringyes“main-slider”
_jts.push({
    "track"        :    "productlist",
    "listname"    :    "main-slider"
});

productview

When a product is in focus of a page (also known as product detail pages) this type is helpful.

Trackingcommand: “productview”

Properties: No Properties

Example:

_jts.push({
    "track"        :    "productview"
});

addtocart

This interaction signals that a product was added to the basket.

Trackingcommand: “addtocart”

Properties: no properties

example:

_jts.push({
    "track"        :    "addtocart"
});

removefromcart

If the visitor removes a product from the shopping cart use the “removefromcart” command. 

Trackingcommand: “removefromcart”

Properties: no properties

example:

_jts.push({
    "track"        :    "removefromcart"
});

cartview

Whenever a basket is displayed on a page or in a window popping up use the cartview command.

This step is optional and can be replaced with a checkout interaction when needed.

Trackingcommand: “cartview”

Properties: no properties

example:

_jts.push({
    "track"        :    "cartview"
});

checkout

If the visitor navigates through the checkout use the tracking command “checkout”.

Trackingcommand: “checkout”

Properties:

NameDescriptionTypeMandatoryExample
stepThe current step of the checkoutintyes2
bruttoThe price of all products currently in the cart including VATdecimal
199.99
nettoThe price of all products currently in the cart excluding VATdecimal
179.99
shippingThe shipping costs of the current checkoutdecimal
20.00
taxThe sum of taxes in the cartdecimal
40.00
paytypeThe current choosen method for paying the cartstring
creditcart

Example

_jts.push({
    "track"        :    "checkout",
    "step"        :    2,
    "brutto"    :    199.99,
    "netto"        :    179.99,
    "shipping"    :    20.00,
    "tax"        :    40.00,
    "paytype"    :    "creditcard"
});

order

If the visitor has completed a purchase, use the tracking command “order” on the thank you page.

Trackingcommand: “order”

Properties:

NameDescriptionTypeMandatoryExample
orderidDefines the unique orderid / transactionid of the order / purchasestringyes182jd773j
bruttoThe price of all products from the order including VATdecimalyes125.80
nettoThe price of all products from the order excluding VATdecimalno111.11
subtotalThe subtotal is the value of all goods on an invoice without discount or other rebates, and no shipping costs applied.decimalno120.11
taxThe sum of taxes from the orderdecimalno20.96
shippingThe shipping costs of the orderdecimalno5.90
zipThe zipcode of the orderstringno1120
cityThe city of the orderstringnovienna
countryThe country of the orderstringnoaustria
paytypeThe choosen method for paying the orderstringnocreditcard

Example

_jts.push({
    "track"        :    "order",
    "orderid"    :    "12345666",
    "brutto"    :    199.99,
    "netto"        :    170.99,
    "subtotal"    :    111.99,
    "tax"        :    40.00,
    "shipping"    :    20.00,
    "zip"        :    "2273",
    "city"        :    "Hohenau an der March",
    "country"    :    "Austria",
    "paytype"    :    "creditcard",
    "vouchers"    :    [
        {
            "code":        "edc123",
            "value":    15.80,
            "type":        "coupon"
            "appliedAmount" : 15.80
            "name":        "Coupon-2018"
        }
    ]
});


Was this article helpful?