Tracking Order data

The Order Data is used to Track the Product purchases made by Customers. This ties up to the Purchase History dataset from the Distil.ai Datasets definition. Data from these events can be tied back to the Session and thus all the Events that led up to the Order, including referring site, and Campaigns and the full browse path of the Customer. Additionally, knowing which Products have been purchased helps to inform any hyper-personalised communications driven by this data. 

When to send

  • When a Customer places an Order.

Order Data specification 

Order

This object represents the order that the user has placed

Json AttributeTypeRequiredDescription
OrderIdStringYesYour Order ID. This should match that of the Order in your backend Database
OrderLineItemsJSON See Order Line Items object definition below for the object properties.
TotalOrderValueExTaxDecimal This is the Total Order Value excluding any Tax. The value should be in the same Currency as specified in the Currency Attribute.
TotalOrderValueIncTaxDecimal This is the Total order Value including Tax. 
PaymentMethodString Free text string for you to specify the Payment method.
CurrencyString ISO Currency Code. 
BillingAddressJSON Address Object – see definition below for object properties
DeliveryAddressJSON Address Object – see definition below for object properties
Json AttributeTypeRequiredDescription
OrderIdStringYesYour Order ID. This should match that of the Order in your backend Database
OrderLineItemsJSON See Order Line Items object definition below for the object properties.
TotalOrderValueExTaxDecimal This is the Total Order Value excluding any Tax. The value should be in the same Currency as specified in the Currency Attribute.
TotalOrderValueIncTaxDecimal This is the Total order Value including Tax. 
PaymentMethodString Free text string for you to specify the Payment method.
CurrencyString ISO Currency Code. 
BillingAddressJSON Address Object – see definition below for object properties
DeliveryAddressJSON Address Object – see definition below for object properties

Order Line Items

This object represents a line item object within the Order

Json AttributeTypeRequiredDescription
ProductIdStringYesThis should match a Product Id from the Product Data.
NameString
The Name of the product
UrlString
URL to the Product page
QtyIntegerYesThis is the Qty of the Product in this Line Item.
PriceExTaxDecimal
The price of the item excluding tax.
PriceInTaxDecimal The price of the item including tax.
ThumbnailUrlString
URL to the Product Thumbnail.
FullImageUrlString URL to the Product image in full.
CategoriesArray of Strings
A string array of all Categories the product is in.

Address

This object represents any address – either billing or shipping in this case

Json AttributeTypeRequiredDescription
TitleString
Title of the Customer
FirstNameString
First Name of the Customer
LastNameString
Last Name of the Customer
Line1String
Line 1 of the Address
CompanyString
The name of the Company
Line2String
Line 1 of the Address
Line3String
Line 1 of the Address
TownString
Town/City for the address
RegionString
Region of the address
CountryString
Country for the Address
PostcodeString
Postcode of the Address
PhoneString
The Customer’s phone number

Customer Data Specification

This allows you to associate the call with the customer who made the purchase.

Json AttributeTypeRequiredDescription
CustomerIdStringYesYour unique Customer id
EmailAddressStringYesThe Email Address for the customer
FirstNameString
The Customer’s first name
LastNameString
The Customer’s last name

Example JSON

{
"Context": {
"DistilAccountId": "abc-123",
"AnonymousUserID": "f7692ca5-cfd1-4604-81c8-bb8cda4908e0",
"Device Information": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5)",
"EventTimestampUTC": "2017-03-14 23:02:17",
"EventTimestampLocal": "2017-03-14 23:02:17",
"PageTitle": "A Fistful of Dollars",
"PageUrl": "https://www.imdb.com/title/tt0058461/",
"ReferrerUrl": "https://www.google.com/search?biw=1680&bih=970&ei=FC6BXO"
}, "Order": {
"OrderId": "12900087",
"OrderLineItems": [
{
"ProductId": "ABC-1234",
"Name": "Felt tiles",
"Qty": 3,
"PriceExTax": 50.00,
"PriceIncTax": 60.00,
"ThumbnailUrl": "https://www.dummystore.co.uk/thumbnails/1.jpg",
"FullImageUrl": "https://www.dummystore.co.uk/images/1.jpg",
"Url": "https://www.dummystore.co.uk/products/1",
"Categories" : ["Texttiles", "Ceramics"]
},
{
"ProductId": "ABC-789",
"Name": "Fruit Smoothie",
"Qty": 1,
"PriceExTax": 50.00,
"PriceIncTax": 60.00,
"ThumbnailUrl": "https://www.dummystore.co.uk/thumbnails/3.jpg",
"FullImageUrl": "https://www.dummystore.co.uk/images/3.jpg",
"Url": "https://www.dummystore.co.uk/products/3",
"Categories" : ["Food", "Beverages"]
}
],
"TotalOrderValueExTax": 200.00,
"TotalOrderValueIncTax": 240.00,
"Currency": "GBP",
"PaymentMethod": "STRIPE",
"BillingAddress": {
"Title": "Mr",
"FirstName": "Sam",
"LastName": "Mendes",
"Company": "BiG",
"Line2": "Third Floor",
"Line2": "The Generator",
"Line3": ", 11-15 Dixs Field",
"Town": "Exeter",
"Region": "Devon",
"Country": "United Kingdom",
"Postcode": "EX1 1QA",
"Phone": "12345 678910"
},
"DeliveryAddress": {
"Title": "Mr",
"FirstName": "Sam",
"LastName": "Mendes",
"Company": "BiG",
"Line2": "Third Floor",
"Line2": "The Generator",
"Line3": ", 11-15 Dixs Field",
"Town": "Exeter",
"Region": "Devon",
"Country": "United Kingdom",
"Postcode": "EX1 1QA",
"Phone": "12345 678910"
}
}, "Customer": {
"CustomerId": 12345,
"EmailAddress": "sam@distil.co.uk",
"FirstName": "Sam",
"LastName": "Mendes"
}
}