Coveo User Context

Coveo for Sitecore Specific Rendering Allows adding user context to page view analytics in Sitecore article items. In search interfaces, it adds user context to Search API and query suggestion calls.

User context refines search results as well as Coveo Machine Learning (Coveo ML) recommendations and query suggestions.

Usage Notes

  • For further details regarding the combined use of the Coveo User Context and Coveo Page View renderings to add user context in your Sitecore article items, see Leverage User Context for Coveo Machine Learning.

  • To have the Coveo User Context rendering provide the visitor current country in the user context, you need to insert a position provider rendering in your page.

  • Coveo ML-powered recommendations are only available with the Enterprise Cloud edition.

Insertion Location

The Coveo User Context rendering is an Allowed Control in the following placeholder(s): UI Resources

Example insertion sequence for the Coveo User Context rendering.

Coveo for Sitecore SXA rendering insertion locations are not limited by placeholder Allowed Controls. The Coveo User Context rendering may therefore be inserted throughout the partial design, whether in Coveo for Sitecore or Sitecore placeholders.

Example insertion sequence for the Coveo User Context rendering.

Data Source Options

Option name Description
Use anonymity in context Specifies whether to add an isAnonymous key and its value to the user context, indicating whether the user is anonymous.
Use country in context Specifies whether to add the visitor current country to the user context.
Use device in context Specifies whether to add the visitor current device to the user context.
Use profile cards in context Used to specify the profile cards you want to add to the user context.
Enable context pipeline Specifies whether to run the coveoUserContext pipeline when computing the context (see UserContextPipeline).
Custom context Static key and value pairs to add to the user context.
DOM unique Id Randomly generated HTML element id.

Sample Generated HTML and Corresponding Output

In the following example, you have inserted the Coveo User Context rendering in a search page and enabled the Use anonymity in context, Use country in context and Use device in context data source options.

A logged New Zealander visits your search page.

Generated HTML:

<script type="text/javascript" src="/Coveo/Hive/js/CoveoForSitecoreUserContext.js"></script>
<script>
    if (!!window.CoveoForSitecoreUserContext) {
        CoveoForSitecoreUserContext.handler.initializeContext({"device":"Default",
        "isAnonymous":"false","country":"NZ"});
    }
</script>

Generated query suggestion call:

Query Suggestions call with user context

Recommended Articles