Ecommerce track events typically contain the same information across platforms—products, brands, orders, cart information, etc. However, each destination might map this information differently.
Our ecommerce specification helps you send events in a uniform format that maps destination actionsThe source event and data that triggers an API call to your destination. For example, an incoming identify event from your sources adds or updates a person in our Customer.io Journeys destination., making it easier to set up destinations. When you send data using our ecommerce specification, you can use our out-of-the-box actions without having to map your incoming data to each destination.
Handling arrays of products
Some destinations don’t take arrays. In these cases, you may need to flatten arrays of products. See individual destination documentation for more information on supported events and properties.
Event lifecycles
You can see a complete list of ecommerce events and all associated properties on our API reference page. But it can also help to understand the typical events that a person may perform and the order they’re likely to perform them in, as they browse and buy products.
Examples in this section are based on our JavaScript library
To simplify the examples on this page, we’ve based everything on our client-side library. But you can send ecommerce events from any source.
Browsing products
Browsing events represent key events that a customer might have while browsing for products.
analytics.track('Product List Viewed',{list_id:'hot_deals_1',category:'Deals',products:[{product_id:"coolshoes-123"sku:"abc-123-xyz"category:"shoes"name:"Cool Shoes"brand:"A Shoe Brand"price:139.99position:1url:"https://www.example.com/product/123"image_url:"https://www.example.com/product/123.jpg"},{product_id:"coolshoes-456"sku:"abc-456-xyz"category:"shoes"name:"Even Cooler Shoes"brand:"A Different Shoe Brand"price:159.99position:2url:"https://www.example.com/product/456"image_url:"https://www.example.com/product/456.jpg"}]});
categorystring
The product category a person viewed.
list_idstring
The product list a person viewed.
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
couponstring
The coupon code associated with the product (like NEWUSER20).
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
positionnumber
The position of the product in the list.
pricenumber
The price of the product.
product_idstring
The product ID.
quantityinteger
The quantity of the product.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
analytics.track('Product List Filtered',{list_id:"all_shoes",category:"shoes",products:[{product_id:"coolshoes-123",sku:"abc-123-xyz",category:"shoes",name:"Cool Shoes",brand:"A Shoe Brand",variant:"red",price:139.99,quantity:1,coupon:"NEWUSER20",position:3,url:"https://www.example.com/product/123",image_url:"https://www.example.com/product/123.jpg"}],filters:[{type:"string",value:"string"}],sorts:[{type:"string",value:"string"}]})
categorystring
The product category a person viewed.
typestring
The ID of the filter type.
valuestring
The ID of the value of the filter.
list_idstring
The product list a person viewed.
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
couponstring
The coupon code associated with the product (like NEWUSER20).
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
positionnumber
The position of the product in the list.
pricenumber
The price of the product.
product_idstring
The product ID.
quantityinteger
The quantity of the product.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
typestring
The ID of the sort type.
valuestring
The ID of the selection type, like ascending or descending.
Promotions overview
Promotion events let you know when someone sees or interacts with offers within your app. For example, you might send a Promotion Viewed event when your app shows a banner advertisement to a user. If the user clicks the ad, you’d send the Promotion Clicked event.
The creative content ID associated with the promotion.
namestring
The name of the promotion a person viewed.
positionstring
The position of the promotion a person viewed.
promotion_idstring
The ID of the promotion a person viewed.
Product order overview
These events represent the typical lifecycle of a product order.
Action
Description
Product Clicked
User clicked on a product
Product Viewed
User viewed a product details
Product Added
User added a product to their shopping cart
Product Removed
User removed a product from their shopping cart
Cart Viewed
User viewed their shopping cart
Checkout Started
User initiated the order process (a transaction is created) You should send this event on the page that the customer lands on after they click Checkout (or a similar button).
Checkout Step Viewed
User viewed a checkout step. You can have as many checkout steps as you want.
Checkout Step Completed
User completed a checkout step. You can have as many checkout steps as you want.
analytics.track('Payment Info Entered',{checkout_id:"cool_persons_checkout_123",step:2,shipping_method:"ground",payment_method:"Visa",order_id:"order123"})
The ID of the cart that the coupon applies to (if applicable).
coupon_idstring
the coupon ID the person entered.
order_idstring
The order/transaction the coupon applies to (if applicable).
analytics.track(‘Coupon Applied’, {
order_id: “order123”,
cart_id: “cool_persons_cart_123”,
coupon_id: “NEWUSER20”,
coupon_name: “$20 off for new users”,
discount: 20
})
cart_idstring
The ID of the cart that the coupon applies to (if applicable).
coupon_idstring
the coupon ID the person entered.
coupon_namestring
The name of the coupon, if applicable.
discountnumber
The discount applied through the coupon. This is the ammount subtracted from the total in other transaction events.
order_idstring
The order/transaction the coupon applies to (if applicable).
analytics.track(‘Coupon Applied’, {
order_id: “order123”,
cart_id: “cool_persons_cart_123”,
coupon_id: “NEWUSER20”,
coupon_name: “$20 off for new users”,
reason: “Not customer’s first order”
})
cart_idstring
The ID of the cart that the coupon applies to (if applicable).
coupon_idstring
the coupon ID the person entered.
coupon_namestring
The name of the coupon, if applicable.
order_idstring
The order/transaction the coupon applies to (if applicable).
reasonstring
The reason the coupon was denied.
analytics.track(‘Coupon Removed’, {
order_id: “order123”,
cart_id: “cool_persons_cart_123”,
coupon_id: “NEWUSER20”,
coupon_name: “$20 off for new users”,
discount: 20
})
cart_idstring
The ID of the cart that the coupon applies to (if applicable).
coupon_idstring
the coupon ID the person entered.
coupon_namestring
The name of the coupon, if applicable.
discountnumber
The discount applied through the coupon. This is the ammount subtracted from the total in other transaction events.
order_idstring
The order/transaction the coupon applies to (if applicable).
Wishlisting overview
Send these events if your ecommerce app supports wishlist features.
Action
Description
Product Added to Wishlist
User added a product to the wish list
Product Removed from Wishlist
User removed a product from the wish list
Wishlist Product Added to Cart
User added a wishlist product to the cart
analytics.track('Product Added to Wishlist',{wishlist_id:"wishlist123",wishlist_name:"Favorite Shoes",product_id:"coolshoes-123",sku:"abc-123-xyz",category:"shoes",name:"Cool Shoes",brand:"A Shoe Brand",variant:"red",price:139.99,quantity:1,coupon:"NEWUSER20",position:3,url:"https://www.example.com/product/123",image_url:"https://www.example.com/product/123.jpg"})
wishlist_idstring
The ID of the wishlist that the product applies to.
wishlist_namestring
The name of the wishlist that the product applies to.
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
couponstring
The coupon code associated with the product (like NEWUSER20).
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
positionnumber
The position of the product in the list.
pricenumber
The price of the product.
product_idstring
The product ID.
quantityinteger
The quantity of the product.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
analytics.track('Product Removed from Wishlist',{wishlist_id:"wishlist123",wishlist_name:"Favorite Shoes",product_id:"coolshoes-123",sku:"abc-123-xyz",category:"shoes",name:"Cool Shoes",brand:"A Shoe Brand",variant:"red",price:139.99,quantity:1,coupon:"NEWUSER20",position:3,url:"https://www.example.com/product/123",image_url:"https://www.example.com/product/123.jpg"})
wishlist_idstring
The ID of the wishlist that the product applies to.
wishlist_namestring
The name of the wishlist that the product applies to.
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
couponstring
The coupon code associated with the product (like NEWUSER20).
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
positionnumber
The position of the product in the list.
pricenumber
The price of the product.
product_idstring
The product ID.
quantityinteger
The quantity of the product.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
analytics.track('Wishlist Product Added to Cart',{wishlist_id:"wishlist123",wishlist_name:"Favorite Shoes",product_id:"coolshoes-123",sku:"abc-123-xyz",category:"shoes",name:"Cool Shoes",brand:"A Shoe Brand",variant:"red",price:139.99,quantity:1,coupon:"NEWUSER20",position:3,url:"https://www.example.com/product/123",image_url:"https://www.example.com/product/123.jpg"})
cart_idstring
The ID of the cart that the product was added to.
wishlist_idstring
The ID of the wishlist that the product applies to.
wishlist_namestring
The name of the wishlist that the product applies to.
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
couponstring
The coupon code associated with the product (like NEWUSER20).
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
positionnumber
The position of the product in the list.
pricenumber
The price of the product.
product_idstring
The product ID.
quantityinteger
The quantity of the product.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
Sharing overview
If your store integrates with social apps or or supports sharing, you can send events when your customers share product information.
Action
Description
Product Shared
Shared a product with one or more friends
Cart Shared
Shared the cart with one or more friends
analytics.track('Product Shared',{share_via:"email",share_message:"Check out these cool shoes!",recipient:"friendOfcool.person@example.com",product_id:"coolshoes-123",sku:"abc-123-xyz",category:"shoes",name:"Cool Shoes",brand:"A Shoe Brand",variant:"red",price:139.99,url:"https://www.example.com/product/123",image_url:"https://www.example.com/product/123.jpg"})
brandstring
The brand associated with the product.
categorystring
The product category a person viewed.
image_urlstring
The URL of the product image.
namestring
The name of the product a person viewed.
pricenumber
The price of the product.
product_idstring
The product ID.
recipientstring
The person the product was shared with.
share_messagestring
The message the customer sent with the share.
share_viastring
The channel the product was shared through.
skustring
The stock keeping unit (SKU) of the product a person viewed.
urlstring
The URL of the product page.
variantstring
The variant of the product a person viewed, if applicable.
analytics.track('Cart Shared',{share_via:"email",share_message:"Check out my cart!",recipient:"friendOfcool.person@example.com",cart_id:"cool_persons_cart_123",products:[{product_id:"coolshoes-123"}]})
cart_idstring
The shopping cart ID.
product_idstring
The product ID.
recipientstring
The person the product was shared with.
share_messagestring
The message the customer sent with the share.
share_viastring
The channel the product was shared through.
Reviewing overview
Send the Product Reviewed event when customers review products in your store.
Action
Description
Product Reviewed
User reviewed a product
analytics.track('Product Reviewed',{product_id:"coolshoes-123",review_id:"review_123",review_body:"These shoes are great!",rating:5})
product_idstring
The product ID.
ratinginteger
The rating the customer gave the product.
review_bodystring
The body of the review.
review_idstring
The ID of the review.
Copied to clipboard!
Contents
Is this page helpful?
How can we make it better?
We appreciate your feedback!
Our support team will contact you as soon as possible