Commerce Events Reference
Commerce Events Reference
Global Fields Reference
User Fields Reference
Users fields are related to the current user.
userId
(String)
Example: myuser@mycompany.com
|
Before using the |
currencyCode
(String)
The currency code is a three-letter code that identifies the user’s currency.
The code follows the ISO 4217
standard.
Example: CAD
anonymizeIp
(Boolean)
Use this field to anonymize the IP address by removing the last subnet of the current user’s IP address.
Coveo will never store unencrypted IPs, even when this setting is set to false
.
loyaltyCardId
(String)
A unique identifier provided to a returning user.
loyaltyTier
(String)
A level of membership where users receive perks and benefits depending on their rank.
Example: Platinum
thirdPartyPersona
(String)
This represents additional market segmentation based on user characteristics (demographics, interests, needs, or location) which aren’t created by Coveo Machine Learning. When you already have a set of segments for your users, enter the information in this field.
companyName
(String)
The name of a specific company for business-to-business sales.
favoriteStore
(String)
The primary store selected by a returning user.
storeName
(String)
The name of the current store selected by the user.
userIndustry
(String, Optional)
For business-to-business (B2B) environments that need to indicate which industry’s vertical structure the user belongs to (e.g., healthcare,technology, insurance).
userRole
(String, Optional)
For business-to-business (B2B) environments that need to indicate the role or title of the current user (e.g., director, manager, specialist).
userDepartment
(String, Optional)
For business-to-business (B2B) environments that need to indicate the department of the current user (e.g., IT, Design, Procurement, Sales).
businessUnit
(String, Optional)
This field defines the current catalog in use. For a solution with multiple catalogs, we use the catalog passed in this field to separate reporting and machine learning between catalogs.
Page Fields Reference
Page fields are sent using the set
command, or alongside a pageview
event as shown in the following command:
coveoua('send', 'pageview', {
page: '/mypage'
})
page
(String)
The path portion of the page URL.
Example: /mycurrentpage
title
(String)
The title of the page. The default value is retrieved from document.title
.
Example: My Super Site
location
(String)
The full URL of the page. The default value is retrieved from document.location
.
Example: https://www.mysupersite.com/home
Global Custom Fields Reference
The custom
field allows users to add additional custom values as an object.
Everything in this field will be unfolded to the parent object and then sent to coveoua
.
To set custom fields for the whole page, use the set
command, passing the custom
string as a second argument, and an object containing the desired key-value pairs as a third argument.
On custom user data
coveoua('set', 'custom', {
visitorAge: 18,
rewardsMember: true
});
// sets the `custom` field for each top-level object
When you use the send
command
coveoua('send', 'pageview');
The following data is sent to coveoua
visitorAge: 18,
rewardsMember: true
|
Note
When using a Coveo ML Content Recommendations (CR) model that leverages collect events to render product recommendations, you must ensure that |
Product Data Fields Reference
Product Fields Reference
Product fields are set with the ec:addProduct
command.
name
(String, Optional)
Example: Very nice shoe
brand
(String, Optional)
Example: Coveo
category
(String, Optional)
Represents a grouping of products having particular shared characteristics.
Field format | Examples |
---|---|
Single |
|
Hierarchical |
|
Multi-value |
|
Ensure that you aren’t sending events that include breadcrumbs with temporary categories or events, such as sales
or clearance
items.
group
(String, Optional)
Represents an ID that’s specific to an item that has multiple SKUs attached to it. This is useful if you only want one item per group to be recommended by the machine learning algorithms.
variant
(String, Optional)
A string that defines the variant of the product.
Example: 001-red-8_wide
list
(String, Optional)
The list containing the associated products. For an example of this parameter, see Measure Events on a Listing or Search Page.
price
(Currency, Optional)
Example: 12.34
quantity
(Numeric, Optional)
Example: 12
coupon
(String, Optional)
The name of the coupon used on this specific product.
Example: PROMO-1234
position
(Numeric, Optional)
The item’s position.
For example, the first item displayed in a list should have position: 1
.
Example: 2
|
Note
For products and impressions, only a position greater than or equal to |
Transaction Fields Reference
Transaction fields are set with coveoua('ec:setAction', <ACTION>)
id
(String, Required)
An identifier used to track a specific transaction.
Example: transaction-1234
affiliation
(String, Optional)
The store where a transaction took place. Sent when you want to link a purchase
or refund
to a specific store.
Example: Shoe Store
revenue
(Currency, Optional)
The total value of the transaction, including taxes and shipping.
Example: 123.21
coupon
(String, Optional)
The name of the coupon used on the whole transaction.
Example: PROMO-FREE-SHIPPING-2020
Quote Fields Reference
Field references related to providing a quote to the user.
id
(Numeric, Required)
An identifier used to track a specific transaction.
affiliation
(String, Optional)
The store where a quote took place. Sent when you want to link a quote
to a specific store.
Example: Shoe Store
Review Fields Reference
Review fields provide customers the opportunity to rate and comment on products they have purchased.
id
(Numeric, Required)
An identifier used to track a specific transaction.
rating
(Numeric, Optional)
A rating described on a numeric scale from 0 to 10.
|
Note
When using a different rating method, for example a review of 0 to 5 stars, ensure you convert the score to a 0 to 10 scale. |
comment
(String, Optional)
A written summary of a user’s experience with a product or service.
Product Data Custom Fields Reference
The custom
field allows users to add additional custom values as an object.
Everything in this field will be unfolded to the parent object and then sent to coveoua
.
To set custom fields in a product impression, use the ec:addProduct
command, and add a custom
object containing the desired key-value pairs in your main product impression object.
On custom product data, when you use the ec:addProduct
command
coveoua('ec:addProduct', {
'id': '001-red',
'name': 'A very nice pair of shoes',
'brand': 'Coveo',
'category': 'Running shoes',
'price': 90.22,
'variant': '001-red-8_wide',
'custom' : {
'onSale' : false
}
});
When you use the send
command
coveoua('send', 'event');
It will send the following data
id: '001-red',
name: 'A very nice pair of shoes',
brand: 'Coveo',
category: 'Running shoes',
price: 90.22,
variant: '001-red-8_wide',
onSale : false
Product Action Type Reference
Action | Description |
---|---|
|
The user clicked on a product. |
|
The user accessed a detailed view of the product. |
|
The user accessed a quick view of the product. |
|
The user has viewed information about a product recommendation. |
|
The user added or removed a product from their cart. |
|
The sale or return of one or more products. |
|
The user added or removed a product from their bookmark. |
|
The user added a product to compare to another or removed one. |
|
The user added or removed a review on a product. |
|
The user asked for a quote regarding a given product (e.g., asked for a price on a large quantity of products in return for a discount). |
|
The user initiated the checkout process for one or more products. |
|
The user selected an option value for a given checkout step (e.g., selecting payment options or shipping methods). |
Impression Data Field Reference
Product fields are set with the ec:addImpression
command.
id
(String, Required)
The SKU used to uniquely identify your product.
Example: 001-red
position
(Numeric, Required)
The item’s position.
For example, the first displayed in a list should have position: 1
.
Example: 2
|
Note
For products and impressions, only a position greater than or equal to |
name
(String, Optional)
Example: Very nice shoe
brand
(String, Optional)
Example: Coveo
category
(String, Optional)
Example: Shoe
variant
(String, Optional)
A string that defines the variant of the product.
Example: 001-red-8_wide
list
(String, Optional)
The list that the associated products belong to. For an example of this parameter, see Measure Events on a Listing or Search Page.
price
(Currency, Optional)
Example: 12.34
Currency
Currency is a specification of a monetary amount. The following table lists the acceptable currency data types.
Currency data type | Examples |
---|---|
A positive or negative integer. |
|
A positive or negative decimal value with up to 6 decimal places using |
|
A string, which may contain a non-numeric prefix in front of an integer or decimal value.
In this case, Coveo interprets the number by stripping away the prefix up to the first numeric, |
Acceptable strings include |
|
Note
Coveo doesn’t support numbers using different decimal separators other than |