Get Content Recommendations

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 doesn’t use any personal information, apart from the current visit page history.

What to expect from Content Recommendations

content 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’s then used to return recommendations relevant to the current user by comparing their navigation pattern with similar users patterns (see Deploy Content Recommendations (CR)).

Getting Content Recommendations

Follow these steps to enable content recommendations on your website.

Step 1: Configure the Coveo Page View Analytics rendering

To get content recommendations, you must first set up the Coveo Page View Analytics rendering, which gathers the required information (see Log view events).

Step 2: Create a query pipeline for recommendations

Create a query pipeline from the Coveo Administration Console. You need a dedicated pipeline for your content recommendations, as the model changes the default query behavior.

Step 3: Create a Content Recommendation model

Create a Coveo ML Content Recommendation (CR) model and associate it with your query pipeline. The model should take at least an hour to create, depending on the volume of data previously logged.

Step 4: Configure your Sitecore instance

Navigate to <SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveo, and create a file named Coveo.SearchProvider.Recommendations.Custom.config file, and add the following code:

Coveo.SearchProvider.Recommendations.Custom.config

<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>

Replace YOUR_PUBLIC_SERVER_URL with your public (client facing) server URL.

For example, if your main page is http://www.mysite.com/en/myPage/, enter http://www.mysite.com.

Step 5: Ensure that 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.

  1. Log in to Coveo (platform-ca | platform-eu | platform-au), and under Content, select Content Browser.

  2. Select your filters to show your Sitecore source only.

  3. Take a look at any item properties by clicking the item, and then click Properties.

  4. The URI field value should start with the server URL configured in the configuration files.

Step 6: Insert the Coveo Recommendations rendering

The Coveo Recommendations rendering is a Sitecore presentation item which can be added within a Coveo Search Interface, or in any placeholder for use as a standalone search interface. Once added, the Coveo Recommendations rendering creates several placeholders which you can use to add a result list, result templates, query filters and much more.

The data source item of the Coveo Recommendations rendering requires a Query pipeline. Use the one created earlier. When used inside a Coveo Search Interface, use the Coveo Recommendations data source Main search interface droplink field to select the search interface to bind the Coveo Recommendations to. When you bind the Coveo Recommendations to a search interface this way, the recommendations inherit the Sitecore Instance Filter configurations specified in the Main search interface data source. If you use a Coveo Recommendations rendering in your article pages and don’t bind it to a Main search interface, you can edit the Coveo Recommendations data source to apply filtering based on the Sitecore context and add the Query Filter rendering in the Recommendations Components placeholder for further filtering.

Step 7: Publish the items

Publish your items to your website as the 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.

Example recommendations | Coveo for Sitecore 5

Troubleshooting

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 view events logged in the Coveo Analytics service. The recommendations should only appear on the published website.

Not enough data

Coveo Recommendations uses view events to recommend pages to the user. If you don’t have any of those events logged in Coveo Analytics, no recommendations can be returned.

First visit to a page

Coveo Recommendations can’t find any pattern when landing on the first page. It’s expected that the first page of a visit doesn’t return any recommendations.

The URL is invalid

Coveo Recommendations uses the URI field from the items, meaning http://www.mysite.com/en/myproduct isn’t the same as http://www.mysite.com/myproduct, and should give different recommendations.

The Coveo Page View Analytics rendering isn’t correctly configured

Ensure that you configured the Coveo Page View Analytics rendering in all the pages you want the recommendations section to appear.

Tip
Leading practice

Include the component in the header of your main layout, so it appears by default in all pages (see Log view events).