eCommerce Examples
Below you can find some examples for custom event tracking for an ecommerce website.
This data can further be used on Flowpoint for tracking funnels and insights on cohorts of users.
Purchase event
window.flowpoint.track("purchase", {
transaction_id: "transactionId",
value: 14.20,
tax: 4.90,
shipping: 5.99,
currency: "GBP",
coupon: "SUMMER_SALE",
items: [
// You can add multiple purchased items here
{
item_id: "SKU_12345",
item_name: "Happy shirt",
affiliation: "Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Brand 1",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1
}]
})
Viewing a product
window.flowpoint.track("View item list", {
item_list_id: "related_products",
item_list_name: "Related products",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Brand 2",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "kmweqlkwmelzss",
price: 9.99,
quantity: 1
}
]
});
Add product to cart
window.flowpoint.track("Add to cart", {
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Brand 2",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "kmweqlkwmelzss",
price: 9.99,
quantity: 1
}
]
});
Remove product from cart
window.flowpoint.track("Remove from cart", {
currency: "GBP",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "T shirt 4",
affiliation: "Store 2",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Flowpoint 2",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "asklmdqwlkeql",
price: 9.99,
quantity: 1
}
]
});
View cart
window.flowpoint.track("View cart", {
currency: "GBP",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Flowpoint 2",
coupon: "CARNIVAL",
discount: 2.22,
index: 0,
item_brand: "Flowpoint 3",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1
}
]
})
Add product to wishlist
window.flowpoint.track("Add to wishlist", {
currency: "GBP",
value: 7.77,
wishlist_id: 'abcdef',
items: [
{
item_id: "SKU_12345",
item_name: "Item 123",
affiliation: "Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Flowpoint 3",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1
}
],
})