ADD event
The event data object for an ADD event must include all the required attributes for event data objects plus the following attribute:
Attribute |
Type |
Description |
Example |
---|---|---|---|
|
object |
Data about the product that the user adds to the cart. |
N/A |
The product
object:
Attribute |
Type |
Description |
Example |
Required/optional |
---|---|---|---|---|
|
string (title case recommended) |
The name of the product that the user added to the cart. |
|
Required |
|
string (uppercase) |
The type of product that the user added to the cart. |
|
Required |
|
string |
The item ID of the product that the user added to the cart. Used in Extract, Transform, Load (ETL) data integration to create the order. You must pass this string into an object in the |
|
Required |
|
string |
The ID of the product that the user added to the cart. Used in Analytics for reporting. |
|
Required |
|
string |
An ID generated by your organization to reference the order item. |
|
Required |
|
string (ISO 8601) Format: |
The date and time the user added the product to the cart. |
|
Required |
|
integer |
The number of units of the product that the user added to the cart. Total price = |
|
Required |
|
float |
The unit price of the product. Total price = |
|
Required |
|
string (uppercase ISO 4217) |
The alphabetic currency code of the currency that the product price is specified in. |
|
Required |
|
float |
The unit price of the order item before conversion to the organization's currency. |
|
Optional |
|
string (uppercase ISO 4217) |
The original currency code for the order item. |
|
Optional |
After you create this event data object, you can optionally extend this event using the extension data object. Then, you can send the event using the Engage.event()
function.
Here's an example of the event data object for an ADD event.
const eventData = {
channel: "WEB",
currency: "EUR",
pointOfSale: "myretailsite/ireland",
language: "EN",
page: "products",
product: {
name: "GHT 84 Lace Sneaker",
type: "FOOTWEAR",
item_id: "SHOES_8475GHT",
productId: "example_product_id",
referenceId: "FOOTWEAR-001-01",
orderedAt: "2024-04-15T12:42:16.001Z",
quantity: 1,
price: 7.99,
currency: "EUR",
originalPrice: 7.79,
originalCurrencyCode: "USD"
}
}
Here's an example of how multiple product item IDs are linked in ADD and in CONFIRM event data objects.
For each item ID included in an object in the product
array of the CONFIRM event data object, there must be a preceding ADD event data object where the product item ID is specified in product.item_id
.
// ADD event data object for "SHOES_8475GHT"
const addEventData = {
// ...
product: {
// ...
item_id: "SHOES_8475GHT"
}
}
// ADD event data object for "JEANS_W33L31"
const addEventData = {
// ...
product: {
// ...
item_id: "JEANS_W33L31"
}
}
// CONFIRM event data object listing all product item IDs
const confirmEventData = {
// ...
product: [
{ item_id: "SHOES_8475GHT" },
{ item_id: "JEANS_W33L31" }
]
}