Coveo ML provides a way to analyze the visits on your website to recommend content relevant to the user’s current visit history. The required data is collected each time a user visits a page containing the Page View Analytics component. This data is tracked anonymously and does not use any personal information, apart from the current visit page history.
What to Expect From the Recommendations
Recommendations are based on your visitors visits: the more visitors you have, the better the recommendations are. Once Coveo ML has gathered enough data, it generates a model that is then used to return recommendations relevant to the current user by comparing their navigation pattern with similar users patterns (see Coveo Machine Learning Recommendations Deployment Overview).
Follow these steps to enable recommendations on your website.
Step 1 - Configure the Page View Analytics Component
To get recommendations, you must first set up the Coveo Page View Analytics component, which gathers the required information (see Logging Page View Events).
Step 2 - Create a Pipeline for Recommendations
Create a new pipeline from the Coveo Cloud administration console. You need a different pipeline for your recommendations, as the model changes the default query behavior (see Creating and Managing Query Pipelines).
Step 3 - Create a Model in Your Pipeline
In your Recommendations pipeline, add a new Coveo ML recommendations model. It should take at least an hour to create, depending on the volume of data previously logged (see Managing Coveo Machine Learning Recommendations in a Query Pipeline).
Step 4 - Configure your Sitecore instance
<Sitecore Instance>\Website\App_Config\Include\Coveo, and create a file named
Coveo.SearchProvider.Recommendations.Custom.config file, and add the following code:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <coveo> <defaultIndexConfiguration type="Coveo.AbstractLayer.CoveoDefaultIndexConfiguration, Coveo.AbstractLayer"> <serverUrl>http://YOUR_PUBLIC_SERVER_URL</serverUrl> </defaultIndexConfiguration> </coveo> </sitecore> </configuration>
YOUR_PUBLIC_SERVER_URL with your public server URL.
For instance, if your main page is
Step 5 - Ensure the URL Is Correctly Configured
You can validate if your item has the correct server URL in the Content Browser of the Coveo Administration Console.
- Access the Coveo Cloud Platform, and under Content, select Content Browser.
- Select your filters to show your Sitecore source only.
- Take a look at any item properties by clicking the item, and then click the Properties button.
URIfield value should start with the server URL configured in the configuration files.
Step 6 - Insert the Coveo Recommendations Component
Coveo for Sitecore Hive UI Framework.
The Coveo Hive Recommendation component (see Coveo Recommendations) is a Sitecore presentation item which can be added in any placeholders. Once added, it will create several placeholders which you can use to add a result list, result templates, query filters and much more.
The datasources item of the Recommendation component requires a Recommendation pipeline, simply use the one created before.
Coveo for Sitecore Legacy UI Framework.
Add the Coveo Recommendations Component to the page you wish (see Inserting and Customizing a Recommendations Component). Configure the Recommendations Pipeline property with the name of the pipeline created earlier.
Step 7 - Publish the Items
Publish your items to your website as the Page View events are only logged when navigating in the published website.
Step 8 - Validate Recommendations
Navigate to the website using the exact URL configured in the Sitecore configuration (see Step 5). If you have enough analytics data, you should see the recommendations on your page.
The following section lists some of the common reasons why no recommendations are displayed in the Coveo Recommendations component.
Not Getting Recommendations in the Experience Editor
Since analytics are disabled in the master database, there are no Page View events logged in the Coveo Analytics service. The recommendations should only appear on the published website.
Not Enough Data
Coveo Recommendations uses Page View events to recommend pages to the user. If you do not have any of those events logged in Coveo Analytics, no recommendations can be returned.
First Visit to a Page
Coveo Recommendations cannot find any pattern when landing on the first page. It is expected that the first page of a visit does not return any recommendations.
The URL Is Invalid
Coveo Recommendations uses the
URI field from the items, meaning
http://www.mysite.com/en/myproduct is not the same as
http://www.mysite.com/myproduct, and should give different recommendations.
The Page View Analytics Component Is Not Correctly Configured
Ensure that you configured the Page View component in all the pages you want the recommendations section to feature.
Include the component in the header of your main layout, so it appears by default in all pages (see Logging Page View Events).
If you have a Coveo for Sitecore older than October 2016 (4.0.704), step one of Logging Page View Events is mandatory.
Legacy UI Framework Only - The Page with the Recommendations Does Not Contain the Page View Analytics Component
The Page View Analytics component must load before the Coveo Recommendations component.
To change the order:
- in the Sitecore Content Editor, select your item.
- In the Presentation tab, click Details:
- In the Shared Layout tab, under Default, click Edit.
- Click the Controls tab.
- Locate the Coveo Page View Analytics component and move it up, before the Coveo Recommendations component.
- Click OK.
- Click OK.
- Click Save and publish your changes.