JS | New events to hook into for Javascript

We have added new events that are being fired at different points of using the JS Implementation and JS Suggestions. These can be used to hook into for implementing custom functionality and business logic.

JS Implementation

  • The twn.product.visible event is fired when a product tile is visible on the screen (technically it goes for the middle pixel on the entire tile, so you must scroll at least 50% for this event to be fired).
  • The twn.product.click event is fired when a link is clicked on the product tile (right click or middle click; any anchor tag including the one on the product image).

These events are useful for additional tracking the impressions of for example products fetched from an external source.

Suggestions JS

  • twn.request.started - Request to fetch suggestions has started
  • twn.request.products.started - Request to fetch product suggestions has started
  • twn.request.success - Request to fetch suggestions has succeeded
  • twn.request.products.success - Request to fetch product suggestions has succeeded
  • twn.request.failed - Request to fetch suggestions has failed
  • twn.request.products.failed - Request to fetch product suggestions has failed
  • twn.request.completed - Request to fetch suggestion has been completed
  • twn.request.products.completed - Request to fetch product suggestions has been completed

Series of events following the lifecycle of requests to fetch the suggestion data.

Read our complete Tweakwise JS documentation for more information on how to implement this.