Coveo Machine Learning Event Recommendations Deployment Overview
The Coveo™ Machine Learning (Coveo ML) event recommendations are based on recorded user navigation history such as user search activities as well as page views on your websites (see Event Recommendations Feature).
The more navigation data, the better the recommendations. You should therefore start pushing search and page view events to the Coveo usage analytics service as soon as possible from your websites for which you want to be able to propose recommendations.
In a technical documentation site, you can add a Recommended Topics list to complement the table of content and suggest topics most often visited by other users with similar search and navigation sessions.
To deploy Coveo Machine Learning Event Recommendations
Before starting the following procedure, be aware that deploying Coveo ML Event Recommendations requires developer skills.
Optionally, plan the content type to recommend:
Optionally, plan the usage of custom contexts to improve recommendation relevance:
Using appropriate custom context can take recommendation relevance one step further.
You can define custom contexts that are relevant to your business and then pass appropriate ones along with usage analytics events and queries to allow Coveo ML recommendations to take them into account (see Leveraging Custom Contexts in Coveo Machine Learning Features).
Get an API key:
You need API keys for two independent processes:
Allow code in one or more websites to push usage analytics page view events that will feed the recommendation model (see Push website page view events.).
Allow your Recommendation component to send queries and receive search results as well as send analytics events (so you can track the component usage) (see Initializing a Recommendation Component).
When the search or website page in which you include the Recommendation component requires user authentication to be able to return secured results, you must use a search token that is generated for each user to initialize the component.
A developer must set up a server-side mechanism to generate the search tokens using an API key that also carries the Search - Impersonate privilege (see Search Token Authentication).
You can typically share the same API key or search token when both the page view event push code and the Recommendation component are both included in the same page.
Create an API key with the following privileges (see Add an API Key):
For the Analytics data privilege, select the Edit checkbox.
For the Execute queries privilege, select the Enable checkbox.
An API key with privileges limited to the ones mentioned above can safely be included in client-side code, but you must ensure that the API key does not carry other sensitive privileges (see Privileges).
Push events to the usage analytics service:
Push website page view events.
Start pushing page view events to the Coveo usage analytics service as soon as possible from as many relevant sites as possible by adding the
coveo.analytics.jscode snippet to all pages of each of you websites (see Coveo Machine Learning Recommendations Complete Code Sample).
coveo.analytics.jscode also takes care of recording the session navigation history in the
__coveo.analytics.historybrowser cookie. The recommendation model needs this session navigation history to determine relevant content to return.
Push search events.
The Coveo ML Recommendation service also takes into account queries made by users in your Coveo search page(s). If not already done, ensure your Coveo products push search events to your Coveo Cloud organization (see Getting Started With Coveo Usage Analytics).
Create a Coveo ML Event Recommendation model in a dedicated query pipeline.
Do not add a Recommendation model in the Default pipeline. Otherwise, the Content Browser and any other search interface using the Default pipeline will break.
Use a dedicated query pipeline for your Event Recommendation model to ensure that other search optimization features such as the Automatic Relevance Tuning (ART) or Ranking Expressions do not interfere with the Event Recommendations model results.
When you want to propose more than one type of recommendations, create one Event Recommendations model for each content type to recommend, each with its dedicated pipeline.
In the Coveo Cloud administration console, create a new pipeline that will contain only one Event Recommendations model (see Managing Query Pipelines).
Note the name of your pipeline. You will need it when you integrate a Recommendation component in a web page (see Coveo Machine Learning Recommendations Complete Code Sample).
In your new pipeline, create a Recommendation model for the type of recommendations that you want to include in your pages (see Managing Coveo Machine Learning Event Recommendations Models in a Query Pipeline).
Include the recommendation results in your web pages.
Recommendationcomponent that you can easily add into your website pages to create one or more recommendation sections (see Coveo Machine Learning Recommendations Complete Code Sample).