Validate that an interface is machine learning ready
Validate that an interface is machine learning ready
This is for:
DeveloperThe default Coveo-powered search pages are already configured to leverage Coveo Machine Learning (Coveo ML). 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.
This article explains how to confirm that your page is pushing Coveo Usage Analytics (Coveo UA) 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 according to the search hubs and tabs (see Ensure that search hubs are implemented). This means that if your search hub or tab values don’t correspond between your queries and your usage analytics events, 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 if you want to ensure that Coveo ML returns the most relevant results.
Search API value | Analytics API value |
---|---|
|
|
|
|
|
|
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 avisitorId
value. -
Select the event, and in the Payload section, scroll to the Request Payload section.
-
In the Request Payload, note the
originLevel1
,originLevel2
, andcustomData
values, for reference in later steps.
If your search events aren’t sent, you need to add the CoveoAnalytics
component on your page.
This component is typically added before the main section of your interface, as such:
<div class="CoveoAnalytics"></div>
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 avisitorId
value. -
Select the event, and in the Payload section, scroll to the Request Payload section.
-
Ensure that the
originLevel1
,originLevel2
, andcustomData
values are the same for the click event as they were for the search event.
If you don’t have click events, you need to add the CoveoResultLink
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) of the Coveo JavaScript Search Framework, 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 tohttps://platform.cloud.coveo.com/rest/v2
. -
In the event, confirm that the
searchHub
,tab
, andcontext
values are the same as theoriginLevel1
,originLevel2
, andcustomData
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 as an option in your Analytics component or hardcode it in your search token.
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 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 yourCoveoSearchbox
component is set to true.You may also want to confirm that you can see
querySuggest
events in 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 in your organization.
To learn how to test Coveo ML QS, see Prerequisites and 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) model to ensure that it’s properly configured.
To learn how to configure and test ART, see Create an Automatic Relevance Tuning model and 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) and Test your CR model.
-
To learn how to configure and test Dynamic Navigation Experience, see Deploy Dynamic Navigation Experience (DNE) and Test your DNE model.