Analytics Tracking Plan
Segment’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.
info “Note” Not all destinations support every event listed here and accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
Event life-cycles
Section titled “Event life-cycles”Here is a list of supported events for our various categories within the customer journey.
Browsing overview
Section titled “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 |
Core ordering overview
Section titled “Core ordering overview”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) |
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
Section titled “Coupons overview”Action | Description |
---|---|
Coupon Entered | User entered a coupon on a shopping cart or order |
Coupon Applied | Coupon was applied on a user’s shopping cart or 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 |
Browsing
Section titled “Browsing”Browsing lifecycle events represent key events that a customer might have while browsing your apps.
Products Searched
Section titled “Products Searched”Fire this event when a visitor searches for products.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
query | String | Object | Query the user searched with |
Example:
analytics.track('Products Searched', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', query: 'guard rail',});
Current Implementation:
Product List Viewed
Section titled “Product List Viewed”Fire this event when a visitor views a product list or category.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
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<Product> | Products displayed in the product list |
products.$.brand | String | Product Brand of the product being viewed |
products.$.productId | 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 |
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 (for example, MAY_DEALS_3) |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Product List Viewed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', category: 'Guard Rail', list_id: '54', products: [ { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft', }, { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 2, price: '150', productId: '185', quantity: 1, sku: 'RR-GR-5', variant: '5ft', }, ],});
Current Implementation:
info “Note” The
Product List Viewed
event is aliased to theViewed Product Category
event (from e-commerce v1 spec).
Product List Filtered
Section titled “Product List Filtered”Send this event when a visitor filters a product list or category.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination docs for more information on supported events and properties.
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<Sort> | 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 the customer is using (ascending, descending) |
products | Array | Products displayed in the product list |
products.$.productId | 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 |
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 (for example, MAY_DEALS_3) |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Product List Filtered', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', filters: [ { type: 'department', value: 'guardrail-kits', }, { type: 'price', value: 'under-$25', }, ], list_id: 54, products: [ { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft', }, { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 2, price: '150', productId: '185', quantity: 1, sku: 'RR-GR-5', variant: '5ft', }, ], sorts: [ { type: 'price', value: 'desc', }, ],});
Current Implementation:
Core Ordering
Section titled “Core Ordering”These events represent the customer journey in regards to product ordering.
Product Clicked
Section titled “Product Clicked”Fire this event when a visitor clicks a product.
This event supports the following semantic properties:
Property | Type | Description |
---|---|---|
productId | 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 |
price | Number | Price of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (for example, MAY_DEALS_3) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
imageUrl | String | Image url of the product |
Example:
analytics.track('Product Clicked', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', brand: 'Rhino Rails', category: 'Guard Rail', id: 'RR-GR-10', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft',});
Current Implementation:
info “Note”
- The
sku
andproductId
are different. They are also used differently, typically theproductId
is a database identifier, like185
and thesku
is a public-facing identifier likeRR-GR-4
.- The
productId
is added for reference and to have as a secondary ID, but thesku
is what is used as theid
in Google Merchant Center, Google Analytics, etc. - Favor thesku
if ever faced with a situation where you have to choose.- It should also be noted that by
sku
, we are referring to thesku
on the most detailed level. For example, a product which has variants like skuRR-GR
(productId185
) which is being added to the cart and has a variant option of 4ft, would actually have a Variant SKU ofRR-GR-4
. Favor the Variant’s SKU if ever faced with a situation where you have to choose.- The
Product Clicked
event is aliased to theClicked Product
event from e-commerce v1 spec.
Product Viewed
Section titled “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 |
---|---|---|
productId | 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 |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (for example, 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 |
imageUrl | String | Image url of the product |
Example:
analytics.track('Product Viewed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', brand: 'Rhino Rails', category: 'Guard Rail', id: 'RR-GR-10', currency: 'USD', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 3, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', value: 18.99, variant: '10ft',});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Product Viewed
event is aliased to theViewed Product
event from e-commerce v1 spec.
Product Added
Section titled “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 to which the product was added to |
productId | 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 |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (for example, MAY_DEALS_3) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
imageUrl | String | Image url of the product |
Example:
analytics.track('Product Added', { brand: 'Rhino Rails', cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', category: 'Guard Rail', id: 'RR-GR-10', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 3, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft',});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Product Added
event is aliased to theAdded Product
event from e-commerce v1 spec.
Product Removed
Section titled “Product Removed”Fire this event when a visitor 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 |
productId | 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 |
price | Number | Price ($) of the product being viewed |
quantity | Number | Quantity of a product |
coupon | String | Coupon code associated with a product (for example, MAY_DEALS_3) |
position | Number | Position in the product list (ex. 3) |
url | String | URL of the product page |
imageUrl | String | Image url of the product |
Example:
analytics.track('Product Removed', { brand: 'Rhino Rails', cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 3, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft',});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Product Removed
event is aliased to theRemoved Product
event from e-commerce v1 spec.
Cart Viewed
Section titled “Cart Viewed”Fire this event when a visitor views a shopping cart.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
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.$.productId | 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 |
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 (for example, MAY_DEALS_3) |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Cart Viewed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', products: [ { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft', }, { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 2, price: '150', productId: '185', quantity: 1, sku: 'RR-GR-5', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '5ft', }, ],});
Current Implementation:
Checkout Started
Section titled “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.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
Be sure to include all items in the cart as event properties, with the same properties from the previous calls, like so:
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 (for example, Rhino Rails) |
value | Number | Revenue ($) with discounts and coupons added in. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied |
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{:target=“_blank”} associated with the transaction |
products | Array | Products in the order |
products.$.productId | 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 |
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 (for example, MAY_DEALS_3) |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Checkout Started', { affiliation: 'Rhino Rails', cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', currency: 'USD', checkout_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', discount: 75.25, products: [ { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft', }, { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 2, price: '150', productId: '185', quantity: 1, sku: 'RR-GR-5', variant: '5ft', }, ], revenue: 677.75, // Total price of products minus discount shipping: 150, subtotal: 378, tax: 20, value: 622.75, // Revenue ($) with discounts and coupons added in. Formula: subtotal - discount + shipping + tax});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Checkout Started
event is aliased to theStarted Order
event from Segment’s GA Enhanced E-Commerce destinations.
Checkout Step Viewed
Section titled “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 a step in the checkout process |
shipping_method | String | String representing the shipping the method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('Checkout Step Viewed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', checkout_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', payment_method: 'Visa', shipping_method: 'Fedex', step: 2,});
Current Implementation:
info “Note”
shipping_method
andpayment_method
are semantic properties. If you want to send that information, 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 Segment’s standard e-commerce tracking API after you’ve tracked the checkout steps.
info “Note” The
Checkout Step Viewed
event is aliased to theViewed Checkout Step
event from Segment’s GA Enhanced E-Commerce destinations.
Checkout Step Completed
Section titled “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 a step in the checkout process |
shipping_method | String | String representing the shipping the method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('Checkout Step Completed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', checkout_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', payment_method: 'Visa', shipping_method: 'Fedex', step: 2,});
Current Implementation:
info “Note”
shipping_method
andpayment_method
are semantic properties. If you want to send that information, 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 Segment’s standard e-commerce tracking API after you’ve tracked the checkout steps.
info “Note” The
Checkout Step Completed
event is aliased to theCompleted Checkout Step
event from Segment’s GA Enhanced E-Commerce destinations.
Payment Info Entered
Section titled “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 a step in the checkout process |
shipping_method | String | String representing the shipping the method chosen |
payment_method | String | String representing the payment method chosen |
Example:
analytics.track('Payment Info Entered', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', checkout_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', order_id: '49955',});
Current Implementation:
info “Note”
shipping_method
andpayment_method
are semantic properties. If you want to send that information, 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 Segment’s standard e-commerce tracking API after you’ve tracked the checkout steps.
Order Updated
Section titled “Order Updated”Fire this event whenever an order/transaction was updated.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
Be sure to include all items in the cart as event properties, with the same properties from the previous calls, like so:
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 (for example, Rhino Rails) |
total | Number | Revenue ($) with discounts and coupons added in Note that our Google Analytics Ecommerce destination accepts total or revenue , but not both. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied |
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 |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.$.productId | 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 |
products.$.price | Number | Price ($) of the product being viewed |
products.$.quantity | Number | Quantity of a product |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Order Updated', { affiliation: 'Rhino Rails', currency: 'USD', discount: 2.5, order_id: '495001', products: [ { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '228', productId: '185', quantity: 1, sku: 'RR-GR-10', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', variant: '10ft', }, { brand: 'Rhino Rails', category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', position: 1, price: '150', productId: '185', quantity: 1, sku: 'RR-GR-5', variant: '5ft', }, ], revenue: 302.75, // Total price of products minus discount shipping: 150, subtotal: 378, tax: 20, value: 472.75, // Revenue ($) with discounts and coupons added in. Formula: subtotal - discount + shipping + tax});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Order Updated
event is aliased to theUpdated Order
event from Segment’s GA Enhanced E-Commerce destinations.
Order Completed
Section titled “Order Completed”Fire this event whenever an order/transaction was successfully completed by the customer.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
Be sure to include all items in the cart as event properties, with the same properties from the previous calls, like so:
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 (for example, Rhino Rails) |
subtotal | Number | Order total after discounts but before taxes and shipping |
total | Number | Subtotal ($) with shipping and taxes added in. Note that our Google Analytics Ecommerce destination accepts total or revenue , but not both. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied |
revenue | Number | Revenue ($) associated with the transaction (including discounts, but excluding shipping and taxes) |
shipping | Number | Shipping cost associated with the transaction |
tax | Number | Total tax associated with the transaction |
discount | Number | Total discount associated with the transaction |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.$.productId | 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 |
products.$.price | Number | Price ($) of the product being viewed |
products.$.quantity | Number | Quantity of a product |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Order Completed', { cart_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', affiliation: 'Rhino Rails', checkout_id: '56cd956f-4689-4f58-a371-0c26ef9e8850', currency: 'USD', discount: 2.5, order_id: '495001', products: [ { category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', price: '126', productId: '185', quantity: 1, sku: '45790-32', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', }, { category: 'Guard Rail', name: 'Heavy Duty Warehouse Guardrail', price: '150', productId: '185', quantity: 2, sku: 'RR-GR-5', }, ], revenue: 22.5, shipping: 3, subtotal: 22.5, tax: 2, total: 27.5,});
Current Implementation:
info “Note”
- The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.- The
Order Completed
event is aliased to theCompleted Order
event from E-Commerce spec v1 - 5/11/16.
Order Refunded
Section titled “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', { currency: 'USD', order_id: '495001', products: [ { category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', price: '126', productId: '185', quantity: 1, sku: '45790-32', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', }, { category: 'Guard Rail', name: 'Heavy Duty Warehouse Guardrail', price: '150', productId: '185', quantity: 2, sku: 'RR-GR-5', }, ], total: 30,});
Current Implementation:
info “Note” The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.
Order Cancelled
Section titled “Order Cancelled”Fire this event whenever an order/transaction was cancelled.
info “Note” Not all destinations accept arrays as properties. Refer to individual destination documentation for more information on supported events and properties.
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 (for example, Rhino Rails) |
total | Number | Revenue ($) with discounts and coupons added in. |
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 |
currency | String | Currency code associated with the transaction |
products | Array | Products in the order |
products.$.productId | 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 |
products.$.price | Number | Price ($) of the product being viewed |
products.$.quantity | Number | Quantity of a product |
products.$.position | Number | Position in the product list (ex. 3) |
products.$.url | String | URL of the product page |
products.$.imageUrl | String | Image url of the product |
Example:
analytics.track('Order Cancelled', { affiliation: 'Rhino Rails', currency: 'USD', discount: 2.5, order_id: '495001', products: [ { category: 'Guard Rail', imageUrl: 'https://img.rhinorails.com/images/stencil/160w/attribute_rule_images/632_source_1641845963.jpg', name: 'Heavy Duty Warehouse Guardrail', price: '126', productId: '185', quantity: 1, sku: '45790-32', url: 'https://rhinorails.com/single-heavy-duty-warehouse-guard-rail/', }, { category: 'Guard Rail', name: 'Heavy Duty Warehouse Guardrail', price: '150', productId: '185', quantity: 2, sku: 'RR-GR-5', }, ], revenue: 25.0, shipping: 3, tax: 2, total: 30,});
Current Implementation:
info “Note” The
sku
andproductId
don’t have to be different. If they are different, typically theproductId
is a database identifier, like9714107479
and thesku
is a public-facing identifier likeSEG-02
.