Ecommerce - QProtocol events
Ecommerce - QProtocol events
This is for:
Developer- ecView
- ecUser
- ecProduct
- ecBasketItem
- ecBasketItemAction
- ecBasketItemTransaction
- ecBasketTransactionSummary
- ecBasketSummary
- ecUserLogin
- ecUserSignup
- ecInteraction
- ecError
- ecFilterCriteria
- ecFormSubmission
- ecProductRecommendation
- ecProductStateDev
- ecSearch
- ecSearchItemClick
- ecSearchItemsShown
- ecStoreLocator
- ecVoucher
ecView
Experience Hub Core
Experience Hub Qubit Recs
Experience Hub Google Recs
Experience Hub Badging
Experience Hub Product Insights
Experimentation Hub Core
Experimentation Hub Social proof
Experimentation Hub Recs
Experimentation Hub Abandonment recovery
The ecView
event reports a page view and is a special event because it is required by smartserve.js for data collection and processing.
It’s therefore essential that every page emits an ecView
event and that it is emitted before any other event.
Any CEH events emitted before the first |
Note
For Product Insights, |
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
type (String) |
The type of view. Can be one of |
|
subtypes (String[]) |
An unordered list of subtypes to describe the view |
|
language (String) |
The language used in this view. Must be an IETF language code |
|
country (String) |
The selected country for the view. Must be an ISO 3166-1 alpha-2 code |
|
currency (String) |
The ISO 4217 currency code for the user (for example, |
|
environment (String) |
Reports the environment (for example, development, staging, or production) |
|
store.id (String) |
Unique identifier for the store closest to the user or an explicitly selected store |
|
store.address.addressee (String) |
Full name of the person for whom the address is for |
|
store.address.company (String) |
The name of the company |
|
store.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
store.address.locality (String) |
The town or city |
|
store.address.region (String) |
E.g state in the US, county in the UK |
|
store.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
store.address.country (String) |
The name of the country |
|
store.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
siteVersion (String) |
The selected site version for the view (for example, desktop, mobile, tablet) |
|
Example JavaScript
uv.emit('ecView', {
type: 'category',
subtypes: [
'Womens',
'Dresses',
'Cocktail Dresses'
],
environment: 'production',
store: {
id: '12424',
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
}
},
language: 'en-us',
country: 'US',
siteVersion: 'desktop',
currency: 'USD'
})
ecUser
Experience Hub Core
Experience Hub Google Recs
Experimentation Hub Core
Experimentation Hub Abandonment recovery
The ecUser
event is emitted once per view and reports visitor metadata.
The event should be emitted on every page as long as there is data available for the user.
For many sites, the event will be present and well populated when the visitor logs on. Sites with a newsletter subscription form that the visitor has previously submitted, might be able to populate the name and email address for the visitor using the data collected on form submission.
It is acceptable to emit hashed user Ids but be aware that to ingest data for use in Qubit’s platform, the user Ids in the provided dataset must be hashed in the same way. |
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
user.id (String) |
A unique user Id. Can also be a hash of the username and/or email address |
|
user.firstName (String) |
The user’s first name |
|
user.lastName (String) |
The user’s last name |
|
user.username (String) |
The username for the user |
|
user.email (String) |
The user’s primary email address |
|
user.title (String) |
The user’s title |
|
user.gender (String) |
The user’s gender. Can be |
|
user.firstSession (Boolean) |
True if it’s the user’s first session |
|
user.hasTransacted (Boolean) |
True if the user has completed 1 or more transactions |
|
user.loyalty.id (String) |
Loyalty program membership number |
|
user.loyalty.tier (String) |
The level of the loyalty program this user holds |
|
user.loyalty.tierPoints (Number) |
The number of tier points |
|
user.loyalty.membershipType (String) |
The type of loyalty membership |
|
user.loyalty.membershipPoints (Number) |
The number of points from this membership |
|
user.address.addressee (String) |
Full name of the person for whom the address is for |
|
user.address.company (String) |
The name of the company |
|
user.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
user.address.locality (String) |
The town or city |
|
user.address.region (String) |
E.g state in the US, county in the UK |
|
user.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
user.address.country (String) |
The name of the country |
|
user.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
user.isGuest (String) |
True if the user is a guest user without a registered account |
|
user.age (Number) |
The user’s age in years |
|
user.phoneNumber (String) |
The user’s phone number. Should be formatted without spaces, braces, or hyphens |
|
user.countryCallingCode (String) |
The country calling code for the given phone number, formatted to include the |
|
user.device (String) |
Device the user is browsing on, for example |
|
Example JavaScript
uv.emit('ecUser', {
user: {
id: '2861102bace6e6620948564f0ce0a7cd',
title: 'Mr',
firstName: 'John',
lastName: 'Smith',
gender: 'Male',
username: 'JohnSmith',
email: 'john@johnsmith.com',
firstSession: null,
hasTransacted: true,
loyalty: {
id: '8989752-223',
tier: 'silver',
tierPoints: null,
membershipType: 'Clearsky Rewards',
membershipPoints: null
},
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
isGuest: 'true',
age: 42,
phoneNumber: '2121234567',
countryCallingCode: '1',
device: 'kiosk'
}
})
ecProduct
Experience Hub Core
Experience Hub Qubit Recs
Experience Hub Google Recs
Experience Hub Badging
Experience Hub Product Insights
Experimentation Hub Core
Experimentation Hub Social proof
Experimentation Hub Recs
Experimentation Hub Abandonment recovery
Product events report a product loaded on a page. This could be, for example, a main product, a linked product on a product detail page, a product in a listing page, or search page.
This event is not used for Recommendations reporting. Refer to Reporting On Recommendations Experiences for more information. |
The eventType
field differentiates between the different scenarios and can be:
-
detail
-
linked_product
Note
For Product Insights, |
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
eventType (String) |
The type of product event (for example, 'listing', 'detail', or 'linked_product') |
|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
index (Number) |
The index of the product as it’s positioned on the page (for example, the first product in a listing would be 0, the next would be 1). |
|
Example JavaScript
uv.emit('ecProduct', {
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
},
eventType: 'detail',
index: 1
})
ecBasketItem
Experience Hub Google Recs
Experimentation Hub Core
Basket events should be emitted on every page as long as there are one or more items in the basket. They should not be emitted on an order summary page. There are two types of basket events that are emitted, ecBasketItem and ecBasketSummary.
Individual items are emitted as ecBasketItem events, each of which contains the summary for the full basket. This denormalization is essential for query performance.
After emitting one or more ecBasketItem events, a ecBasketSummary event should be emitted.
Note
If item level detail is not known, it is acceptable to emit just an ecBasketSummary event without any ecBasketItem events. |
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
quantity (Number) |
The number of products described by the line item |
|
subtotal (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc. |
|
subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
subtotalIncludingTax (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc. |
|
subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
shippingMethod (String) |
The shipping method for the product. Should only be populated if the product uses a different shipping method to other products in the basket |
|
shippingCost (Price) |
The shipping cost for the product. Should only be populated if the product has an independant shipping cost from other products in the basket |
|
shippingCost.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
shippingCost.currency (String) |
The ISO 4217 currency (for example, |
|
discount (Price) |
The discount applied to the basket from vouchers or promotions |
|
discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
discount.currency (String) |
The ISO 4217 currency (for example, |
|
Example JavaScript
uv.emit('ecBasketItem', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
},
quantity: 2,
subtotal: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Express',
shippingCost: {
value: 9.99,
currency: 'USD'
},
discount: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
})
ecBasketItemAction
Experience Hub Google Recs
Experience Hub Badging
Experimentation Hub Core
Emitted for every interaction with the basket, using the action field to specify whether a line item was added or removed. The event should also contain the summary for the full basket. This denormalization is essential for query performance.
After emitting one or more ecBasketItem
events, a ecBasketSummary
event should be emitted.
Note
If item level detail is not known, it is acceptable to emit just an |
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
quantity (Number) |
The number of products described by the line item |
|
subtotal (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc. |
|
subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
subtotalIncludingTax (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc. |
|
subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
action (String) |
Can be either 'add', 'remove' for status changes |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
shippingMethod (String) |
The shipping method for the product. Should only be populated if the product uses a different shipping method to other products in the basket |
|
shippingCost (Price) |
The shipping cost for the product. Should only be populated if the product has an independant shipping cost from other products in the basket |
|
shippingCost.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
shippingCost.currency (String) |
The ISO 4217 currency (for example, |
|
discount (Price) |
The discount applied to the basket from vouchers or promotions |
|
discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
discount.currency (String) |
The ISO 4217 currency (for example, |
|
Example JavaScript
uv.emit('ecBasketItemAction', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
},
quantity: 2,
subtotal: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Express',
shippingCost: {
value: 9.99,
currency: 'USD'
},
discount: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
},
action: 'add'
})
ecBasketItemTransaction
Experience Hub Core
Experience Hub Qubit Recs
Experience Hub Google Recs
Experience Hub Badging
Experience Hub Product Insights
Experimentation Hub Core
Experimentation Hub Social proof
Experimentation Hub Recs
Transaction events are important because they report revenue for your website.
They are set up in a similar way to basket events, except you should only emit them on a confirmation page, and they must include transaction.id
.
The fields you emit to report what products the customer has purchased should be well aligned with the fields you emit in the ecBasketTransactionSummary
event, which is emitted on the same page.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
quantity (Number) |
The number of products described by the line item |
|
subtotal (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity before the application of taxes, discounts, promotions, shipping costs, etc. |
|
subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
subtotalIncludingTax (Price) |
The subtotal of the products described by the line item taking into account the current price and quantity including tax, but before the application of discounts, promotions, shipping costs, etc. |
|
subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
transaction.id (String) |
An Id unique to the transaction |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
shippingMethod (String) |
The shipping method for the product. Should only be populated if the product uses a different shipping method to other products in the basket |
|
shippingCost (Price) |
The shipping cost for the product. Should only be populated if the product has an independant shipping cost from other products in the basket |
|
shippingCost.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
shippingCost.currency (String) |
The ISO 4217 currency (for example, |
|
discount (Price) |
The discount applied to the basket from vouchers or promotions |
|
discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
discount.currency (String) |
The ISO 4217 currency (for example, |
|
transaction.firstTransaction (Boolean) |
True only if this is the first ever transaction for the user |
|
transaction.paymentType (String) |
The type of payment |
|
transaction.billingAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.billingAddress.company (String) |
The name of the company |
|
transaction.billingAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.billingAddress.locality (String) |
The town or city |
|
transaction.billingAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.billingAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.billingAddress.country (String) |
The name of the country |
|
transaction.billingAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.parentId (String) |
If the transaction is an amendment to a previous transaction, should be the Id of the parent transaction |
|
transaction.deliveryAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.deliveryAddress.company (String) |
The name of the company |
|
transaction.deliveryAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.deliveryAddress.locality (String) |
The town or city |
|
transaction.deliveryAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.deliveryAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.deliveryAddress.country (String) |
The name of the country |
|
transaction.deliveryAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.collectionStore.id (String) |
Unique identifier for the store closest to the user or an explicitly selected store |
|
transaction.collectionStore.address.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.collectionStore.address.company (String) |
The name of the company |
|
transaction.collectionStore.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.collectionStore.address.locality (String) |
The town or city |
|
transaction.collectionStore.address.region (String) |
E.g state in the US, county in the UK |
|
transaction.collectionStore.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.collectionStore.address.country (String) |
The name of the country |
|
transaction.collectionStore.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
Example JavaScript
uv.emit('ecBasketItemTransaction', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
},
quantity: 2,
subtotal: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Express',
shippingCost: {
value: 9.99,
currency: 'USD'
},
discount: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
},
transaction: {
id: '83748372',
firstTransaction: true,
paymentType: 'paypal',
billingAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
parentId: '83748371',
deliveryAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
collectionStore: {
id: '12424',
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
}
}
}
})
ecBasketTransactionSummary
Experience Hub Core
Experience Hub Google Recs
Experimentation Hub Core
Experimentation Hub Social proof
Experimentation Hub Recs
Experimentation Hub Abandonment recovery
This event collects a summary of information about the transaction.
Importantly, this event is used to count conversions and the associated revenue.
The event must include a transaction.id
and the basket total.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
transaction.id (String) |
An Id unique to the transaction |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
transaction.firstTransaction (Boolean) |
True only if this is the first ever transaction for the user |
|
transaction.paymentType (String) |
The type of payment |
|
transaction.billingAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.billingAddress.company (String) |
The name of the company |
|
transaction.billingAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.billingAddress.locality (String) |
The town or city |
|
transaction.billingAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.billingAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.billingAddress.country (String) |
The name of the country |
|
transaction.billingAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.parentId (String) |
If the transaction is an amendment to a previous transaction, should be the Id of the parent transaction |
|
transaction.deliveryAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.deliveryAddress.company (String) |
The name of the company |
|
transaction.deliveryAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.deliveryAddress.locality (String) |
The town or city |
|
transaction.deliveryAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.deliveryAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.deliveryAddress.country (String) |
The name of the country |
|
transaction.deliveryAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.collectionStore.id (String) |
Unique identifier for the store closest to the user or an explicitly selected store |
|
transaction.collectionStore.address.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.collectionStore.address.company (String) |
The name of the company |
|
transaction.collectionStore.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.collectionStore.address.locality (String) |
The town or city |
|
transaction.collectionStore.address.region (String) |
E.g state in the US, county in the UK |
|
transaction.collectionStore.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.collectionStore.address.country (String) |
The name of the country |
|
transaction.collectionStore.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
Example JavaScript
uv.emit('ecBasketTransactionSummary', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
transaction: {
id: '83748372',
firstTransaction: true,
paymentType: 'paypal',
billingAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
parentId: '83748371',
deliveryAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
collectionStore: {
id: '12424',
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
}
}
}
})
ecBasketSummary
Experimentation Hub Core
Emitted each time the basket is shown to the visitor either as an inline minibasket or in a view that shows only the basket. If the visitor’s basket is changed in any way, the summary is emitted again.
After emitting one or more ecBasketItem
events, a ecBasketSummary
event should be emitted.
If item level detail is not known, it is acceptable to emit just an ecBasketSummary event.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
Example JavaScript
uv.emit('ecBasketSummary', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
}
})
ecUserLogin
Optional
Emitted when a user logs in.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
user.id (String) |
A unique user Id. Can also be a hash of the username and/or email address |
|
user.title (String) |
The user’s title |
|
user.firstName (String) |
The user’s first name |
|
user.lastName (String) |
The user’s last name |
|
user.gender (String) |
The user’s gender. Can be |
|
user.username (String) |
The username for the user |
|
user.email (String) |
The user’s primary email address |
|
user.firstSession (Boolean) |
True if it’s the user’s first session |
|
user.hasTransacted (Boolean) |
True if the user has completed 1 or more transactions |
|
user.loyalty.id (String) |
Loyalty program membership number |
|
user.loyalty.tier (String) |
The level of the loyalty program this user holds |
|
user.loyalty.tierPoints (Number) |
The number of tier points |
|
user.loyalty.membershipType (String) |
The type of loyalty membership |
|
user.loyalty.membershipPoints (Number) |
The number of points from this membership |
|
user.address.addressee (String) |
Full name of the person for whom the address is for |
|
user.address.company (String) |
The name of the company |
|
user.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
user.address.locality (String) |
The town or city |
|
user.address.region (String) |
E.g state in the US, county in the UK |
|
user.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
user.address.country (String) |
The name of the country |
|
user.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
user.isGuest (String) |
True if the user is a guest user without a registered account |
|
user.age (Number) |
The user’s age in years |
|
user.phoneNumber (String) |
The user’s phone number. Should be formatted without spaces, braces, or hyphens |
|
user.countryCallingCode (String) |
The country calling code for the given phone number, formatted to include the |
|
user.device (String) |
Device the user is browsing on, for example |
|
firstLogin (Boolean) |
True only if this is the first time the user has logged in |
|
Example JavaScript
uv.emit('ecUserLogin', {
user: {
id: '2861102bace6e6620948564f0ce0a7cd',
title: 'Mr',
firstName: 'John',
lastName: 'Smith',
gender: 'Male',
username: 'JohnSmith',
email: 'john@johnsmith.com',
firstSession: null,
hasTransacted: true,
loyalty: {
id: '8989752-223',
tier: 'silver',
tierPoints: null,
membershipType: 'Clearsky Rewards',
membershipPoints: null
},
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
isGuest: 'true',
age: 42,
phoneNumber: '2121234567',
countryCallingCode: '1',
device: 'kiosk'
},
firstLogin: true
})
ecUserSignup
Optional
Emitted when a user signs up for a newsletter, event, loyalty account, or similar.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
user.id (String) |
A unique user Id. Can also be a hash of the username and/or email address |
|
user.title (String) |
The user’s title |
|
user.firstName (String) |
The user’s first name |
|
user.lastName (String) |
The user’s last name |
|
user.gender (String) |
The user’s gender. Can be |
|
user.username (String) |
The username for the user |
|
user.email (String) |
The user’s primary email address |
|
user.firstSession (Boolean) |
True if it’s the user’s first session |
|
user.hasTransacted (Boolean) |
True if the user has completed 1 or more transactions |
|
user.loyalty.id (String) |
Loyalty program membership number |
|
user.loyalty.tier (String) |
The level of the loyalty program this user holds |
|
user.loyalty.tierPoints (Number) |
The number of tier points |
|
user.loyalty.membershipType (String) |
The type of loyalty membership |
|
user.loyalty.membershipPoints (Number) |
The number of points from this membership |
|
user.address.addressee (String) |
Full name of the person for whom the address is for |
|
user.address.company (String) |
The name of the company |
|
user.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
user.address.locality (String) |
The town or city |
|
user.address.region (String) |
E.g state in the US, county in the UK |
|
user.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
user.address.country (String) |
The name of the country |
|
user.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
user.isGuest (String) |
True if the user is a guest user without a registered account |
|
user.age (Number) |
The user’s age in years |
|
user.phoneNumber (String) |
The user’s phone number. Should be formatted without spaces, braces, or hyphens |
|
user.countryCallingCode (String) |
The country calling code for the given phone number, formatted to include the |
|
user.device (String) |
Device the user is browsing on, for example |
|
type (String) |
What the user has signed up for |
|
name (String) |
A meaningful name unique to the sign up |
|
Example JavaScript
uv.emit('ecUserSignup', {
user: {
id: '2861102bace6e6620948564f0ce0a7cd',
title: 'Mr',
firstName: 'John',
lastName: 'Smith',
gender: 'Male',
username: 'JohnSmith',
email: 'john@johnsmith.com',
firstSession: null,
hasTransacted: true,
loyalty: {
id: '8989752-223',
tier: 'silver',
tierPoints: null,
membershipType: 'Clearsky Rewards',
membershipPoints: null
},
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
isGuest: 'true',
age: 42,
phoneNumber: '2121234567',
countryCallingCode: '1',
device: 'kiosk'
},
type: 'newsletter',
name: 'loyaltyaccount'
})
ecInteraction
Optional
Emitted to track visitor interaction for certain elements on the page. These events are not emitted for all interactions on all elements, only those that are of interest.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
type (String) |
The interaction type (for example, click, view, hover, download, share) |
|
name (String) |
A meaningful name unique for the event |
|
Example JavaScript
uv.emit('ecInteraction', {
type: 'click',
name: 'TopNavHomeButton'
})
ecError
Optional
Emitted for every error.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
code (String) |
The error code. |
|
message (String) |
The error message. |
|
Example JavaScript
uv.emit('ecError', {
code: null,
message: null
})
ecFilterCriteria
Optional
Emitted on listing and search result views to report the filters applied and the sorting.
On search views, the event is emitted with the name: 'search'
, operator: 'equal'
, and value: '[entered search term]'
:
name: 'search',
operator: 'equal',
value: 'shoes'
On category views, for each category the view falls under, the event is emitted with the name :'category'
, operator: 'equal'
, and value: '[category name]'
:
name: 'adidas',
operator: 'equal',
value: 'trainers'
Ranges are modeled by emitting the upper and lower bound as separate filter criteria events, setting the operator as greater than
or less than
.
When users add, remove, or change a filter, a new view event is emitted followed by all filter criteria that are still active after the change.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
summary.pagination (Number) |
The number of items shown per page to the visitor. |
|
summary.resultCount (Number) |
The number of items that match the current query and/or filters. Should be more than or equal to the number of items shown to the visitor. |
|
summary.layout (String) |
The user’s chosen visual layout of the listing (for example, |
|
summary.sortBy (String) |
The sort column. |
|
summary.sortDirection (String) |
The sort direction, that is, |
|
name (String) |
The name of criteria (for example, |
|
operator (String) |
Can be |
|
value.boolean (Boolean) |
Should only be populated if the type is 'Boolean'. |
|
value.integer (String) |
Should only be populated if the type is 'Integer'. |
|
value.long (Long) |
Should only be populated if the type is 'Long'. |
|
value.float (Number) |
Should only be populated if the type is 'Float'. |
|
value.timestamp (Epochtimems) |
Should only be populated if the type is 'EpochTimeMs'. |
|
value.money (Number) |
Should only be populated if the type is 'Money'. |
|
value.currency (String) |
Should only be populated if the type is 'Currency'. |
|
value.email (String) |
Should only be populated if the type is 'Email'. |
|
value.url (String) |
Should only be populated if the type is 'URL'. |
|
value.string (String) |
Should only be populated if the type is 'String'. |
|
value.text (String) |
Should only be populated if the type is 'Text'. |
|
value.date (Date) |
Should only be populated if the type is 'Date'. |
|
value.json (Json) |
Should only be populated if the type is 'JSON'. |
|
Example JavaScript
uv.emit('ecFilterCriteria', {
summary: {
pagination: 1,
resultCount: 20,
layout: 'list',
sortBy: 'price',
sortDirection: 'descending'
},
name: 'price',
operator: 'less than',
value: {
'boolean': true,
integer: '10',
'long': 1238902625,
'float': 5.5,
timestamp: 1455748626070,
money: 9.99,
currency: 'USD',
email: 'john.smith@gmail.com',
url: 'http://demo.qubitproducts.com',
string: 'This is some text',
text: 'This is some longer text',
date: '2016-05-20T17:33:45+00:00',
json: '{"key":"value","anotherKey":123,"yetAnotherKey":{"subKey":true}}'
}
})
ecFormSubmission
Optional
Emitted when a user submits a form
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
submissionId (String) |
An Id unique to the form submission |
|
name (String) |
The name of the form |
|
Example JavaScript
uv.emit('ecFormSubmission', {
submissionId: null,
name: 'ContactUsEnquiry'
})
ecProductRecommendation
Optional
Emitted for every product that is recommended to a visitor, in most cases as a related item to a recently viewed product.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
eventType (String) |
The type of product event (for example, 'listing', 'detail', or 'linked_product') |
|
index (Number) |
The index of the product as it’s positioned on the page (for example, the first product in a listing would be 0, the next would be 1). |
|
rank (Number) |
A rank between 0 and 1 (0 being the first shown / highest ranking recommendation). |
|
Example JavaScript
uv.emit('ecProductRecommendation', {
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
},
eventType: 'detail',
index: 1,
rank: 0.8
})
ecProductStateDev
Optional
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
meta.type (String) |
The type of event. |
|
meta.referrerUrl (String) |
The referrer URL. |
|
context.id (String) |
The product ID. |
|
product.groupId (String) |
Id for a group of products that come in different versions (variants) |
|
product.productId (String) |
Id to identify a product, normally covering all of its size, color, pattern, and material variants |
|
product.sku (String) |
Unique product identifier to distinguish each product from all of the other size, color, pattern, material, age, group, gender variants |
|
product.name (String) |
The product’s name, which should match the name shown on the product page |
|
product.description (String) |
An accurate description of the product, which should match the description on the product page |
|
product.categories (String[]) |
A list of one or more product categories this product belongs to. Each category is a full path of a category where each level is separated by |
|
product.price (Price) |
The price that the product is currently being sold at, after discounts |
|
product.price.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.price.currency (String) |
The ISO 4217 currency (for example, |
|
product.originalPrice (Price) |
The price of the product before discounts, promotions |
|
product.originalPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
product.originalPrice.currency (String) |
The ISO 4217 currency (for example, |
|
product.url (String) |
The fully qualified URL that the product is shown on |
|
product.images (String[]) |
An array of fully qualified image URLs for the product. The main image you want to use to display the product must be the first element in the array |
|
product.stock (Number) |
The number of items left in stock for the product. Should only be populated when the product is in stock and the exact number is known. Should be 0 if the product is out of stock. Where different product variants have different stock levels, use the maximum stock level |
|
product.manufacturer (String) |
The product manufacturer, recommended when a product inventory includes multiple brands |
|
product.color (String) |
The color of the product |
|
product.size (String) |
The size of the product (for example, 12, M, XL, 14) |
|
product.rating (Number) |
Average rating for this product. Should be between 0 and 1 |
|
product.reviewCount (Number) |
Number of reviews submitted for the product |
|
product.gender (String) |
The target gender of the product |
|
product.clearance (Boolean) |
True if the product is a clearance item |
|
product.onSale (Boolean) |
True if the item is on sale |
|
Example JavaScript
uv.emit('ecProductStateDev', {
meta: {
type: 'ecView',
referrerUrl: 'https://www.google.co.uk/'
},
context: {
id: '1334'
},
product: {
groupId: 'DRESS1',
productId: 'DRESS101',
sku: 'DRESS101-12',
name: 'Red Cocktail Dress',
description: 'This red cocktail dress is perfect for any occasion',
categories: [
'Clothing > Sweaters > Short Sleeve Sweaters',
'New Arrivals > Clothing'
],
price: {
value: 9.99,
currency: 'USD'
},
originalPrice: {
value: 9.99,
currency: 'USD'
},
url: 'http://www.fashionunion.com/dresses/red-cocktail-dress.html',
images: [
'http://www.fashionunion.com/dresses/red-cocktail-dress-1.jpg',
'http://www.fashionunion.com/dresses/red-cocktail-dress-2.jpg'
],
stock: 20,
manufacturer: 'Dress Inc',
color: 'Red',
size: '12',
rating: 0.8,
reviewCount: 5132,
gender: 'unisex',
clearance: true,
onSale: null
}
})
ecSearch
Optional
Emitted when a visitor lands on a search results page or is redirected to another page on site.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
type (String) |
The type of search conducted by the visitor. Values can be 'organic', 'autocomplete' or 'suggestion'. |
|
outcome (String) |
The result of the search conducted by the visitor. Values can be 'success', 'fail' or 'redirect'. |
|
query.id (String) |
Unique identifier for the visitor’s search. |
|
query.term (String) |
Search term entered by the visitor. |
|
resultCount (Number) |
The total number of products returned on the search results page. |
|
source (String) |
Where the search originated from. |
|
Example JavaScript
uv.emit('ecSearch', {
type: 'organic',
outcome: 'success',
query: {
id: '0k0om4iccpo-0ksgltzxn-afw61j5',
term: 'Dress'
},
resultCount: 20,
source: 'spotlight-search'
})
ecSearchItemClick
Optional
Emitted when a visitor clicks a product from the search results page.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
query.id (String) |
Unique identifier for the visitor’s search. |
|
query.term (String) |
Search term entered by the visitor. |
|
productId (String) |
Product ID clicked by the visitor on the search results page. |
|
position (Number) |
Position of the product that was clicked on the search results page. |
|
Example JavaScript
uv.emit('ecSearchItemClick', {
query: {
id: '0k0om4iccpo-0ksgltzxn-afw61j5',
term: 'Dress'
},
productId: 'DRESS101',
position: 3
})
ecSearchItemsShown
Optional
Emitted when products are shown to the visitor on a search results page.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
query.id (String) |
Unique identifier for the visitor’s search. |
|
query.term (String) |
Search term entered by the visitor. |
|
productIds (String[]) |
Array of product IDs shown to the visitor on the search results page. |
|
Example JavaScript
uv.emit('ecSearchItemsShown', {
query: {
id: '0k0om4iccpo-0ksgltzxn-afw61j5',
term: 'Dress'
},
productIds: [
'DRESS101',
'DRESS102',
'DRESS103'
]
})
ecStoreLocator
Optional
Emitted when a user runs a query on the store locater.
Note
|
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
type (String) |
Type of query the user enters, if the user can query from different fields (for example, postcode, street address, city). |
|
query (String) |
User-entered store location query. |
|
store.id (String) |
Unique identifier for the store closest to the user or an explicitly selected store |
|
store.address.addressee (String) |
Full name of the person for whom the address is for |
|
store.address.company (String) |
The name of the company |
|
store.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
store.address.locality (String) |
The town or city |
|
store.address.region (String) |
E.g state in the US, county in the UK |
|
store.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
store.address.country (String) |
The name of the country |
|
store.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
Example JavaScript
uv.emit('ecStoreLocator', {
type: 'zipcode',
query: '10010',
store: {
id: '12424',
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
}
}
})
ecVoucher
Optional
Emitted when a voucher code is entered.
Example schema
Field (JS Data Type) | Description | Required for |
---|---|---|
entry (String) |
Actual voucher code the user enters. |
|
entrySuccess (Boolean) |
Whether or not the voucher is successfully applied to the transaction. An entry must be valid to be successful. |
|
voucher.id (String) |
A unique Id to identify the voucher used, which should be the same for all visitors that are using the voucher/promotion |
|
voucher.label (String) |
A name or label for the voucher/promotion |
|
transaction.id (String) |
An Id unique to the transaction |
|
transaction.firstTransaction (Boolean) |
True only if this is the first ever transaction for the user |
|
transaction.paymentType (String) |
The type of payment |
|
transaction.billingAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.billingAddress.company (String) |
The name of the company |
|
transaction.billingAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.billingAddress.locality (String) |
The town or city |
|
transaction.billingAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.billingAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.billingAddress.country (String) |
The name of the country |
|
transaction.billingAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.parentId (String) |
If the transaction is an amendment to a previous transaction, should be the Id of the parent transaction |
|
transaction.deliveryAddress.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.deliveryAddress.company (String) |
The name of the company |
|
transaction.deliveryAddress.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.deliveryAddress.locality (String) |
The town or city |
|
transaction.deliveryAddress.region (String) |
E.g state in the US, county in the UK |
|
transaction.deliveryAddress.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.deliveryAddress.country (String) |
The name of the country |
|
transaction.deliveryAddress.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
transaction.collectionStore.id (String) |
Unique identifier for the store closest to the user or an explicitly selected store |
|
transaction.collectionStore.address.addressee (String) |
Full name of the person for whom the address is for |
|
transaction.collectionStore.address.company (String) |
The name of the company |
|
transaction.collectionStore.address.lines (String[]) |
An array of address lines NOT including city, region, postcode or country (maximum of 3 lines allowed) |
|
transaction.collectionStore.address.locality (String) |
The town or city |
|
transaction.collectionStore.address.region (String) |
E.g state in the US, county in the UK |
|
transaction.collectionStore.address.postalCode (String) |
Can be the country equivalent code (for example, zip code for the U.S) |
|
transaction.collectionStore.address.country (String) |
The name of the country |
|
transaction.collectionStore.address.countryCode (String) |
An ISO 3166-1 alpha-2 country code |
|
basket.id (String) |
Unique basket Id |
|
basket.subtotal (Price) |
The basket value before the application of taxes, discounts, promotions, shipping costs, etc |
|
basket.subtotal.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotal.currency (String) |
The ISO 4217 currency (for example, |
|
basket.total (Price) |
The basket total after the application of discounts, promotions, shipping costs, etc |
|
basket.total.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.total.currency (String) |
The ISO 4217 currency (for example, |
|
basket.quantity (Number) |
The number of items in the basket |
|
basket.discount (Price) |
The amount discounted by vouchers or promotions |
|
basket.discount.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.discount.currency (String) |
The ISO 4217 currency (for example, |
|
basket.tax (Price) |
The total tax applied to the basket |
|
basket.tax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.tax.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingPrice (Price) |
The selected or default shipping price |
|
basket.shippingPrice.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.shippingPrice.currency (String) |
The ISO 4217 currency (for example, |
|
basket.shippingMethod (String) |
The selected or default shipping method |
|
basket.subtotalIncludingTax (Price) |
The basket subtotal, including tax, but before the application of discounts, promotions, shipping costs, etc |
|
basket.subtotalIncludingTax.value (Number) |
Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Refer to our setup docs for more specific details for each vertical and event |
|
basket.subtotalIncludingTax.currency (String) |
The ISO 4217 currency (for example, |
|
Example JavaScript
uv.emit('ecVoucher', {
entry: '12321',
entrySuccess: true,
voucher: {
id: 'AO8734',
label: 'SummerPromo'
},
transaction: {
id: '83748372',
firstTransaction: true,
paymentType: 'paypal',
billingAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
parentId: '83748371',
deliveryAddress: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
},
collectionStore: {
id: '12424',
address: {
addressee: 'John Smith',
company: 'Amce Inc',
lines: [
'Flat 12',
'123 High Street'
],
locality: 'London',
region: 'New York',
postalCode: '10010',
country: 'United States',
countryCode: 'US'
}
}
},
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
discount: {
value: 9.99,
currency: 'USD'
},
tax: {
value: 9.99,
currency: 'USD'
},
shippingPrice: {
value: 9.99,
currency: 'USD'
},
shippingMethod: 'Next Day',
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
}
})