Validate That an Interface Is Machine Learning Ready
Validate That an Interface Is Machine Learning Ready
The default Coveo-powered search pages are already properly 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.
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 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 Coveo ML returns the most relevant results.
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 Are 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 (see Coveo Analytics Component).
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 check box, to ensure that the click event stays when changing pages.
-
In your search interface, click on 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 (see Coveo ResultLink Component). 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 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 is going to consider the query and analytics events as unrelated, usually preventing Coveo ML rules from applying.
You must also ensure that there’s always a searchHub
value, otherwise Coveo ML isn’t able to learn from your events. You can add a search hub as an option in your Analytics component (see Coveo Analytics Component - searchHub), or hardcode it in your search token (see Search Token Authentication).
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 (QS) 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 suggestions model in your query pipeline
To do so, follow the steps on how to add a QS model in your organization (see Create a Query Suggestion Model).
To learn how to test Coveo ML QS, see Prerequisites and Testing Query Suggestions (QS).
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 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 Testing ART Models.
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 Recommendations, see Coveo Machine Learning Content Recommendations Deployment Overview and Testing Content Recommendations (CR).
-
To learn how to configure and test Dynamic Navigation Experience, see Deploy Dynamic Navigation Experience and Testing Dynamic Navigation Experience (DNE).