Order Place
An event that describes the action of placing an order.
Here's an example of a Order Place:
- Javascript
- Swift
- Kotlin
- Java
- Objective-C
pcdp("event", "track", {
"clientId": "kevel",
"siteId": "kevel.com",
"type": "orderPlace",
"customFields": {
"debug": "true",
"role": "superuser"
},
"lineItems": [
{
"itemGroupId": "p125",
"name": "My product",
"brand": "Nike",
"category": "Men/Shirts/Short Sleeve Shirts",
"categoriesList": [
"Men",
"Shirts",
"Short Sleeve Shirts"
],
"currency": "EUR",
"promotions": [
"WINTERSALE"
],
"adult": false,
"size": "S",
"sizeSystem": "EU",
"customFields": {
"color": "blue"
},
"lineItemId": "li125zc",
"productId": "p125zc",
"total": 102.5,
"subtotal": 85,
"tax": 11.5,
"shipping": 6,
"sku": "p125zc-5",
"discount": {
"value": 5,
"currency": "EUR"
},
"refund": 0,
"quantity": 1,
"subscriptionDuration": 180,
"status": "placed"
}
],
"order": {
"id": "or123",
"currency": "EUR",
"total": 102.5,
"subtotal": 85,
"tax": 11.5,
"shipping": 6,
"discount": {
"value": 5,
"currency": "EUR"
},
"refund": 0,
"paymentMethod": "Visa",
"shippingMethod": "UPS",
"shippingCountry": "France",
"source": "web",
"promotions": [
"WINTERSALE"
]
}
})
import VelocidiSDK
let trackingEvent = [
"clientId": "kevel",
"siteId": "kevel.com",
"type": "orderPlace",
"customFields": [
"debug": "true",
"role": "superuser"
],
"lineItems": [
[
"itemGroupId": "p125",
"name": "My product",
"brand": "Nike",
"category": "Men/Shirts/Short Sleeve Shirts",
"categoriesList": [
"Men",
"Shirts",
"Short Sleeve Shirts"
],
"currency": "EUR",
"promotions": [
"WINTERSALE"
],
"adult": false,
"size": "S",
"sizeSystem": "EU",
"customFields": [
"color": "blue"
],
"lineItemId": "li125zc",
"productId": "p125zc",
"total": 102.5,
"subtotal": 85,
"tax": 11.5,
"shipping": 6,
"sku": "p125zc-5",
"discount": [
"value": 5,
"currency": "EUR"
],
"refund": 0,
"quantity": 1,
"subscriptionDuration": 180,
"status": "placed"
]
],
"order": [
"id": "or123",
"currency": "EUR",
"total": 102.5,
"subtotal": 85,
"tax": 11.5,
"shipping": 6,
"discount": [
"value": 5,
"currency": "EUR"
],
"refund": 0,
"paymentMethod": "Visa",
"shippingMethod": "UPS",
"shippingCountry": "France",
"source": "web",
"promotions": [
"WINTERSALE"
]
]
] as [String: Any]
VSDKVelocidi.sharedInstance().track(trackingEvent, userId: userId)
@import VelocidiSDK;
NSDictionary *trackingEvent = @{
@"clientId" : @"kevel",
@"siteId" : @"kevel.com",
@"type" : @"orderPlace",
@"customFields" : @{
@"debug" : @"true",
@"role" : @"superuser"
},
@"lineItems" : @[
@{
@"itemGroupId" : @"p125",
@"name" : @"My product",
@"brand" : @"Nike",
@"category" : @"Men/Shirts/Short Sleeve Shirts",
@"categoriesList" : @[
@"Men",
@"Shirts",
@"Short Sleeve Shirts"
],
@"currency" : @"EUR",
@"promotions" : @[
@"WINTERSALE"
],
@"adult" : @NO,
@"size" : @"S",
@"sizeSystem" : @"EU",
@"customFields" : @{
@"color" : @"blue"
},
@"lineItemId" : @"li125zc",
@"productId" : @"p125zc",
@"total" : @102.5,
@"subtotal" : @85,
@"tax" : @11.5,
@"shipping" : @6,
@"sku" : @"p125zc-5",
@"discount" : @{
@"value" : @5,
@"currency" : @"EUR"
},
@"refund" : @0,
@"quantity" : @1,
@"subscriptionDuration" : @180,
@"status" : @"placed"
}
],
@"order" : @{
@"id" : @"or123",
@"currency" : @"EUR",
@"total" : @102.5,
@"subtotal" : @85,
@"tax" : @11.5,
@"shipping" : @6,
@"discount" : @{
@"value" : @5,
@"currency" : @"EUR"
},
@"refund" : @0,
@"paymentMethod" : @"Visa",
@"shippingMethod" : @"UPS",
@"shippingCountry" : @"France",
@"source" : @"web",
@"promotions" : @[
@"WINTERSALE"
]
}
};
[VSDKVelocidi.sharedInstance track: trackingEvent userId: userId]
import org.json.*
import com.velocidi.Velocidi
val trackingEvent = mapOf(
"clientId" to "kevel",
"siteId" to "kevel.com",
"type" to "orderPlace",
"customFields" to mapOf(
"debug" to "true",
"role" to "superuser"
),
"lineItems" to arrayOf(
mapOf(
"itemGroupId" to "p125",
"name" to "My product",
"brand" to "Nike",
"category" to "Men/Shirts/Short Sleeve Shirts",
"categoriesList" to arrayOf(
"Men",
"Shirts",
"Short Sleeve Shirts"
),
"currency" to "EUR",
"promotions" to arrayOf(
"WINTERSALE"
),
"adult" to false,
"size" to "S",
"sizeSystem" to "EU",
"customFields" to mapOf(
"color" to "blue"
),
"lineItemId" to "li125zc",
"productId" to "p125zc",
"total" to 102.5,
"subtotal" to 85,
"tax" to 11.5,
"shipping" to 6,
"sku" to "p125zc-5",
"discount" to mapOf(
"value" to 5,
"currency" to "EUR"
),
"refund" to 0,
"quantity" to 1,
"subscriptionDuration" to 180,
"status" to "placed"
)
),
"order" to mapOf(
"id" to "or123",
"currency" to "EUR",
"total" to 102.5,
"subtotal" to 85,
"tax" to 11.5,
"shipping" to 6,
"discount" to mapOf(
"value" to 5,
"currency" to "EUR"
),
"refund" to 0,
"paymentMethod" to "Visa",
"shippingMethod" to "UPS",
"shippingCountry" to "France",
"source" to "web",
"promotions" to arrayOf(
"WINTERSALE"
)
)
)
Velocidi.getInstance().track(userId, JSONObject(trackingEvent))
import org.json.*;
import com.velocidi.Velocidi;
JSONObject trackingEvent = new JSONObject()
.put("clientId", "kevel")
.put("siteId", "kevel.com")
.put("type", "orderPlace")
.put("customFields", new JSONObject()
.put("debug", "true")
.put("role", "superuser")
)
.put("lineItems", new JSONArray()
.put(new JSONObject()
.put("itemGroupId", "p125")
.put("name", "My product")
.put("brand", "Nike")
.put("category", "Men/Shirts/Short Sleeve Shirts")
.put("categoriesList", new JSONArray()
.put("Men")
.put("Shirts")
.put("Short Sleeve Shirts")
)
.put("currency", "EUR")
.put("promotions", new JSONArray()
.put("WINTERSALE")
)
.put("adult", false)
.put("size", "S")
.put("sizeSystem", "EU")
.put("customFields", new JSONObject()
.put("color", "blue")
)
.put("lineItemId", "li125zc")
.put("productId", "p125zc")
.put("total", 102.5)
.put("subtotal", 85)
.put("tax", 11.5)
.put("shipping", 6)
.put("sku", "p125zc-5")
.put("discount", new JSONObject()
.put("value", 5)
.put("currency", "EUR")
)
.put("refund", 0)
.put("quantity", 1)
.put("subscriptionDuration", 180)
.put("status", "placed")
)
)
.put("order", new JSONObject()
.put("id", "or123")
.put("currency", "EUR")
.put("total", 102.5)
.put("subtotal", 85)
.put("tax", 11.5)
.put("shipping", 6)
.put("discount", new JSONObject()
.put("value", 5)
.put("currency", "EUR")
)
.put("refund", 0)
.put("paymentMethod", "Visa")
.put("shippingMethod", "UPS")
.put("shippingCountry", "France")
.put("source", "web")
.put("promotions", new JSONArray()
.put("WINTERSALE")
)
);
Velocidi.getInstance().track(userId, trackingEvent);
In more detail, the fields supported on every Order Place are:
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
clientId | string | "kevel" | The client identifier. | ||
siteId | string | "kevel.com" | The client's site identifier. | ||
type | required | "orderPlace" | "orderPlace" | The event type. | |
customFields | object of string | {...} | An object with custom fields for extra metadata to be supplied in the event. The values within this object must all be strings. | ||
facebookConversionTracking | Facebook Conversion Tracking Details | {...} | A description of a tracking event to send to Facebook using Facebook Conversions API. | ||
lineItems | required | array of LineItem | [...] | An array of the line items that belong to the order. | |
order | required | Order | {...} | Order details. |
Facebook Conversion Tracking Details
A description of a tracking event to send to Facebook using Facebook Conversions API.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
pixel_id | string | "396622227884531" | The pixel ID to associate this Facebook tracking event with. | ||
event_id | string | "0c53d0b57" | ID used to deduplicate events sent by both Facebook Pixel and Conversions API. More information about the usefulness of this ID is available at https://developers.facebook.com/docs/marketing-api/server-side-api/using-the-api/deduplicate-pixel-and-server-side-events. | ||
event_name | string | "AddToCart" | A Facebook pixel Standard Event or Custom Event name. This field is used to deduplicate events sent by both Facebook Pixel and Conversions API. The available Standard Events are listed in https://developers.facebook.com/docs/facebook-pixel/reference#standard-events. | ||
custom_data | object | {...} | Parameters to send additional data Facebook can use for ads delivery optimization. More information about the fields that can be supplied here is available at https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data. |
LineItem
Line item details.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
itemGroupId | string | "p125" | Identifier for a group of products that come in different versions (variants). | ||
name | string | "" | "My product" | Product name. | |
brand | string | "Nike" | Product brand. | ||
category | string | "Men/Shirts/Short Sleeve Shirts" | Product category. If possible, 'categoriesList' should be filled instead of this field. | ||
categoriesList | array of string | ["Men", "Shirts", "Short Sleeve Shirts"] | A hierarchically sorted list of the sub-categories that this product belongs to. The first item on this list should be the most general sub-category, while the last should be the most specific. Any item on this list should correspond to a sub-category of the item immediately preceding it. If 'category' is present and this field is left undefined, the default value of this field will be a best effort derivation of 'category'. | ||
currency | required | string | "EUR" | The currency used in monetary values. Supported values: "PLN" , "CAD" , "HKD" , "AUD" , "SEK" , "TRY" , "BRL" , "KRW" , "CZK" , "BGN" , "ETH" , "CLP" , "GBP" , "MXN" , "THB" , "ISK" , "SGD" , "CHF" , "INR" , "LTC" , "CNY" , "PHP" , "RON" , "BTC" , "DKK" , "XAU" , "XAG" , "JPY" , "ARS" , "HUF" , "MYR" , "USD" , "RUB" , "NZD" , "IDR" , "ILS" , "NOK" , "NAD" , "EUR" , "ZAR" and "HRK" . | |
promotions | array of string | [] | ["WINTERSALE"] | Vouchers applied in the purchase or displayed together with the product. | |
adult | boolean | false | false | Whether the product includes adult content (alcohol, guns, gambling, sexually suggestive content...) and might not show up to some users. | |
size | string | "S" | Product size. | ||
sizeSystem | string | "EU" | Country of the size system used by your product. | ||
customFields | object of string | {"color": "blue"} | Additional fields related to the product. The values within this object must all be strings. | ||
lineItemId | string | "li125zc" | A unique identifier for the line item within the order. | ||
productId | required | string | "p125zc" | Product identifier. | |
total | required | number | 102.5 | Total value of the line item with all discounts, status and refund value already considered, including subtotal, tax and shipping. total = subtotal + tax + shipping. | |
subtotal | number | 0 | 85 | The value of the line item, when tax and shipping are excluded. subtotal = total - tax - shipping. | |
tax | number | 0 | 11.5 | The total applied tax value for the line item. | |
shipping | number | 0 | 6 | The total shipping costs for the line item. | |
sku | string | "" | "p125zc-5" | Product SKU. | |
discount | Discount | {...} | Discount applied to the product. | ||
refund | number | 0 | 0 | The total refunded value for the line item. | |
quantity | number | 1 | 1 | Quantity of purchased item. | |
subscriptionDuration | string | 180 | If the purchase relates to a subscription, captures the subscription duration, in days. | ||
status | string | "placed" | "placed" | The status of the line item. Supported values: "placed" , "paid" , "fulfilled" , "canceled" and "refunded" . |
Order
Order details.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
id | required | string | "or123" | Order identifier. | |
currency | required | string | "EUR" | The currency used in monetary values. Supported values: "PLN" , "CAD" , "HKD" , "AUD" , "SEK" , "TRY" , "BRL" , "KRW" , "CZK" , "BGN" , "ETH" , "CLP" , "GBP" , "MXN" , "THB" , "ISK" , "SGD" , "CHF" , "INR" , "LTC" , "CNY" , "PHP" , "RON" , "BTC" , "DKK" , "XAU" , "XAG" , "JPY" , "ARS" , "HUF" , "MYR" , "USD" , "RUB" , "NZD" , "IDR" , "ILS" , "NOK" , "NAD" , "EUR" , "ZAR" and "HRK" . | |
total | required | number | 102.5 | Total value of the order with all discounts, canceled and refunded line items already considered, including subtotal and tax. | |
subtotal | number | 0 | 85 | Subtotal order price. | |
tax | number | 0 | 11.5 | Tax value. | |
shipping | number | 0 | 6 | Shipping cost. | |
discount | Discount | {...} | Discount applied to the order. | ||
refund | number | 0 | Processed refund value. | ||
paymentMethod | string | "Visa" | The payment method. | ||
shippingMethod | string | "UPS" | The shipping method. | ||
shippingCountry | string | "France" | The destination country. | ||
source | string | "web" | Source from where the order was placed. Examples are web , phone call , POS . | ||
promotions | array of string | [] | [...] | Vouchers applied in the purchase. |
Discount
Discount applied to the product. One of Percentage Discount, Price Discount or Value Discount.
Percentage Discount
A discount description where the percentage discounted is provided.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
percentage | required | number | 0.25 | The percentage of the discount. |
Price Discount
A discount description where the price after the discount is provided.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
price | required | number | 42 | The price after the discount. | |
currency | required | string | "EUR" | The currency used in monetary values. Supported values: "PLN" , "CAD" , "HKD" , "AUD" , "SEK" , "TRY" , "BRL" , "KRW" , "CZK" , "BGN" , "ETH" , "CLP" , "GBP" , "MXN" , "THB" , "ISK" , "SGD" , "CHF" , "INR" , "LTC" , "CNY" , "PHP" , "RON" , "BTC" , "DKK" , "XAU" , "XAG" , "JPY" , "ARS" , "HUF" , "MYR" , "USD" , "RUB" , "NZD" , "IDR" , "ILS" , "NOK" , "NAD" , "EUR" , "ZAR" and "HRK" . |
Value Discount
A discount description where the value of the discount is provided.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
value | required | number | 10 | The total value of the discount. | |
currency | required | string | "EUR" | The currency used in monetary values. Supported values: "PLN" , "CAD" , "HKD" , "AUD" , "SEK" , "TRY" , "BRL" , "KRW" , "CZK" , "BGN" , "ETH" , "CLP" , "GBP" , "MXN" , "THB" , "ISK" , "SGD" , "CHF" , "INR" , "LTC" , "CNY" , "PHP" , "RON" , "BTC" , "DKK" , "XAU" , "XAG" , "JPY" , "ARS" , "HUF" , "MYR" , "USD" , "RUB" , "NZD" , "IDR" , "ILS" , "NOK" , "NAD" , "EUR" , "ZAR" and "HRK" . |