- Log Coveo Events From Google Tag Manager
- Tracking Commerce Events
Tracking Commerce Events
Tracking commerce events is a valuable feature that lets you obtain an accurate account of a user’s interaction with elements of your commerce site. This data will let you create a true image of a user’s journey. It will also feed attribution dashboards and machine learning (ML) models which will ultimately help fine tune the relevance of your site.
How the Script Is Used
coveo.analytics.js script is used to send events to the Coveo Usage Analytics (Coveo UA) service. The library accepts a format similar to the Google Analytics tag (also called the
The first parameter is always a command name, and the other parameters vary depending on the executed command.
Set Global Fields
Some commands allow setting data where fields parameters can be set for the entire page. Fields can be set with
coveoua("set", <FIELD_NAME>, <FIELD_VALUE>). For example, to set a currency parameter, use
coveoua('set', 'currencyCode', 'EUR'). For reference information, see Global Fields References.
Send Page View
pageview event must be sent on every page of your site. This is the most important event as it gets cumulated data and sends the events to Coveo Usage Analytics.
Add Product Data
coveoua('ec:addProduct', <DATA>) command lets you include the relevant product data in the event you’re about to send.
For reference information, see Product Data Fields Reference.
Set the Action
coveoua('ec:setAction', <ACTION>) command lets you set the executed action on your data. See Action Types Reference.
Add Impression Data
Depending on the way the page has been created, to send an event to Coveo UA, either a page view or generic event must be sent.
To help understand the usage of tracking commerce events, you can explore the following pages. They’re based on a fictitious online store called TheGym, and capture the customer’s journey along the way.
All reference documentation can be found on the Tracking Commerce Events Reference page.