Purchase
How to implement the "purchase" tracking event
<script>
function onPurchase() {
let purchasePayload = {
"order_id": "123456789",
"currency": "USD",
"subtotal": "40.00",
"total_discounts": "5.00",
"order_value": "50.00",
"line_items": [{
"sku": "TSHIRT-RED-M",
"quantity": 2,
"price": "15.00",
"name": "Red T-shirt (M)"
},
{
"sku": "BANANA",
"quantity": 10,
"price": "1.00",
"name": "Organic Banana"
}
]
};
window._fwn.analytics.purchase(purchasePayload);
}
//Call the function when purchase happens or on the load of thank you or order confirmation page
document.addEventListener('DOMContentLoaded', function() {
onPurchase();
});
</script>Payload for purchase tags:
Key
Type
Required?
Description
Payload for line_item:
Key
Type
Required?
Description
Payload for product:
Key
Type
Required?
Description
Debugging issues with purchase tracking

Shopify <> Firework Purchase Tracking
Verifying purchase tracking in Shopify

Last updated
Was this helpful?