Ecommerce events specification

Last updated:

|Edit this page

PostHog's ecommerce spec helps define the journey for a customer as they browse your store, click on promotions, view products, add those products to a cart, and complete a purchase.

This spec serves as the foundation for our CDP destination templates. We recommend implementing this spec to avoid having to manually map events and properties to our CDP destinations.

Event lifecycle overview

Here is a list of supported events for our various categories within the customer journey.

Browsing

EventDescription
Products SearchedUser searched for products
Product List ViewedUser viewed a product list or category
Product List FilteredUser filtered a product list or category

Promotions

EventDescription
Promotion ViewedUser viewed promotion
Promotion ClickedUser clicked on promotion

Ordering

EventDescription
Product ClickedUser clicked on a product
Product ViewedUser viewed a product details
Product AddedUser added a product to their shopping cart
Product RemovedUser removed a product from their shopping cart
Cart ViewedUser viewed their shopping cart
Checkout StartedUser initiated the order process
Checkout Step ViewedUser viewed a checkout step
Checkout Step CompletedUser completed a checkout step
Payment Info EnteredUser added payment information
Order CompletedUser completed the order
Order UpdatedUser updated the order
Order RefundedUser refunded the order
Order CancelledUser cancelled the order

Coupons

EventDescription
Coupon EnteredUser entered a coupon on a shopping cart or order
Coupon AppliedCoupon was applied on a user’s shopping cart or order
Coupon DeniedCoupon was denied from a user’s shopping cart or order
Coupon RemovedUser removed a coupon from a cart or order

Wishlisting

EventDescription
Product Added to WishlistUser added a product to the wishlist
Product Removed from WishlistUser removed a product from the wishlist
Wishlist Product Added to CartUser added a wishlist product to the cart

Sharing

EventDescription
Product SharedShared a product with one or more friends
Cart SharedShared the cart with one or more friends

Reviewing

EventDescription
Product ReviewedUser reviewed a product

Browsing

The browsing lifecycle events are associated with key activities that a customer might perform while browsing through your website or mobile app.

Products Searched

Fire this event when a visitor searches for products. The following properties are supported:

PropertyTypeDescription
queryString | ObjectQuery the user searched with

Example:

JavaScript
posthog.capture('Products Searched', {
query: 'blue roses'
});

Product List Viewed

Fire this event when a visitor views a product list or category. The following properties are supported:

PropertyTypeDescription
list_idStringProduct list being viewed
categoryStringProduct category being viewed
productsArray<Product>Products displayed in the list
products.$.product_idStringProduct id displayed on the list
products.$.skuStringSKU (Stock Keeping Unit) of the product being viewed
products.$.categoryStringProduct category being viewed
products.$.nameStringName of the product being viewed
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product being viewed
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code associated with a product (for example, MAY_DEALS_3)
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage url of the product

Example:

JavaScript
posthog.capture('Product List Viewed', {
list_id: 'list1',
category: 'merch',
products: [
{
product_id: 'dc2046c33b104932851dbcf4',
sku: '37890-12',
name: 'Dark mode PostHog hoodie',
price: 80,
position: 1,
category: 'merch',
url: 'https://posthog.com/merch?product=black-posthog-hoodie',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC05606_1500x1000_crop_center.jpg?v=1709571158'
}
]
});

Product List Filtered

Fire this event when a visitor filters a product list or category. The following properties are supported:

PropertyTypeDescription
list_idStringProduct list being viewed
categoryStringProduct category being viewed
filtersArrayProduct filters being used
filters.$.typeStringId of the filter type being used
filters.$.valueStringId of the selection that the customer chose
sortsArray<Sort>Product sorting being used
sorts.$.typeStringId of the sort type being used
sorts.$.valueStringId of the selection type being used (ascending, descending)
productsArray<Product>Products displayed in the filtered list
products.$.product_idStringProduct id displayed on the list
products.$.skuStringSKU (Stock Keeping Unit) of of the product being viewed
products.$.categoryStringProduct category being viewed
products.$.nameStringName of the product being viewed
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product being viewed
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code associated with a product (for example, MAY_DEALS_3)
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage url of the product

