Skip to content

Events

To gather the necessary data for displaying performance on the dashboard, use the ftltag() function to send events.

<script>
ftltag('event', 'event_type', {
event_data
}, debug);
</script>

Parameters of ftltag()

event

type: string

This parameter indicates that you are sending an event.


event_type

type: string

This specifies the type of event you want to send. There are two types of events.


event_data

type: object

This is an object that contains all the necessary data based on the event type. Data differs depending on the event type. Here’s an example for the cart event:

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

debug

type: boolean

This parameter is for developers during implementation. When set to true, it enables logging in the console for debugging purposes.

Types of Events

Event: cart

This event should be sent when a product is added to the cart.

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

Data to Include

product_id

type: string

This is the identifier for the product. It should match the identifier used in the product feed and widget attributes.


size

type: string

This indicates the size selected by the customer. Use uppercase letters or numbers.

Event: transaction_end

This event should be sent when an order is completed. Ensure that this event is sent only after the transaction is confirmed. All products included in the purchase should be listed in the products array.

Example:

<script>
ftltag('event', 'transaction_end', {
order_id: 'T123987Z',
products: [
{
currency: 'EUR',
id: 'P01XJ45',
price: 59.99,
quantity: 2,
size: 'M',
},
// Additional products can be added here
],
total_price: 159.99,
});
</script>

Data to Include

order_id

type: string

This is the identifier for the order.


products

type: Product[]

This is a list of products that were purchased.

Product Structure
type Product = {
currency: string; // The currency code (ISO 4217)
id: string;
price: number; // Price paid by the customer
quantity: number;
size: string;
}
total_price

type: number

This represents the total amount for the order, including taxes and shipping costs, as paid by the customer.

Guides