--- title: Track usage analytics slug: ncd90215 canonical_url: https://docs.coveo.com/en/ncd90215/ collection: build-a-search-ui source_format: adoc --- # Track usage analytics To create reports and power [Coveo Machine Learning](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/), it's crucial to track user interactions within your [search interfaces](https://docs.coveo.com/en/2741/). You can do this by sending events to the [Coveo Analytics](https://docs.coveo.com/en/182/) service. We recommend using [Coveo Atomic](https://docs.coveo.com/en/lcdf0264/) or [Coveo Headless](https://docs.coveo.com/en/lcdf0493/). When properly configured, these libraries automatically log many relevant events. If your implementation doesn't use the recommended UI libraries or needs to send events not captured by them, you can use either the _Event Protocol_ or _Coveo UA Protocol_. The following table summarizes the two protocols, the front-end libraries that you can use to send events, and the underlying APIs to which the events are sent. > **Important** > > By default, Coveo search UI libraries log usage analytics events even when end users reject cookies. > You must implement a mechanism to prevent logging events when end users reject cookies. > Not doing so pollutes your usage analytics data and affects [data health](https://docs.coveo.com/en/m44f6381/). [%header,cols="4"] |=== | |Name |Tracking library |Underlying API |**New** |[Event Protocol](#event-protocol) |[Relay](#relay) |[Event API](https://docs.coveo.com/en/n9da0377/) |**Legacy** |[Coveo UA Protocol](#coveo-ua-protocol) |[`coveoua`](#coveo-ua-library-coveoua) |[Usage Analytics Write API](https://docs.coveo.com/en/1430/) |=== ## Event Protocol > **Important** > > The [Event Protocol](https://docs.coveo.com/en/o9je0592/) and [Coveo Relay library](https://docs.coveo.com/en/o9je0322/) are generally available for Commerce. > > However, they're in closed beta for Coveo for Service, Website, and Workplace implementations. > If you're interested in using the Event Protocol and Relay library for these implementations, contact your customer success manager (CSM). Event Protocol is a new standard for sending analytics [events](https://docs.coveo.com/en/260/) to Coveo. It simplifies event tracking by reducing the number of events sent to Coveo. For instance, you no longer need to send any `search` events as they're logged server-side when you make a request to the Search API. The protocol also streamlines the event payload, requiring fewer fields. Such streamlining results in a more efficient and less error-prone event tracking process, yielding better [machine learning](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/) and [Coveo Analytics reports](https://docs.coveo.com/en/266/). Event Protocol uses event schemas that define the fields you must send for each event type. For more details on the schemas and the fields they require, see the [Event API](https://docs.coveo.com/en/n9da0377/) reference page. The latest versions of the Coveo's search UI libraries already use the Event Protocol to send events unless specified otherwise. ### Relay [Relay](https://docs.coveo.com/en/relay/latest/) is the new tracking library for sending events using Event Protocol. Relay not only provides all the benefits of the protocol, it's also lighter than the previous `coveoua` library. Additionally, Relay seamlessly integrates with the [Explorer](https://docs.coveo.com/en/ncd95257/) Chrome extension. When activated, [Coveo Explorer](https://docs.coveo.com/en/o9je0523/) will validate sent events in real time, providing feedback on the analytics implementation. ## Coveo UA Protocol The Coveo UA Protocol is the original protocol used to send events to Coveo. Compared to the Event protocol, the Coveo UA Protocol is more verbose and requires more client-side tracking. ### Coveo UA library (`coveoua`) [`coveoua`](https://docs.coveo.com/en/1818/) is the legacy tracking library, designed to send events to the [Usage Analytics Write API](https://docs.coveo.com/en/1430/).