Tipser Analytics

Tipser has implemented an event for the Tipser Widget Analytics that users of the script can listen to in order to gather analytics about Tipser interactions and feed them into their own analytics engines.

General overview of the Tipser Analytics Collector

By listening to the event tw-track certain Tipser events can be gathered and pushed into an external analytics engine.

The statistics event contains the object detail that contains the following items:

detail = {
  action: <action>, //what action is taken on the target, mandatory
  target: <target>, //where this action is taken, mandatory
  description: <description>, //describing what is being logged
  object: //details about the tracked object, e.g. collection ID, product ID, etc.
  [    
    {       
    Id: <id>, // object can contain different set of fields
    name: <name>, // depending on what event occurs       
    merchant: <merchant>, // like id, name, merchant, brand       
    brand: <brand>, // some of them can have empty array in case of no custom parameters       
    ... // e.g. click cart tab or view list     
    },     
  ..., // this array can contain more than 1 object
  ]
}

Example of an event listener:

function trackTester(e) {
  console.log('tw-track ' +
  'action: "' + e.detail.action + '", ' +
  'target: "' + e.detail.target + '", ' +
  'description: ' + e.detail.description);
};
document.addEventListener('tw-track', trackTester, false);

View tagged image

When a tagged image is in viewport

description: ‘Viewport scrolled’,
action: 'View', 
target: 'Image-tag',
object: [
  {
    id: <product id>,
    name: <product name>,
    image: <url to first image in a product list>,
    salesPriceIncVat: <the price the product is sold for including VAT>
  }
]

Click image tag

When a tag on an image is clicked

description: 'Image tag clicked',
action: 'Click',
target: 'Image-tag',
object: [
  <product information. See below>
]

View collection

When a collection is in viewport

description: ‘Viewport scrolled’,
action: 'View',
target: 'List',
object: [
  {
    id: <product id>,
    name: <product name>,
    brand: <product brand name>,
    image: <url to first image in a product list>,
    variant: <list of variant items for current product>,
    listPriceIncVat: <original price>,
    salesPriceIncVat: <the price the product is sold for including VAT>,
    categories: [<list of categories>},{...}]} 
]

Click cart tab

When the shopping cart tab is clicked

description: 'Cart clicked',
action: 'Click',
target: 'Cart-tab',
object: [ 
  {
    id: <product id>,
    name: <product name>,
    merchant: <product merchant name>,
    image: <url to first image in a product list>,
    listPriceIncVat: <original price>,
    salesPriceIncVat: <the price the product is sold for including VAT>, 
    quantity: <number of products this product in cart>,
    posId: <The id of the point of sale where the product was found> }
]

View the shop

When the Tipser shop is viewed

description: 'Shop viewed',
action: 'View',
target: 'Shop',
object: [
  { 
    url_slug: <shop URL slug> 
  }
]

Click menu item in shop

When a menu item is clicked in the shop

description: 'List clicked',
action: 'Click,
target: 'List',
object:[
  { 
    id: <collection id>
  } 
]

Click product in collection

When a product in a collection is clicked

description: 'Product tile clicked',
action: 'Click',
target: 'Product tile',
object: [ <product information. See below>
]

View product

When a product in a collection is viewed

description: 'Product detail page viewed',
action: 'View',
target: 'Product',
object: [ <product information. See below>
]

Add product to cart

When a product is added to a shopping cart

description: ‘Product added to cart’,
action: 'Cart',
target: 'Product',
object: [ <product information. See below>
]

View cart

When viewing the cart (not only when adding a product)

description: ‘View cart’,
action: 'View',
target: 'Cart',
object: [ 
  {Products: [ <order information. See below>, <order information. See below>, … ] } 
]

View Cart - with purchase intent

When viewing the cart, and getting payment in view

description: 'View cart - payment in viewport',
action: 'View',
target: 'Payment',
object: [
  { Products: [ <order information. See below>, <order information. See below>, … ] }
]

Purchase

When a product was bought (thank you page)

description: ‘Product purchased’,
action: 'Purchase',
target: 'Order',
object: [
  {
    OrderId: <order number>,
    Products: [ <order information. See below>,
    <order information. See below>, … ] }
]

Product information

All requests that have a product in a response should have these fields

Products: [
  {
    id: <product id>, 
    name: <product name>,
    merchant: <product merchant name>,
    brand: <product brand name>,
    image: <url to first image in a product list>,
    variant: <list of variant items for current product>,
    listPrice: <original price>,
    listPriceIncVat: <original price>,
    salesPrice: <the price the product is sold for>,
    salesPriceIncVat: <the price the product is sold for including VAT>,
    categories: <list of categories>},
  {...}
]

Order information

All requests that have an order in a response should have these fields

Products: [
  {
    id: <product id>,
    name: <product name>,
    merchant: <product merchant name>,
    brand: <product brand name>,
    image: <url to first image in a product list>,
    variant: <list of variant items for current product>,
    listPrice: <original price>,
    listPriceIncVat: <original price>,
    salesPrice: <the price the product is sold for>,
    salesPriceIncVat: <the price the product is sold for including VAT>,
    categories: <list of categories>},
  {...}
],
campaign: <campaign id>,},{...}]