This section documents the full specification of Qubit's QProtocol events.
On the left, you can filter by your site's vertical, and also choose to only show fields that are recommended for the particular products you are intending to use.
Use the Optional tickbox to show those events that we recommend adding in a more advaned QProtocol implementation.
Don't forget that we have a number of vertical-specific setup guides, which you can find in our Setup section, along with guides on mobile set up and CMS integrations.
For more information on how to setup Qubit's UV library for emitting events, you can refer to our setup documentation.
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 is therefore essential that every page emits an ecView
event and that it is emitted before any other event.
DANGER: Any events emitted before the first ecView
event are considered invalid. Web and mobile applications emit view events whenever a view is rendered.
INFO: For Product Insights, type
must be category. See the Merchandising Hub setup guide for more information.
The type of view. Can be one of home
, category
, search
, product
, basket
, checkout
, confirmation
, help
, contact
, registration
, content
, account
, or other
. Custom names can be used for unique page types that are not covered by this specification. All types must be lowercase
uv.emit('ecView', {
type: 'category',
subtypes: [
'Womens',
'Dresses',
'Cocktail Dresses'
],
language: 'en-us',
country: 'US',
currency: 'USD'
})
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 websites, the event will be present and well populated when the visitor logs on. Websites 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.
WARNING: 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.
uv.emit('ecUser', {
user: {
id: '2861102bace6e6620948564f0ce0a7cd',
firstName: 'John',
lastName: 'Smith',
username: 'JohnSmith',
email: 'john@johnsmith.com'
}
})
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.
WARNING: 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:
INFO: For Product Insights, eventType
must be detail. See the Merchandising Hub setup guide for more information.
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 >
.
uv.emit('ecProduct', {
product: {
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'
},
eventType: 'detail'
})
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.
INFO: If item level detail is not known, it is acceptable to emit just an ecBasketSummary event without any ecBasketItem events.
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 >
.
uv.emit('ecBasketItem', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
product: {
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'
],
manufacturer: 'Dress Inc',
color: 'Red',
size: '12'
},
quantity: 2,
subtotal: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
})
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.
INFO: If item level detail is not known, it is acceptable to emit just an ecBasketSummary
event without any ecBasketItemevents
.
uv.emit('ecBasketItemAction', {
product: {
productId: 'DRESS101',
sku: 'DRESS101-12'
},
action: 'add'
})
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.
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 >
.
uv.emit('ecBasketItemTransaction', {
basket: {
id: 'BASK123',
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
product: {
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'
],
manufacturer: 'Dress Inc',
color: 'Red',
size: '12'
},
quantity: 2,
subtotal: {
value: 9.99,
currency: 'USD'
},
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
},
transaction: {
id: '83748372'
}
})
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.
uv.emit('ecBasketTransactionSummary', {
basket: {
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
},
transaction: {
id: '83748372'
}
})
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.
uv.emit('ecBasketSummary', {
basket: {
subtotal: {
value: 9.99,
currency: 'USD'
},
total: {
value: 9.99,
currency: 'USD'
},
quantity: 10,
subtotalIncludingTax: {
value: 9.99,
currency: 'USD'
}
}
})