Log Collect Events

What’s the Collect Endpoint?

The Coveo Collect endpoint offers a new generic way to collect and track events instead of using the older /search, /searches, /click, /custom, and /view Usage Analytics (UA) Write API endpoints.[1] It lets you capture all of a user’s interactions with a Coveo-powered website or application, without requiring any event states to be retained on the client side. Currently, its main use is in commerce, but it will eventually support other types of Coveo implementations (e.g., service, website, and workplace).

As a developer, you can use the Collect endpoint to associate interactions with a website or application in a specific context, even if the user journey is non-linear and includes multiple search events or spans multiple browser tabs. This raw user interaction data can then be leveraged in reports which allow stakeholders to better understand how users are interacting with their business.

When Should I Use the Collect Endpoint?

The Collect endpoint can deterministically link non-linear events within their own specific contexts. Currently, the Collect endpoint only supports the commerce use case. As a developer, you should use it whenever you need to associate user interactions that happen in or out of a Coveo-powered commerce website or application. It has three main benefits over the older UA Write API endpoints:

  • It supports multiple objects per action or event.

  • It’s easier to implement without using the Coveo JavaScript Search Framework.

  • It allows you to track events even before you implement Coveo search components on a website or application.

The Collect endpoint is flexible and gives you the freedom to emit an event as long as the data layer has the required data. You can use it in standard server-side rendered websites, or in dynamic progressive web application (PWA) and single-page application (SPA) environments.

For instance, when a user opens a product detail page in a dynamic commerce application, you can emit a pageview hit before sending an event hit with the detail product action. On a standard website, you can track the same interactions with the Collect endpoint by emitting a single pageview hit with the detail product action.

EXAMPLE

A user accesses an SPA ecommerce website to find some shoes. A pageview hit is sent. The user searches for "red running shoes" and several results are returned. This sends an event hit with the impression product action. The user clicks on a pair that they like, which sends an event hit with the click product action.

After the click, the user is redirected to a page which provides detailed product information. A new pageview hit with the detail product action is sent.

After taking a closer look at the shoes and reading some of the reviews on the product page, the user decides that this is the right pair for them. They click the Add to Cart button, which sends an event hit with the add product action.

How Do I Start?

Check out the Collect endpoint reference documentation.


1. The Collect endpoint is a custom implementation and extension of the Google Measurement Protocol.
Recommended Articles