<script type="text/javascript">
(function () {
let q = [];
if(!window.Goaffpro){
window.Goaffpro = function(){
q.push(arguments);
}
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://static.goaffpro.com/client_sdk.js';
s.onload = ()=>q.forEach((item)=> Goaffpro.apply(null, item))
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
Goaffpro('init', 'my-storefront-token');
Goaffpro('track-conversion', {
id: order.id,
number: order.name,
total_price: order.total_price,
subtotal_price: order.subtotal_price,
total_discounts: order.total_discounts,
email: order.email,
line_items: order.order_items.map(function(item){
return {
product_id: item.product_id,
variant_id: item.variant_id,
price: item.price,
quantity: item.quantity,
name: item.name,
total_discount: item.total_discount
}
})
});
</script>