Order event
An order
event (order:confirm
) contains details about the purchase a user made on the site. It includes checkout details as well as individual products that were purchased and their details.
An order event can also contain an optional user object that is helpful for mapping the user's real ID to their uuid.
An order event is used to:
-
Calculate overall site level orders and revenue.
-
Calculate revenue-related numbers in Sitecore Discover attribution.
-
Calculate orders, units, and purchase metrics in product and category analytics.
-
Calculate revenue attribution in keyword analytics.
-
Generate top dataset by revenue and co-bought items.
The following table lists the attributes of the order
event:
Name |
Type |
Description |
Value |
---|---|---|---|
|
String |
Required. Used to identify the type of event. |
|
|
String |
Required. Used to identify the event. |
|
|
Array |
Required. Products array having one or more product objects that the user purchased. Used to compute direct attribution numbers in analytics. For easy processing, the Sitecore Discover system splits the One original Two |
n/a |
|
String |
Required. SKU of the product the user purchased. Used to calculate direct attribution numbers. |
n/a |
|
Number |
Required. Unit price of the product at which it was purchased after coupons/discounts are applied. Used to compute purchase amount ( |
n/a |
|
Number |
Required. Number of units of products purchased in this order. Used in calculating Purchase Amount ( |
n/a |
|
Number |
Optional. The original unit price of the purchased product before coupons/discounts are applied. |
n/a |
|
String |
Required if order is BOPIS order. ID of store where an order (BOPIS) is placed. Note This is preferred when various products in a single order are purchased in different stores. If all the products are purchased in the same store, it is preferable to pass this information as |
n/a |
|
String |
Required if stores are organized in a hierarchy. An additional identifier, group identifier, for a set of stores. |
n/a |
|
String |
Required if order does not use default shipping method. Used to identify the type of order. For valid values, refer to Shipping Methods. |
n/a |
|
Object |
Required. Checkout object |
n/a |
|
String |
Required. Unique identifier for an order. Used to deduplicate an event based on the order ID. |
n/a |
|
Number |
Required. Order total including tax, discount, and shipping. Used to calculate overall site revenue and Discover revenue attributions. |
n/a |
|
Number |
Optional. Subtotal before discount, tax, and shipping. Used to compare Discover revenue with other third-party web analytics systems that report subtotal. |
n/a |
|
String |
Required if order is a BOPIS order. ID of store where an order (BOPIS) is placed. Note This information is present either in checkout or in individual products. When specified in checkout, it indicates that all the products in the order are placed in this store. |
n/a |
|
String |
Required if stores are organized in a hierarchy. An additional identifier, group identifier, for a set of stores. |
n/a |
|
String |
Required if order does not use default shipping Used to identify the type of order. For valid values, refer to Shipping Methods. |
n/a |
|
Object |
Optional. User object that contains permanent user information. If user is logged in while placing an order, you can send user information as part of the order event. This information might include email, Facebook ID, and so on. It is used to create a mapping between the RFK cookie and a real user ID. |
n/a |
|
Object |
Required if site is set up with locale configuration. Add page-specific information (including locale information) under a page object. Refer to Page Object. |
n/a |
|
Object |
Optional. User information object that has a permanent user ID such as |
n/a |
|
Object |
Optional. A locale object. This attribute is deprecated. We suggest you use the page object for locale data. |
n/a |
Sample event specification
The following is an example of an order
event object. This example is in the new format, which means it contains a context
object.
{
"type": "order",
"name": "confirm",
"value": {
"context": {
"user": {
"id": "user-1234",
"email": "[email protected]",
"eid": "<hash_of_email>",
"fbid": "<facebook_id>",
"address": {
"address_line_1": "123 Main Street",
"address_line_2": "apartment 123",
"state": "CA",
"zip": "90210",
"country": "US"
}
},
"page": {
"<locale_country": "country code, 2 letters, lowercase, e.g. fr>",
"<locale_language": "language code 2 letters, lowercase, e.g. en>",
"<locale_currency": "currency code, 3 letters, lowercase, e.g. eur>"
}
},
"products": [
{
"sku": "191258",
"quantity": 1,
"price": 11.99,
"price_original": 19.99,
"fitment": {
"ids": [
"2222"
]
}
},
{
"sku": "23432",
"quantity": 1,
"price": 12.99,
"price_original": 14.99,
"fitment": {
"ids": [
"3333"
]
}
}
],
"checkout": {
"order_id": "1234",
"subtotal": 39.97,
"total": 50.96
}
}
}