Example:

JavaScript
posthog.capture('Product List Filtered', {
list_id: 'list1',
filters: [
{
type: 'department',
value: 'merch'
},
{
type: 'price',
value: 'under-$50'
}
],
sorts: [
{
type: 'price',
value: 'desc'
}
],
products: [
{
product_id: '17584e91ae1abff0d355e3f5',
sku: '92849-15',
name: 'Copy/pasta t-shirt',
price: 30,
position: 1,
category: 'merch',
url: 'https://posthog.com/merch?product=copy-pasta-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07153_813x1219_crop_center.jpg?v=1709571082'
}
]
});

Promotions

Promotion view and click events help you gather analytics on internal offers within your website or mobile app.

Promotion Viewed

Fire this event when a user views a promotion. The following properties are supported:

PropertyTypeDescription
promotion_idStringID of the promotion
creativeStringCreative details of the promotion
nameStringName of the promotion
positionStringPosition of the promotion

Example:

JavaScript
posthog.capture('Promotion Viewed', {
promotion_id: 'promo_1',
creative: 'top_banner_2',
name: '50% store-wide sale',
position: 'home_banner_top'
});

Promotion Clicked

Fire this event when a visitor clicks on a promotion. The following properties are supported:

PropertyTypeDescription
promotion_idStringID of the promotion
creativeStringCreative details of the promotion
nameStringName of the promotion
positionStringPosition of the promotion

Example:

JavaScript
posthog.capture('Promotion Clicked', {
promotion_id: 'promo_1',
creative: 'top_banner_2',
name: '75% store-wide shoe sale',
position: 'home_banner_top'
});

Ordering

These lifecycle events are associated with the key interactions that a customer has with the app or website while placing an order for a product.

Product Clicked

Fire this event when a visitor clicks a product. The following properties are supported:

PropertyTypeDescription
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberProduct list position
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Clicked', {
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
});

Product Viewed

Fire this event when a visitor views a product. The following properties are supported:

PropertyTypeDescription
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
currencyStringCurrency of the transaction
positionNumberPosition in the product list
valueNumberTotal value of the product
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Viewed', {
product_id: '1bdfef47c9724b58b6831933',
sku: '43431-18',
category: 'merch',
name: 'Tactical black t-shirt',
brand: 'PostHog',
variant: 'dark',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
currency: 'usd',
position: 3,
value: 30,
url: 'https://posthog.com/merch?product=tactical-black-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/darkmode_tee_5_1000x1000_crop_center.jpg?v=1732211354'
});

Product Added

Fire this event when a visitor adds a product to their shopping cart. The following properties are supported:

PropertyTypeDescription
cart_idStringCart ID the product was added to
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberPosition in the product list
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Added', {
cart_id: '2249490906054e33aabc2983',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
});

Product Removed

Fire this event when a visitor removes a product from their shopping cart. The following properties are supported:

PropertyTypeDescription
cart_idStringCart ID the product was removed from
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberPosition in the product list
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Removed', {
cart_id: '2249490906054e33aabc2983',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
});

Cart Viewed

Fire this event when a user views their shopping cart. The following properties are supported:

PropertyTypeDescription
cart_idStringShopping cart ID
productsArrayProducts displayed in the cart
products.$.product_idStringProduct ID displayed in the cart
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code for the product
products.$.positionNumberPosition in the product list
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Cart Viewed', {
cart_id: 'e1f17b1ed3ec47a298a05838',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 1,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Checkout Started

Fire this event when a user starts the checkout process. The following properties are supported:

PropertyTypeDescription
order_idStringOrder ID or transaction ID, whichever is applicable
affiliationStringStore or affiliation from which this transaction occurred
valueNumberRevenue ($) with discounts and coupons added in
revenueNumberRevenue ($) associated with the transaction (excluding shipping and tax)
shippingNumberShipping cost associated with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
productsArrayProducts in the order
products.$.product_idStringDatabase ID of the product
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code for the product
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Checkout Started', {
order_id: '3e94e72c0a7443e9b51155a3',
affiliation: 'Shopify',
value: 80,
revenue: 90.00,
shipping: 3,
tax: 2,
discount: 15,
coupon: 'BLACKFRIDAY',
currency: 'USD',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Checkout Step Viewed

