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.

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
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_idString321r89yq27e8Users 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
discount_percentage*Number10Discount applied as a percentage
Item_order_id*StringOI-1298840Item Order ID
order_idStringO-3sd82rhfOrder ID

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 Even

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.