The Line-Up checkout flow is hosted in an iFrame on your domain. Tracking conversion across multiple domains raises a number of challenges. In order to overcome these challenges; the Line-Up booking widget triggers two key conversion events on the host page where it is embedded. This allows you to run your own custom conversion tracking code without the need to worry about corss-domain tracking.
To set up the conversion events, you need to add two new options to the embed code:
data-lineup-on-purchase="onPurchase"
data-lineup-on-add-basket="onAddToCart"
These two options should be the names of functions on the parent page (the one hosting the Booking Widget). The functions will be called when those actions take place within the booking journey. Each function is called with the reservation/orderId and the total value of the order. If you want to track the purchase event with a Facebook pixel - you would need a function on the host page like the example below:
var onPurchase = function(orderId, totalAmount){
fbq("track", "Purchase", {
value: totalAmount,
currency: 'GBP'
});
};
Comments
0 comments
Article is closed for comments.