Events Tracking

Users (and possible customers) behaviour can be tracked while using the embed code.

A simple way to configure such tracking is to use the options argument (the second one) of particular proxy method while using the base Autheos class. For example:

var query = {
  ean: ['1234567890123'],
  language: ['nl', 'en'],
};
var options = {
  events: {
    'add-to-cart': '#your-add-to-cart-selector',
    'some-other-event-name': '.some-other-element-on-the-page',
  },
};
Autheos.thumbnail(query, options);

Alternatively, the config argument could be used with the AutheosUI approach showed in Configuring guide.

For more advanced scenarios, please check out the trackEvent and attachTracker methods of the base class.

Additional events data#

To improve performance of machine learning models that optimize video experience, all events can contain additional information.

The following snippet shows how to send some product-related data for each defined event, but it could be almost anything that might have influence on users decision.

var eventsData = {
  price: 123.45,
  discountPrice: 200.0, /* OR `undefined` if NOT present */
  inventoryLevel: 'outOfStock',
  userId: 'u-12345', /* if already registered, logged in, and known */
};
var query = {
  eventsData: JSON.stringify(eventsData),
  ean: ['1234567890123'],
  language: ['nl', 'en'],
};
Autheos.thumbnail(query);