--- title: Validate that an interface is machine learning ready slug: '2984' canonical_url: https://docs.coveo.com/en/2984/ collection: javascript-search-framework source_format: adoc --- # Validate that an interface is machine learning ready The default Coveo-powered search pages are already configured to leverage [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/). However, during development, you may have changed the way the page behaves, and want to confirm that Coveo ML is properly configured for your [search interface](https://docs.coveo.com/en/2741/). This article explains how to confirm that your page is pushing [Coveo Analytics](https://docs.coveo.com/en/182/) data that can be leveraged by Coveo ML. > **Note** > > This page assumes that you're using the Google Chrome browser. > Some steps might need to be adapted when using other browsers. ## Concepts to understand Coveo ML separates its [models](https://docs.coveo.com/en/1012/) according to the [search hubs](https://docs.coveo.com/en/1342/) and [tabs](https://docs.coveo.com/en/1343/) (see [Ensure that search hubs are implemented](https://docs.coveo.com/en/mc2g0331/)). This means that if your search hub or tab values don't correspond between your [queries and your usage analytics events](#ensure-that-query-and-analytics-events-are-properly-configured), Coveo ML won't be able to suggest relevant content. The following table shows the equivalence of each relevant value between the Search API and Analytics API values. Ensure that your Search API and Analytics API requests share the same values for each of the following parameters to ensure that Coveo ML returns the most relevant results. [%header,cols="2"] |=== |Search API value |Analytics API value |`searchHub` |`originLevel1` |`tab` |`originLevel2` |`context` |`customData` |=== ## Ensure that query and analytics events are properly configured To confirm that you're properly tracking everything, ensure that your query, search, and click events are all configured the same way. ### Ensure that you're tracking search events . Access your search interface. . Open the Developer Console of your browser and select the **Network** tab. . In your search interface, perform a search. . In the Developer Console, confirm that you can see a search analytics event performed. It should appear as `searches` in the console, performed to `/v15/analytics/searches`, sometimes followed by a `[visitorId](https://docs.coveo.com/en/273/)` value. . Select the event, and in the **Payload** section, scroll to the **Request Payload** section. . In the **Request Payload**, note the `originLevel1`, `originLevel2`, and `customData` values, for reference in later steps. If your search events aren't sent, add the [`CoveoAnalytics`](https://coveo.github.io/search-ui/components/analytics.html) component on your page. This component is typically added before the main section of your interface, as such: ```html
``` ### Ensure that you're tracking click events . Access your search interface. . Open the Developer Console of your browser and select the **Network** tab. . Check the **Preserve Log** checkbox to ensure that the click event stays when changing pages. . In your search interface, click a result. . In the Developer Console, confirm that you can see a click event performed. It should appear as `click` in the console, performed to `/v15/analytics/click`, sometimes followed by a `visitorId` value. . Select the event, and in the **Payload** section, scroll to the **Request Payload** section. . Ensure that the `originLevel1`, `originLevel2`, and `customData` values are the same for the click event as they were for the search event. If you don't have click events, add the [`CoveoResultLink`](https://coveo.github.io/search-ui/components/resultlink.html) component back in all of your result templates. This component takes care of handling the click events for you, and shouldn't be removed from result templates. Since the [September 2019 release (v2.7023)](https://docs.coveo.com/en/3277#september-2019-release-v27023) of the [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/), not including the `CoveoResultLink` component in your templates triggers an error in your browser console. ### Ensure that your queries share the same parameter options as your analytics . Access your search interface. . Open the Developer Console of your browser and select the **Network** tab. . In your search interface, perform a search. . In the Developer Console, open the query event. It should appear as `v2`, and be performed to `+https://platform.cloud.coveo.com/rest/v2+`. . In the event, confirm that the `searchHub`, `tab`, and `context` values are the same as the `originLevel1`, `originLevel2`, and `customData` values (respectively) from your analytics requests. If the `searchHub`/`originLevel1` or `tab`/`originLevel2` values are different, Coveo ML will consider the query and analytics events to be unrelated. This will usually prevent Coveo ML rules from applying. You must also ensure that there's always a `searchHub` value, or Coveo ML won't be able to learn from your events. You can [add a search hub](https://coveo.github.io/search-ui/components/analytics.html#options.searchhub) as an option in your Analytics component or hardcode it in your [search token](https://docs.coveo.com/en/56/). ## Ensure that query suggestions are properly configured Now that you have confirmed that your query and analytics events are properly sent, you're ready to start verifying that Coveo ML [query suggestions](https://docs.coveo.com/en/1015/) are properly configured in your page. * **Ensure that you have enabled query suggestions on your search box** To do so, confirm that the `data-enable-query-suggest-addon` attribute of your `CoveoSearchbox` component is set to true. You may also want to confirm that you can see `querySuggest` events on the **Network** tab of your browser console when typing in the search box. * **Ensure that you have a Query Suggestion (QS) model in your query pipeline** To do so, follow the steps on how to [add a QS model](https://docs.coveo.com/en/3398/) in your organization. To learn how to test Coveo ML QS, see [Prerequisites](https://docs.coveo.com/en/3398#prerequisites) and [Test your QS model](https://docs.coveo.com/en/mc2g0297#test-your-qs-model). ## Ensure that Coveo ML Automatic Relevance Tuning (ART) is properly configured Now that you have confirmed that your query and analytics events are properly sent, you're ready to start testing your Coveo ML [Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/1013/) model to ensure that it's properly configured. To learn how to configure and test ART, see [Create an Automatic Relevance Tuning model](https://docs.coveo.com/en/3397/) and [Test your ART model](https://docs.coveo.com/en/mc2g0297#test-your-art-model). ## Ensure that other Coveo ML features are properly configured For other Coveo ML models, configuring Coveo ML and confirming events can be different. * To learn how to configure and test Content Recommendations, see [Deploy Content Recommendations (CR)](https://docs.coveo.com/en/1886/) and [Test your CR model](https://docs.coveo.com/en/mc2g0297#test-your-cr-model). * To learn how to configure and test Dynamic Navigation Experience, see [Deploy Dynamic Navigation Experience (DNE)](https://docs.coveo.com/en/2918/) and [Test your DNE model](https://docs.coveo.com/en/mc2g0297#test-your-dne-model).