Fire this event when a checkout step is viewed. The following properties are supported:

PropertyTypeDescription
checkout_idStringCheckout transaction ID
stepNumberStep number in the checkout process
shipping_methodStringShipping method chosen
payment_methodStringPayment method chosen

Example:

JavaScript
posthog.capture('Checkout Step Viewed', {
checkout_id: 'e461659ed1714b9ebc3299ae',
step: 2,
shipping_method: 'DHL',
payment_method: 'Visa'
});

Checkout Step Completed

Fire this event when a checkout step is completed. The following properties are supported:

PropertyTypeDescription
checkout_idStringCheckout transaction ID
stepNumberCheckout process step number
shipping_methodStringChosen shipping method
payment_methodStringChosen payment method

Example:

JavaScript
posthog.capture('Checkout Step Completed', {
checkout_id: 'e461659ed1714b9ebc3299ae',
step: 2,
shipping_method: 'DHL',
payment_method: 'Visa'
});

Payment Info Entered

Fire this event when payment information is entered successfully. The following properties are supported:

PropertyTypeDescription
checkout_idStringCheckout transaction ID
order_idStringOrder ID (optional)
stepNumberStep number in checkout
shipping_methodStringShipping method chosen
payment_methodStringPayment method chosen

Example:

JavaScript
posthog.capture('Payment Info Entered', {
checkout_id: 'e461659ed1714b9ebc3299ae',
order_id: 'f9300932fbc04887aa775997'
});

Order Updated

Fire this event when an order is updated. The following properties are supported:

PropertyTypeDescription
order_idStringOrder/transaction ID
affiliationStringStore or affiliation from which this transaction occurred
totalNumberRevenue ($) with discounts and coupons added in
revenueNumberRevenue ($) associated with the transaction (excluding shipping and tax)
shippingNumberShipping cost associated with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
productsArrayProducts in the order
products.$.product_idStringDatabase ID of the product
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code for the product
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Order Updated', {
order_id: '3e94e72c0a7443e9b51155a3',
affiliation: 'Shopify',
value: 80,
revenue: 90.00,
shipping: 3,
tax: 2,
discount: 15,
coupon: 'BLACKFRIDAY',
currency: 'USD',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Order Completed

Fire this event when an order is successfully completed. The following properties are supported:

PropertyTypeDescription
checkout_idStringCheckout ID
order_idStringOrder/transaction ID
affiliationStringStore or affiliation from which this transaction occurred
subtotalNumberOrder total after discounts but before taxes and shipping
totalNumberSubtotal ($) with shipping and taxes added in.
revenueNumberRevenue ($) associated with the transaction (including discounts, but excluding shipping and taxes)
shippingNumberShipping cost associated with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
productsArrayProducts in the order
products.$.product_idStringDatabase ID of the product
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code for the product
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Order Completed', {
checkout_id: 'e461659ed1714b9ebc3299ae',
order_id: '3e94e72c0a7443e9b51155a3',
affiliation: 'Shopify',
total: 80,
subtotal: 75,
revenue: 90.00,
shipping: 3,
tax: 2,
discount: 15,
coupon: 'BLACKFRIDAY',
currency: 'USD',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Order Refunded

Fire this event when an order is refunded. The following properties are supported:

PropertyTypeDescription
order_idStringOrder/transaction ID
totalNumberTotal amount refunded
currencyStringCurrency code
productsArrayRefunded products
products.$.product_idStringDatabase ID of the product
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice of the product
products.$.quantityNumberQuantity of the product
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Order Refunded', {
order_id: '3e94e72c0a7443e9b51155a3',
total: 30,
currency: 'USD',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Order Cancelled

Fire this event when an order is cancelled. The following properties are supported:

