E-commerce Spec
MetaRouter’s e-commerce 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.
Note: Not all integrations support every event listed here. Please refer to individual integration documentation for more information on supported events and properties.
Event Lifecycles
Here is a list of supported events within the e-commerce spec that represent a user's journey through typical e-commerce websites and apps.
Browsing Overview
Action | Description |
---|---|
products_searched | User searched for products |
product_list_viewed | User viewed a product list or category |
product_list_filtered | User filtered a product list or category |
Promotions Overview
Action | Description |
---|---|
promotion_viewed | User viewed promotion |
promotion_clicked | User clicked on promotion |
Core Ordering Overview
Action | Description |
---|---|
product_clicked | User clicked on a product |
product_viewed | User viewed 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 |
checkout_step_viewed | User viewed a checkout step |
checkout_step_completed | User completed a checkout step |
payment_info_entered | User added payment information |
order_completed | User completed the order |
order_updated | User updated the order |
order_refunded | User refunded the order |
order_cancelled | User cancelled the order |
Coupons Overview
Action | Description |
---|---|
coupon_entered | User entered a coupon in a shopping cart or on an order |
coupon_applied | Coupon was applied in a user’s shopping cart or on an order |
coupon_denied | Coupon was denied from a user’s shopping cart or order |
coupon_removed | User removed a coupon from a cart or order |
Wishlisting Overview
Action | Description |
---|---|
product_added_to_wishlist | User added a product to the wishlist |
product_removed_from_wishlist | User removed a product from the wishlist |
wishlist_product_added_to_cart | User added a wishlist product to the cart |
Sharing Overview
Action | Description |
---|---|
product_shared | User shared a product |
cart_shared | User shared their cart |
Reviewing Overview
Action | Description |
---|---|
product_reviewed | User provided a product review |
The following section lists more detail for each lifecycle event as well as an example API call.
Browsing
Browsing lifecycle events represent key events that a customer might have while browsing your e-commerce website or app.
products_searched
products_searched
Fire this event when a visitor searches for products.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
query | String | Query the user searched with |
Example:
analytics.track('products_searched', {
query: 'blue hotpants',
})
product_list_viewed
product_list_viewed
Fire this event when a visitor views a product list or category.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
list_id | String | Product list being viewed |
category | String | Product category being viewed |
products | Array | Products displayed in the product list |
products.{}.product_id | String | Product ID displayed on the list |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image url of the product |
Example:
analytics.track('product_list_viewed', {
list_id: 'hot_deals_1',
category: 'Deals',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
position: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
position: 2,
category: 'Games',
},
],
})
product_list_filtered
product_list_filtered
Fire this event when a visitor filters a product list or category.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
list_id | String | Product list being viewed |
category | String | Product category being viewed |
filters | Array | Product filters that the customer is using |
filters.{}.type | String | ID of the filter type that the customer is using |
filters.{}.value | String | ID of the selection that the customer chose |
sorts | Array | Product sorting that the customer is using |
sorts.{}.type | String | ID of the sort type that the customer is using |
sorts.{}.value | String | ID of the selection type the customer is using (ascending, descending) |
products | Array | Products displayed in the product list |
products.{}.product_id | String | Product ID displayed on the list |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image url of the product |
Example:
analytics.track('product_list_filtered', {
list_id: 'todays_deals_may_11_2016',
filters: [
{
type: 'department',
value: 'beauty',
},
{
type: 'price',
value: 'under-$25',
},
],
sorts: [
{
type: 'price',
value: 'desc',
},
],
products: [
{
product_id: '507f1f77bcf86cd798439011',
sku: '45360-32',
name: 'Dove Facial Powder',
price: 12.6,
position: 1,
category: 'Beauty',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc283733',
sku: '46573-32',
name: 'Artin Hairbrush',
price: 7.6,
position: 2,
category: 'Beauty',
},
],
})
Promotions
Promotion view/click events help you gather analytics on internal offers within your e-commerce web or mobile app. For example, when a banner advertisement is shown on your web or app’s home page, you can fire a viewed_promotion
event. If the user proceeds to click the advertisement, fire the clicked_promotion
event.
promotion_viewed
promotion_viewed
`
Fire this event when a user views a promotion.
This event supports the following semantic properties:
Property | Type | Description | Example |
---|---|---|---|
promotion_id | String | Promotion’s ID | promo_1 |
creative | String | Promotion’s creative | top_banner_2 |
name | String | Promotion’s name | 75% store-wide shoe sale |
position | String | Promotion’s position | home_banner_top |
Example:
analytics.track('promotion_viewed', {
promotion_id: 'promo_1',
creative: 'top_banner_2',
name: '75% store-wide shoe sale',
position: 'home_banner_top',
})
promotion_clicked
promotion_clicked
Fire this event when a visitor clicks a promotion.
This event supports the following semantic properties:
Property | Type | Description | Example |
---|---|---|---|
promotion_id | String | Promotion’s ID | promo_1 |
creative | String | Promotion’s creative | top_banner_2 |
name | String | Promotion’s name | 75% store-wide shoe sale |
position | String | Promotion’s position | home_banner_top |
Example:
analytics.track('promotion_clicked', {
promotion_id: 'promo_1',
creative: 'top_banner_2',
name: '75% store-wide shoe sale',
position: 'home_banner_top',
})
Core Ordering
These events represent the a user's journey as they navigate through your e-commerce website or app and ultimately purchase a product.
product_clicked
product_clicked
Fire this event when a visitor clicks a product.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_clicked', {
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
product_viewed
product_viewed
Fire this event when a visitor views a product. That view might happen on a page, screen, or preview modal.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
currency | String | Currency of the transaction |
position | Number | Position in the product list (ex. 3) |
value | Number | Total value of the product after quantity |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_viewed', {
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
currency: 'usd',
position: 3,
value: 18.99,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
product_added
product_added
Fire this event when a visitor adds a product to their shopping cart.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
cart_id | String | Cart ID that the product was added to |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_added', {
cart_id: 'skdjsidjsdkdj29j',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
product_removed
product_removed
Fire this event when a user removes a product from their shopping cart.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
cart_id | String | Cart ID to which the product was removed from |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | ImageURL of the product |
Example:
analytics.track('product_removed', {
cart_id: 'ksjdj92dj29dj92d2j',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
cart_viewed
cart_viewed
Fire this event when a visitor views a shopping cart.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
cart_id | String | Shopping cart ID |
products | Array | Products displayed in the product list |
products.{}.product_id | String | Product ID displayed on the list |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image URL of the product |
Example:
analytics.track('cart_viewed', {
cart_id: 'd92jd29jd92jd29j92d92jd',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
position: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
position: 2,
category: 'Games',
},
],
})
checkout_started
checkout_started
Fire this event whenever an order/transaction was started. Fire on the page that the customer lands on after they press the checkout button. Be sure to include all items in the cart as event properties, with the same properties from the previous calls.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID |
affiliation | String | Store or affiliation from which this transaction occurred (e.g. Google Store) |
value | Number | Revenue ($) with discounts and coupons included. |
revenue | Number | Revenue ($) associated with the transaction, excluding shipping and tax) |
shipping | Number | Shipping cost associated with the transaction |
tax | Number | Total tax associated with the transaction |
discount | Number | Total discount associated with the transaction |
coupon | String | Transaction coupon redeemed with the transaction |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.{}.product_id | String | Database ID of the product being viewed |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image URL of the product |
Example:
analytics.track('checkout_started', {
order_id: '50314b8e9bcf000000000000',
affiliation: 'Google Store',
value: 30,
revenue: 25.0,
shipping: 3,
tax: 2,
discount: 2.5,
coupon: 'hasbros',
currency: 'USD',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
quantity: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
quantity: 2,
category: 'Games',
},
],
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
checkout_step_viewed
checkout_step_viewed
Fire this event whenever a checkout step is viewed.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
checkout_id | String | Checkout transaction ID |
step | Number | Number representing the ordinal step in the checkout process |
shipping_method | String | String representing the shipping method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('checkout_step_viewed', {
checkout_id: '50314b8e9bcf000000000000',
step: 2,
shipping_method: 'Fedex',
payment_method: 'Visa',
})
Note: shipping_method
and payment_method
are semantic properties. If you want to send that information, please do so in this exact spelling.
You can have as many or as few steps in the checkout funnel as you’d like. Note that you will still need to track the order_completed
event per our standard e-commerce tracking API below after you’ve tracked the checkout steps.
checkout_step_completed
checkout_step_completed
Fire this event whenever a checkout step is completed.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
checkout_id | String | Checkout transaction ID |
step | Number | Number representing the ordinal step in the checkout process |
shipping_method | String | String representing the shipping method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('checkout_step_completed', {
checkout_id: '50314b8e9bcf000000000000',
step: 2,
shipping_method: 'Fedex',
payment_method: 'Visa',
})
Note: shipping_method
and payment_method
are semantic properties. If you want to send that information, please do so in this exact spelling.
You can have as many or as few steps in the checkout funnel as you’d like. Note that you will still need to track the order_completed
event per our standard e-commerce tracking API below after you’ve tracked the checkout steps.
payment_info_entered
payment_info_entered
Fire this event whenever payment information has been successfully entered.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
checkout_id | String | Checkout transaction ID |
order_id | String | Order ID (optional) |
step | Number | Number representing the ordinal step in the checkout process |
shipping_method | String | String representing the shipping method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('payment_info_entered', {
checkout_id: '39f39fj39f3jf93fj9fj39fj3f',
order_id: 'dkfsjidfjsdifsdfksdjfkdsfjsdfkdsf',
})
Note: shipping_method
and payment_method
are semantic properties. If you want to send that information, please do so in this exact spelling.
You can have as many or as few steps in the checkout funnel as you’d like. Note that you’ll still need to track the order_completed
event per our standard e-commerce tracking API below after you’ve tracked the checkout steps.
order_updated
Fire this event whenever an order/transaction was updated. Be sure to include all items in the cart as event properties, with the same properties from the previous calls.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID |
affiliation | String | Store or affiliation from which this transaction occurred (e.g. Google Store) |
total | Number | Revenue ($) with discounts and coupons included. |
revenue | Number | Revenue ($) associated with the transaction, excluding shipping and tax |
shipping | Number | Shipping cost associated with the transaction |
tax | Number | Total tax associated with the transaction |
discount | Number | Total discount associated with the transaction |
coupon | String | Transaction coupon redeemed with the transaction |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.{}.product_id | String | Database ID of the product being viewed |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image URL of the product |
Example:
analytics.track('order_updated', {
order_id: '50314b8e9bcf000000000000',
affiliation: 'Google Store',
total: 27.5,
revenue: 25.0,
shipping: 3,
tax: 2,
discount: 2.5,
coupon: 'hasbros',
currency: 'USD',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
quantity: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
quantity: 2,
category: 'Games',
},
],
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
order_completed
order_completed
Fire this event whenever an order/transaction was successfully completed by the customer. Be sure to include all items in the cart as event properties, with the same properties from the previous calls.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
checkout_id | String | Checkout ID |
order_id | String | Order/transaction ID |
affiliation | String | Store or affiliation from which this transaction occurred (e.g. Google Store) |
total | Number | Revenue ($) with discounts and coupons included. |
revenue | Number | Revenue ($) associated with the transaction, excluding shipping and tax |
shipping | Number | Shipping cost associated with the transaction |
tax | Number | Total tax associated with the transaction |
discount | Number | Total discount associated with the transaction |
coupon | String | Transaction coupon redeemed with the transaction |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.{}.product_id | String | Database ID of the product being viewed |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image URL of the product |
Example:
analytics.track('order_completed', {
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
order_id: '50314b8e9bcf000000000000',
affiliation: 'Google Store',
total: 27.5,
revenue: 25.0,
shipping: 3,
tax: 2,
discount: 2.5,
coupon: 'hasbros',
currency: 'USD',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
quantity: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https:///www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
quantity: 2,
category: 'Games',
},
],
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
order_refunded
order_refunded
Fire this event whenever an order/transaction was refunded. Be sure to include all items in the cart as event properties, with the same properties from the previous “Order Completed” call.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID |
Example:
analytics.track('order_refunded', {
order_id: '50314b8e9bcf000000000000',
total: 30,
currency: 'USD',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
quantity: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
quantity: 2,
category: 'Games',
},
],
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
order_cancelled
order_cancelled
Fire this event whenever an order/transaction was cancelled. Be sure to include all items in the cart as event properties, with the same properties from the previous calls.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID |
affiliation | String | Store or affiliation from which this transaction occurred (e.g. Google Store) |
total | Number | Revenue ($) with discounts and coupons included |
revenue | Number | Revenue ($) associated with the transaction, excluding shipping and tax |
shipping | Number | Shipping cost associated with the transaction |
tax | Number | Total tax associated with the transaction |
discount | Number | Total discount associated with the transaction |
coupon | String | Transaction coupon redeemed with the transaction |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.{}.product_id | String | Database ID of the product being viewed |
products.{}.sku | String | Sku of the product being viewed |
products.{}.category | String | Product category being viewed |
products.{}.name | String | Name of the product being viewed |
products.{}.brand | String | Brand associated with the product |
products.{}.variant | String | Variant of the product (e.g. Black) |
products.{}.price | Number | Price ($) of the product being viewed |
products.{}.quantity | Number | Quantity of a product |
products.{}.coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
products.{}.position | Number | Position in the product list (ex. 3) |
products.{}.url | String | URL of the product page |
products.{}.image_url | String | Image URL of the product |
Example:
analytics.track('order_cancelled', {
order_id: '50314b8e9bcf000000000000',
affiliation: 'Google Store',
total: 30,
revenue: 25.0,
shipping: 3,
tax: 2,
discount: 2.5,
coupon: 'hasbros',
currency: 'USD',
products: [
{
product_id: '507f1f77bcf86cd799439011',
sku: '45790-32',
name: 'Monopoly: 3rd Edition',
price: 19,
quantity: 1,
category: 'Games',
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
},
{
product_id: '505bd76785ebb509fc183733',
sku: '46493-32',
name: 'Uno Card Game',
price: 3,
quantity: 2,
category: 'Games',
},
],
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
Coupons
These are events that occur when dealing with coupons in your e-commerce website or app.
coupon_entered
coupon_entered
Fire this event whenever a coupon is entered either in a cart or on an order/transaction.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID, if applicable |
cart_id | String | Cart ID, if applicable |
coupon_id | String | Coupon ID |
Example:
analytics.track('coupon_entered', {
order_id: '50314b8e9bcf000000000000',
cart_id: '923923929jd29jd92dj9j93fj3'
coupon_id: 'may_deals_2016'
});
coupon_applied
coupon_applied
Fire this event whenever a coupon is successfully applied to either a cart or an order/transaction.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID, if applicable |
cart_id | String | Cart ID, if applicable |
coupon_id | String | Coupon ID |
coupon_name | String | Coupon name |
discount | Number | Monetary discount applied through the coupon |
Example:
analytics.track('coupon_applied', {
order_id: '50314b8e9bcf000000000000',
cart_id: '923923929jd29jd92dj9j93fj3'
coupon_id: 'may_deals_2016',
coupon_name: 'May Deals 2016',
discount: 23.32
});
coupon_denied
coupon_denied
Fire this event whenever a coupon is denied from a cart or an order/transaction.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID, if applicable |
cart_id | String | Cart ID, if applicable |
coupon_id | String | Coupon ID |
coupon_name | String | Coupon name |
reason | String | Reason the coupon was denied |
Example:
analytics.track('coupon_denied', {
order_id: '50314b8e9bcf000000000000',
cart_id: '923923929jd29jd92dj9j93fj3'
coupon: 'may_deals_2016',
reason: 'Coupon expired'
});
coupon_removed
coupon_removed
Fire this event whenever a coupon is removed from a cart or an order/transaction.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
order_id | String | Order/transaction ID, if applicable |
cart_id | String | Cart ID, if applicable |
coupon_id | String | Coupon ID |
coupon_name | String | Coupon name |
discount | Number | Monetary discount applied through the coupon |
Example:
analytics.track('coupon_removed', {
order_id: '50314b8e9bcf000000000000',
cart_id: '923923929jd29jd92dj9j93fj3'
coupon_id: 'may_deals_2016',
coupon_name: 'May Deals 2016',
discount: 23.32
});
Wishlists
These events may occur if your e-commerce website or app supports wishlist features.
product_added_to_wishlist
product_added_to_wishlist
Fire this event when a customer adds a product to their wish list.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
wishlist_id | String | Wishlist ID the product was added to |
wishlist_name | String | Wishlist name the product was added to |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_added_to_wishlist', {
wishlist_id: 'skdjsidjsdkdj29j',
wishlist_name: 'Loved Games',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
product_removed_from_wishlist
product_removed_from_wishlist
Fire this event when a customer removes a product from their wishlist.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
wishlist_id | String | Wishlist ID the product was added to |
wishlist_name | String | Wishlist name the product was added to |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_removed_from_wishlist', {
wishlist_id: 'skdjsidjsdkdj29j',
wishlist_name: 'Loved Games',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
wishlist_product_added_to_cart
wishlist_product_added_to_cart
Fire this event when a customer moves a product from their wishlist to their cart.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
wishlist_id | String | Wishlist ID the product was added to |
wishlist_name | String | Wishlist name the product was added to |
cart_id | String | Cart ID this product was added to |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product being viewed |
category | String | Product category being viewed |
name | String | Name of the product being viewed |
brand | String | Brand associated with the product |
variant | String | Variant of the product (e.g. Black) |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (e.g MAY_DEALS_3 ) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('wishlist_product_added_to_cart', {
wishlist_id: 'skdjsidjsdkdj29j',
wishlist_name: 'Loved Games',
cart_id: '99j2d92j9dj29dj29d2d',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
quantity: 1,
coupon: 'MAYDEALS',
position: 3,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
Sharing
These events are useful if you are tracking customers who are sharing product information, such as through social apps or other sharing capabilities.
product_shared
product_shared
Fire this event when a customer shares a product.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
share_via | String | Method of sharing |
share_message | String | Message that the user sent |
recipient | String | Recipient of the shared information |
product_id | String | Database ID of the product being viewed |
sku | String | Sku of the product shared |
category | String | Product category shared |
name | String | Name of the product shared |
brand | String | Brand associated with the shared product |
variant | String | Variant of the shared product (e.g. Black) |
price | Number | Price ($) of the product shared |
url | String | URL of the product page |
image_url | String | Image URL of the product |
Example:
analytics.track('product_shared', {
share_via: 'email',
share_message: 'Hey, check out this item',
recipient: '[email protected]',
product_id: '507f1f77bcf86cd799439011',
sku: 'G-32',
category: 'Games',
name: 'Monopoly: 3rd Edition',
brand: 'Hasbro',
variant: '200 pieces',
price: 18.99,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg',
})
Note: The sku
and product_id
do not have to be different. If they are different, typically the product_id
is a database identifier, like 9714107479
and the sku
is a public-facing identifier like ECOM-02
.
cart_shared
cart_shared
Fire this event when a customer shares a shopping cart.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
share_via | String | Method of sharing |
share_message | String | Message that the user sent |
recipient | String | Recipient of the shared product |
cart_id | String | Shopping cart ID |
products | Array | Products displayed in the shared product list |
products.{}.product_id | String | Product ID displayed on the shared product list |
Example:
analytics.track('cart_shared', {
share_via: 'email',
share_message: 'Hey, check out this item',
recipient: '[email protected]',
cart_id: 'd92jd29jd92jd29j92d92jd',
products: [{ product_id: '507f1f77bcf86cd799439011' }, { product_id: '505bd76785ebb509fc183733' }],
})
Reviewing
This event can be useful for tracking product-related reviews.
product_reviewed
product_reviewed
Fire this event when a customer reviews a product.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
product_id | String | Product’s ID |
review_id | String | Review ID |
review_body | String | Review body |
rating | String | Review rating |
Example:
analytics.track('product_reviewed', {
product_id: '507f1f77bcf86cd799439011',
review_id: 'kdfjrj39fj39jf3',
review_body: 'I love this product',
rating: '5',
})
Updated 4 months ago