Ecommerce Real-time Events

To use all Opti-X placement methods, the following events are considered mandatory:

Online Order, Product View, Add to cart, Remove from Cart , Empty Cart.


Online Order (Mandatory)

Online orders refer to confirming orders after adding items to the cart. Other Orders can be offline purchases or orders that do not fit the standard approach of online orders. One event of online order refers to one item ordered with a variable quantity.

Event KeyEvent NameType
online_orderOnline OrderSimple Event

Event’s Parameters:

Optional fields are marked with *

Parameter KeyTypeExampleDescription
session_idString248rhdbuw2her1Users browser session.
useridStringExampleUser1234Unique key identifying the user.
eventdatetimeTimestamp2024-03-09 06:00:12.000Date Time of the order.
product_idStringRippedJeans1934256Product Key
variant_id*StringRippedJeans1934256-BlueKey identifying the variant of the product
sku_id*StringRippedJeans1934256-Blue-W28H30Key identifying the sku of the variant.
brandStringExample BrandBrand of the item.
categoryStringC-22149Key Identifying the lowest level of category.
departmentStringD-902esKey Identifying the department or highest level of category.
url*Stringhttps://www.example.com/jeans/1934256Link to the product
page_title*StringCasual Ripped Blue JeansTitle of the product’s page
page_category*StringClothing – JeansCategory of the product’s page.
currency*StringUSDCurrency of the order
Item_name*StringCasual Ripped Blue JeansItem Name
quantity*Number2Quantity
total_pay*Number40Total Pay of the item order with consideration to quantity (e.g. the original price total is 44.44 for 2 jeans, 10% discount was applied overall).
discount_percentage*Number10Discount applied as a percentage
Item_order_id*StringOI-1298840Item Order ID
order_idStringO-3sd82rhfOrder ID

Product View (Mandatory)

Product views refer to product browsed on the ecommerce site. Fields related to variant and skus may be optional to accommodate for clients having separate pages for product variants and skus. If the site has a page to the product, and the user views a variant and sku under the same link, these must be provided as separate product view events with variant/sku fields populated.

Event KeyEvent NameType
product_viewProduct ViewSimple Event

Event’s Parameters:

Optional fields are marked with *


Event KeyTypeExampleDescription
session_idString248rhdbuw2her1Users browser session.
useridStringExampleUser1234Unique key identifying the user.
eventdatetimeTimestamp2024-03-09 07:00:14.000Date Time of the order.
product_idStringSkMensSlipIn238745Product Key
variant_id*StringSkMensSlipIn238745-912Key identifying the variant of the product
sku_id*StringSkMensSlipIn238745-912-S6Key identifying the sku of the variant.
brandStringExampleBrandBrand of the item.
categoryStringC-9iu032Key Identifying the lowest level of category.
departmentStringD-290ijosKey Identifying the department or highest level of category.
url*Stringhttps://www.example.com/products/SkMensSlipIn238745Link to the product
page_title*StringMen's Slip In - Brand NewTitle of the product’s page
page_category*StringProducts - ShoesCategory of the product’s page.
currency*StringGBPCurrency of the order
Item_name*StringMen's Slip InItem Name
price*Number35.99Price at the time of product view

Add To Cart (Mandatory) & Remove From Cart (Mandatory)

Events related to adding and removing items from the cart. Add to cart, remove from cart and empty cart events are necessary for cart and product abandonment use cases.

Event KeyEvent NameType
add_to_cartAdd To CartSimple Event
remove_from_cartRemove From CartSimple Event

Event’s Parameters:

Optional fields are marked with *


Parameter KeyTypeExampleDescription
session_idString248rhdbuw2her1Users browser session.
useridStringExampleUser1234Unique key identifying the user.
eventdatetimeTimestamp2024-03-09 07:00:14.000Date Time of the event.
product_idString10Pencils1843Product Viewed
variant_id*String10Pencils1843Coloured1234Variant of the product viewed
sku_id*String10Pencils1843Coloured1234-23iuhwSku of the variant.
brandStringExample BrandBrand of the product.
categoryStringC-P3nc1lKey Identifying the lowest level of category.
departmentStringD-St4t10n4ryKey Identifying the department or highest level of category.
url*Stringhttps://www.example.com/product/10Pencils1843Url of product or product-variant or sku.
page_title*StringColoured PencilsTitle of the page
page_category*StringPencilsCategory of the page
currencyStringGBPCurrency
Item_name*StringColoured Pencils 10 pack.Product/Variant/SkuName. Provide the lowest level.
quantity*NumberQuantityQuantity
total_price*Number£30Total Price (quantity * price of the item, discount included)

Empty Cart (Mandatory)

Event where all items are removed from a cart. Add to cart, remove from cart and empty cart events are necessary for cart and product abandonment use cases. It is not necessary to also send ‘Remove from Cart’ events for each item for an empty cart event.

Event KeyEvent NameType
empty_cartempty_cartSimple Event

Event’s Parameters:

Optional fields are marked with *


Parameter KeyTypeExampleDescription
session_idString248rhdbuw2her1Users browser session.
useridStringExampleUser1234Unique key identifying the user.
eventdatetimeTimestamp2024-03-09 07:00:14.000Date Time of the order.