PropertyTypeDescription
order_idStringOrder/transaction ID
affiliationStringStore/affiliation from which this transaction occurred
totalNumberSubtotal ($) with shipping and taxes added in.
revenueNumberRevenue ($) associated with the transaction (including discounts, but excluding shipping and taxes)
shippingNumberShipping cost associated with the transaction
taxNumberTotal tax associated with the transaction
discountNumberTotal discount associated with the transaction
couponStringTransaction coupon redeemed with the transaction
currencyStringCurrency code associated with the transaction
productsArrayProducts in the order
products.$.product_idStringDatabase ID of the product
products.$.skuStringSKU (Stock Keeping Unit) of the product
products.$.categoryStringProduct category
products.$.nameStringName of the product
products.$.brandStringBrand associated with the product
products.$.variantStringVariant of the product
products.$.priceNumberPrice ($) of the product
products.$.quantityNumberQuantity of a product
products.$.couponStringCoupon code for the product
products.$.positionNumberPosition in the product list (ex. 3)
products.$.urlStringURL of the product page
products.$.image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Order Cancelled', {
order_id: '3e94e72c0a7443e9b51155a3',
affiliation: 'Shopify',
total: 80,
revenue: 90.00,
shipping: 3,
tax: 2,
discount: 15,
coupon: 'BLACKFRIDAY',
currency: 'USD',
products: [
{
product_id: 'c6e74d89b70b4972b867eb62',
sku: '18499-12',
category: 'merch',
name: 'Data warehouse t-shirt',
brand: 'PostHog',
variant: 'light',
price: 30,
quantity: 1,
position: 3,
url: 'https://posthog.com/merch?product=data-warehouse-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/DSC07095_1017x1526_crop_center.jpg?v=1709570895'
},
{
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
}
]
});

Coupons

These are events that might occur when dealing with coupons in your ecommerce.

Coupon Entered

Fire this event when a coupon is entered on a cart or order.

PropertyTypeDescription
order_idStringOrder ID or transaction ID, if applicable
cart_idStringCart ID, if applicable
coupon_idStringCoupon ID

Example:

JavaScript
posthog.capture('Coupon Entered', {
order_id: 'a239ebb8404c4ac29950756f',
cart_id: 'cb271d41bc2140ea8d076c50',
coupon_id: 'blackfriday_2025'
});

Coupon Applied

Fire this event when a coupon is successfully applied to a cart or order.

PropertyTypeDescription
order_idStringOrder ID or transaction ID, if applicable
cart_idStringCart ID, if applicable
coupon_idStringCoupon ID
coupon_nameStringCoupon name
discountNumberMonetary discount applied

Example:

JavaScript
posthog.capture('Coupon Applied', {
order_id: 'a239ebb8404c4ac29950756f',
cart_id: 'cb271d41bc2140ea8d076c50',
coupon_id: 'blackfriday_2025',
coupon_name: 'Black Friday 2025',
discount: 25
});

Coupon Denied

Fire this event when a coupon is denied.

PropertyTypeDescription
order_idStringOrder ID or transaction ID, if applicable
cart_idStringCart ID, if applicable
coupon_idStringCoupon ID
reasonStringReason for denial

Example:

JavaScript
posthog.capture('Coupon Denied', {
order_id: 'a239ebb8404c4ac29950756f',
cart_id: 'cb271d41bc2140ea8d076c50',
coupon_id: 'blackfriday_2025',
reason: 'Coupon expired'
});

Coupon Removed

Fire this event when a coupon is removed from a cart or order.

PropertyTypeDescription
order_idStringOrder ID or transaction ID, if applicable
cart_idStringCart ID, if applicable
coupon_idStringCoupon ID
coupon_nameStringCoupon name
discountNumberMonetary discount applied

Example:

JavaScript
posthog.capture('Coupon Removed', {
order_id: 'a239ebb8404c4ac29950756f',
cart_id: 'cb271d41bc2140ea8d076c50',
coupon_id: 'blackfriday_2025',
coupon_name: 'May Deals 2016',
discount: 25
});

Wishlist

Events occurring when customers interact with wish lists.

Product Added to Wishlist

Fire this event when a product is added to a wish list.

