Coveo User Context
Coveo User Context
Legacy feature
This article pertains to the Coveo Hive framework which is now in maintenance mode. Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details. |
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 and query suggestions.
Usage notes
-
For further details regarding the combined use of the Coveo User Context and Coveo Page View Analytics 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 content recommendations are only available with the Enterprise Cloud edition.
Insertion location
Coveo Hive
The Coveo User Context rendering is an Allowed Control in the following placeholder(s): UI Resources
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.
Data source options
The following table lists the available data source options for this rendering.
Option name | Description |
---|---|
Use anonymity in context |
Specifies whether to add an |
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 |
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: