Skip to content

Events

Events are essential for the Fitle dashboard, as they provide valuable insights into the performance of our solution. Without properly set up events, your dashboard will not display useful information. Therefore, it is crucial to send events.

Some events are automatically generated by the widget, such as widget impressions and recommendations.

This section explains how to send additional events to track actions that we cannot automatically monitor, such as adding products to the cart and completing purchases.

To facilitate this, we have developed a JavaScript module that handles event sending for you. You simply need to call it with the appropriate information.

Setup

Before sending any events using the ftltag() function, add the following script to the <head> section of your website.

<script>
window.ftldataLayer = window.ftldataLayer || [];
ftltag = ftltag || function() {
ftldataLayer.push(arguments);
};
ftltag('config', {clientId: '<client_id>', shopCountry: '..'});
</script>
<script async type="module" src="https://recommender.fitle.com/ftltag.js"></script>

Usage

Once the script is in place, you can call the ftltag() function with the appropriate data. The function will enhance the data with additional information and send it to Fitle’s APIs.

Here’s an example of how to call the function when a user adds a product to the cart:

<script>
ftltag('event', 'cart', {
product_id: 'P01XJ45',
size: 'L'
});
</script>

Platform Guides

References