PropertyTypeDescription
wishlist_idStringWishlist ID
wishlist_nameStringName of the wishlist the product was added to
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberPosition in the product list
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Added to Wishlist', {
wishlist_id: '5cf4804e6cb645f99ab05be3',
wishlist_name: 'Loved Merch',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
});

Product Removed from Wishlist

Fire this event when a product is removed from a wish list.

PropertyTypeDescription
wishlist_idStringWishlist ID
wishlist_nameStringName of the wishlist the product was added to
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberPosition in the product list
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Removed from Wishlist', {
wishlist_id: '5cf4804e6cb645f99ab05be3',
wishlist_name: 'Loved Merch',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
});

Wishlist Product Added to Cart

Fire this event when a product from a wish list is added to a cart.

PropertyTypeDescription
wishlist_idStringWishlist ID
wishlist_nameStringName of the wishlist the product was added to
cart_idStringCart ID
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
quantityNumberQuantity of the product
couponStringCoupon code for the product
positionNumberPosition in the product list
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Wishlist Product Added to Cart', {
wishlist_id: '5cf4804e6cb645f99ab05be3',
wishlist_name: 'Loved Merch',
cart_id: '2249490906054e33aabc2983',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
quantity: 2,
coupon: 'BLACKFRIDAY',
position: 3,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'});

Sharing

Events related to sharing products or cart contents.

Product Shared

Fire this event when a product is shared.

PropertyTypeDescription
share_viaStringMethod of sharing
share_messageStringMessage sent with the product
recipientStringRecipient of the share
product_idStringDatabase ID of the product
skuStringSKU (Stock Keeping Unit) of the product
categoryStringProduct category
nameStringName of the product
brandStringBrand associated with the product
variantStringVariant of the product
priceNumberPrice ($) of the product
urlStringURL of the product page
image_urlStringImage URL of the product

Example:

JavaScript
posthog.capture('Product Shared', {
share_via: 'email',
share_message: 'Hey, check out this item',
recipient: 'max@posthog.com',
product_id: '101c66c0b37f47bc9c75561f',
sku: '94839-23',
category: 'merch',
name: 'Danger t-shirt',
brand: 'PostHog',
variant: 'blue',
price: 30,
url: 'https://posthog.com/merch?product=danger-t-shirt',
image_url: 'https://cdn.shopify.com/s/files/1/0452/0935/4401/files/cautiontee4_1000x1000_crop_center.jpg?v=1732041736'
});

Cart Shared

Fire this event when a cart is shared.

PropertyTypeDescription
share_viaStringMethod of sharing
share_messageStringMessage sent with the cart
recipientStringRecipient of the share
cart_idStringCart ID
productsArrayProducts in the cart

Example:

JavaScript
posthog.capture('Cart Shared', {
share_via: 'email',
share_message: 'Hey, check out this item',
recipient: 'max@posthog.com',
cart_id: 'e1f17b1ed3ec47a298a05838',
products: [
{ product_id: 'dc2046c33b104932851dbcf4' },
{ product_id: '17584e91ae1abff0d355e3f5' }
]
});

Reviewing

Track customer reviews of products.

Product Reviewed

Fire this event when a product is reviewed.

PropertyTypeDescription
product_idStringDatabase ID of the product
review_idStringReview ID
review_bodyStringReview content
ratingStringReview rating

Example:

JavaScript
posthog.capture('Product Reviewed', {
product_id: 'dc2046c33b104932851dbcf4',
review_id: 'e6b795d687884d0b8b59b4de',
review_body: 'They are shipping things, like, almost every day. That is so great.',
rating: '5'
});

Questions? Ask Max AI.

It's easier than reading through 558 docs articles.

Community questions

Was this page useful?

Next article

Ingestion warnings

Sometimes PostHog runs into problems during ingestion due to incorrect or suboptimal usage of PostHog. For example, if you capture an event with a generic ID like null , PostHog doesn't ingest it. If this happens, we do our best to still ingest the event and we log an ingestion warning. Note: These warnings are sampled. The actual number of events affected may exceed the total displayed. List of ingestion warnings: Refused to merge with an illegal distinct ID Refused to merge an already…

Read next article