Skip to main content

Plugin events

Future Ordering UI emits events when user performs certain actions. These events can be listened to by plugins.

Listening for events

export default async context => {
context.statisticsEventHandler.addEventListener((event: StatisticsEvent) => {
// handle event
});
};

Each event has a name property that identifies the event type. You can use this to filter for specific events:

export default async context => {
context.statisticsEventHandler.addEventListener((event: StatisticsEvent) => {
if (event.name === 'userEvent' && event.eventLabel === 'Created Account') {
// user has created an account
}
});
};

General events

Country changed

Emitted when the user changes their selected country.

Event name: countryChanged

PropertyTypeDescription
eventLabelstringThe country that was selected

User authenticated

Emitted when a user's authentication state changes.

Event name: userAuthenticated

PropertyTypeDescription
customDimensionIndexnumberIndex of the custom dimension
customDimensionValuestring (optional)The user identifier
userLoggedInbooleantrue if the user is logged in, false if guest
emailstring (optional)The user's email address
phoneNumberstring (optional)The user's phone number in local country format without country code
countryCodestringThe user's country code

User event

Event name: userEvent

Emitted when a user creates an account, logs in, or logs out.

PropertyTypeDescription
eventLabelstringThe action performed. One of Created Account, Logged In, or Logged Out
userIdstringThe user's identifier
countryCodestringThe user's country code
cultureCodestringThe user's culture code

Localization changed

Emitted when the user changes their language or locale.

Event name: localizationChanged

PropertyTypeDescription
eventLabelstringThe localization that was selected

Page changed

Emitted when the user navigates to a different page.

Event name: pageChanged

PropertyTypeDescription
pagestringThe current page pathname and query string
pageTypestringThe type of page, for example product-list, category-list, dashboard, or countries
previousPagestringThe previous page pathname and query string
orderTypestringThe current order type, for example eatin, takeaway, kioskeatin, or kiosktakeaway
countryCodestringThe country code

Start session

Emitted when a new user session begins.

Event name: startSession

This event has no additional properties.

End session

Emitted when the current user session ends.

Event name: endSession

This event has no additional properties.

Order events

Order cancel

Emitted when the user cancels their current order.

Event name: orderCancel

This event has no additional properties.

Order type selected

Emitted when the user selects an order type.

Event name: orderTypeSelected

PropertyTypeDescription
orderTypestringThe order type that was selected, for example eatin, takeaway, kioskeatin, or kiosktakeaway

Order created

Emitted when an order has been successfully created.

Event name: orderCreated

Contains an orderInfo object with the following properties:

PropertyTypeDescription
orderInfo.storeIdnumberThe store identifier
orderInfo.storeNamestringThe store name
orderInfo.orderIdstringThe order identifier
orderInfo.salesChannelTypestringThe sales channel. One of browser, kiosk, mobileApp, or external
orderInfo.deviceIdstringThe device identifier
orderInfo.menuTypestringThe menu type, for example eatin, takeaway, kioskeatin, or kiosktakeaway
orderInfo.countrystringThe country

Order cleared

Emitted when the current order is cleared.

Event name: orderCleared

PropertyTypeDescription
orderIdstringThe order identifier

Payment events

Payment save method

Emitted when the user has been prompted to save a payment method and make a choice.

Event name: paymentSaveMethod

PropertyTypeDescription
eventLabelstringWhether the user chose to save the method. Yes or No
paymentMethod.providerstringThe payment provider
paymentMethod.paymentMethodTypestringThe payment method type
paymentMethod.expiryDatestringThe expiry date of the payment method

Payment method added

Emitted when the user adds a new payment method.

Event name: paymentMethodAdded

PropertyTypeDescription
eventLabelstringLabel describing the payment method
expiryDatestringThe expiry date of the payment method

Payment method removed

Emitted when the user removes a saved payment method.

Event name: paymentMethodRemoved

PropertyTypeDescription
eventLabelstringThe payment provider, for example adyen

Favorite events

Favorite product added

Emitted when the user adds a product to a favorite order.

Event name: favoriteProductAdded

PropertyTypeDescription
favoriteOrderIdstringThe favorite order identifier
productobjectThe product that was added. See Product data

Favorite order added

Emitted when the user saves an order as a favorite.

Event name: favoriteOrderAdded

PropertyTypeDescription
favoriteOrderIdstringThe favorite order identifier
productsobject[]The products in the order. See Product data

Favorite order removed

Emitted when the user removes a saved favorite order.

Event name: favoriteOrderRemoved

