Optional
analyticsanalyticsClientMiddleware allows to hook into an analytics event payload before it is sent to the Coveo platform.
Optional
analyticsThe analytics client to use.
legacy
: The legacy analytics client, i.e., the Coveo Analytics.js library.next
: The next analytics client, i.e., the Coveo Event Protocol with the Relay library.The default value is next
.
Optional
anonymousWhether analytics events should be logged anonymously. If set to true, the Usage Analytics Write API will not extract the name and userDisplayName, if present, from the search token
Optional
deviceThe name of the device that the end user is using. It should be explicitly configured in the context of a native mobile app.
Optional
documentSpecifies the URL of the current page or component.
Optional
enabledSpecifies if usage analytics tracking should be enabled.
By default, all analytics events will be logged.
Optional
originSets the Origin Context dimension on the analytics events.
You can use this dimension to specify the context of your application. The possible values are "Search", "InternalSearch", and "CommunitySearch".
The default value is Search
.
Optional
originSets the value of the Origin Level 2 dimension on the analytics events.
Origin level 2 is a usage analytics event metadata whose value should typically be the name/identifier of the tab from which the usage analytics event originates.
In the context of product listing, the value should match the breadcrumb of the product listing page from which the usage analytics event originates (for example, canoes-kayaks/kayaks/sea-kayaks
).
When logging a usage analytics event, originLevel2 should always be set to the same value as the corresponding tab
(parameter) Search API query parameter so Coveo Machine Learning models function properly, and usage analytics reports and dashboards are coherent.
If left unspecified, this value will automatically try to resolve itself from the tab
Search API query parameter.
Optional
originOrigin level 3 is a usage analytics event metadata whose value should typically be the URL of the page that linked to the search interface that’s making the request.
When logging a Search usage analytics event, originLevel3 should always be set to the same value as the corresponding referrer Search API query parameter so usage analytics reports and dashboards are coherent.
This value is optional, and will automatically try to resolve itself from the referrer search parameter.
Optional
proxyThe base URL to use to proxy Coveo analytics requests (e.g., https://example.com/analytics
).
This is an advanced option that you should only set if you need to proxy Coveo analytics requests through your own server. In most cases, you should not set this option.
By default, no proxy is used and the Coveo analytics requests are sent directly to the Coveo platform through the
analytics organization endpoint resolved from the organizationId
and
environment
values provided in your engine configuration (i.e.,
https://<organizationId>.analytics.org.coveo.com
or
https://<organizationId>.analytics.org<environment>.coveo.com
, if the environment
values is specified and
different from prod
).
If you set this option, you must also implement the correct proxy endpoints on your server, depending on the
analyticsMode
you are using.
If you are using the next
analytics mode, you must implement the following proxy endpoints:
POST
/
to proxy requests to POST https://<organizationId>.analytics.org<environment|>.coveo.com/rest/organizations/{organizationId}/events/v1
POST
/validate
to proxy requests to POST https://<organizationId>.analytics.org<environment|>.coveo.com/rest/organizations/{organizationId}/events/v1/validate
The Event Protocol Reference provides documentation on the analytics event schemas that can be passed as request bodies to the above endpoints.
If your are using the legacy
analytics mode, your proxyBaseUrl
must end with /rest/v15/analytics
, and you must implement the following proxy endpoints:
POST
/click
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/click
POST
/collect
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/collect
POST
/custom
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/custom
GET
/monitoring/health
to proxy requests to GET
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/monitoring/health
POST
/search
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/search
POST
/searches
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/searches
GET
/status
to proxy requests to GET
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/status
POST
/view
to proxy requests to POST
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/view
DELETE
/visit
to proxy requests to DELETE
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/visit
GET
/visit
to proxy requests to GET
https://<organizationId>.analytics.org<environment|>.coveo.com/rest/v15/analytics/visit
Optional
runtimeOptional analytics runtime environment, this is needed for analytics to work correctly if you're running outside of a browser. See https://github.com/coveo/coveo.analytics.js for more info.
Optional
Internal
sourceSpecifies the frameworks and version used around Headless (e.g. @coveo/atomic).
Optional
trackingThe unique identifier of the tracking target.
Optional
userSpecifies the user display name for the usage analytics logs.
The analytics configuration options.