Usage Analytics Events
- Commerce Data-Health Implementation Guide
- Log Coveo Events From Google Tag Manager
Commerce Data-Health Implementation Guide
This article guides you on how to set up a Coveo Usage Analytics (Coveo UA) library for Coveo for Commerce. It outlines the implementation steps, and covers the various events to implement, as well as prerequisites and best practices.
Collecting commerce events allows you to trace a user’s journey through your commerce site by providing you with accurate data on the user’s interaction with various elements on your site. The collected data also feeds attribution dashboards, which you can review on the Data Health Dashboard, and machine learning (ML) models which will ultimately help fine-tune the relevance of your site.
How the Script Is Used
Step 2: 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.
Step 3: Send Page View
While not specific to commerce events, page views are an essential piece of information that need to be collected to measure user behavior.
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.
Step 4: 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.
Step 5: Set the Action
coveoua('ec:setAction', <ACTION>) command lets you set the executed action on your data. See Action Types Reference.
Step 6: Add Impression Data
Step 7: Cart and Purchase Events
Step 8: Send Events
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.
All reference documentation can be found on the Commerce Events Reference page.
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.