PropertyTypeDescription
favoriteOrderIdstringThe favorite order identifier
productsobject[]The products in the order. See Product data

Category & navigation events

Category clicked

Emitted when the user clicks on a menu category.

Event name: categoryClick

PropertyTypeDescription
eventLabelstringThe category name
eventValuestringThe category identifier

Sub-category expanded

Emitted when the user expands a sub-category in the menu.

Event name: menuSubCategoryExpanded

PropertyTypeDescription
eventLabelstringThe sub-category name
eventValuenumberThe sub-category identifier

Store selected

Emitted when the user selects a store.

Event name: storeSelected

PropertyTypeDescription
storeIdnumberThe store identifier
storeNamestringThe store name

Time selected

Emitted when the user selects a pickup or delivery time.

Event name: timeSelected

PropertyTypeDescription
eventLabelstringThe time selection type. datetime or datetime-blocks
dimension4stringWhether the time is direct or future. direct or future

Ecommerce events

Products impression

Emitted when products are displayed to the user.

Event name: productsImpression

PropertyTypeDescription
ecommerce.countryCodestringThe country code
ecommerce.currencyCodestringThe currency code
ecommerce.impressionsobject[]The products shown. See Product data

Product click

Emitted when the user clicks on a product.

Event name: productClick

PropertyTypeDescription
eventLabelstringLabel describing the product
ecommerce.countryCodestringThe country code
ecommerce.click.actionField.liststringThe list the product was in
ecommerce.click.productsobject[]The products clicked. See Product data

Product detail

Emitted when the user views a product's detail page.

Event name: productDetail

PropertyTypeDescription
eventLabelstringLabel describing the product
ecommerce.countryCodestringThe country code
ecommerce.detail.actionField.liststringThe list the product was in
ecommerce.detail.productsobject[]The products viewed. See Product data

Add to cart

Emitted when a product is added to the cart.

Event name: addToCart

PropertyTypeDescription
eventLabelstringLabel describing the product
ecommerce.countryCodestringThe country code
ecommerce.currencyCodestringThe currency code
ecommerce.cultureCodestring (optional)The culture code
ecommerce.sourceProductMenuIdnumber (optional)The source product menu identifier
ecommerce.add.productsobject[]The products added. See Product data

Remove from cart

Emitted when a product is removed from the cart.

Event name: removeFromCart

PropertyTypeDescription
eventLabelstringLabel describing the product
ecommerce.countryCodestringThe country code
ecommerce.remove.productsobject[]The products removed. See Product data

Checkout

Emitted when the user proceeds to checkout.

Event name: checkout

PropertyTypeDescription
eventLabelstringAlways Checkout
ecommerce.countryCodestringThe country code
ecommerce.currencyCodestringThe currency code
ecommerce.checkout.productsobject[]The products in the checkout. See Product data

Transaction

Emitted when a purchase transaction is completed.

Event name: transaction

PropertyTypeDescription
pagestringThe current page
titlestringThe page title
dimension1stringThe order type
dimension2stringThe store affiliation (store name and city)
dimension3stringThe user identifier
dimension4stringWhether the order is future or direct
dimension5stringThe check number
ecommerce.countryCodestringThe country code
ecommerce.currencyCodestringThe currency code
ecommerce.purchase.actionField.idstringThe transaction identifier
ecommerce.purchase.actionField.affiliationstringThe store affiliation (store name and city)
ecommerce.purchase.actionField.storeCitystringThe store city
ecommerce.purchase.actionField.revenuestringThe total revenue
ecommerce.purchase.actionField.taxstringThe tax amount
ecommerce.purchase.actionField.shippingstringThe shipping cost
ecommerce.purchase.storeIdstringThe store identifier
ecommerce.purchase.pickupTimestringThe pickup time
ecommerce.purchase.providerstringThe payment provider, for example adyen
ecommerce.purchase.productsobject[]The products purchased. See Product data
ecommerce.purchase.collectionTypestring (optional)The collection type
ecommerce.purchase.paymentMethodTypestring (optional)The payment method type

Basket quantity changed

Emitted when the quantity of a product in the basket is changed.

Event name: basketQuantityChanged

PropertyTypeDescription
eventLabelstringLabel describing the change
ecommerce.countryCodestringThe country code
ecommerce.change.productsobject[]The products changed. See Product data

Product data

Several events include product data. Each product object has the following properties:

PropertyTypeDescription
namestringThe product name
idnumberThe product identifier
pricenumberThe product price
categorystringThe product category
quantitynumber (optional)The quantity
liststring (optional)The list the product belongs to