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) Content Recommendations (CR) and Query Suggestions (QS).

Usage Notes

Insertion Location

Coveo Hive

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

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
What's next for me?