Interface UpdateAnalyticsConfigurationActionCreatorPayload

interface UpdateAnalyticsConfigurationActionCreatorPayload {
    analyticsMode?: "legacy" | "next";
    anonymous?: boolean;
    deviceId?: string;
    documentLocation?: string;
    enabled?: boolean;
    originContext?: string;
    originLevel2?: string;
    originLevel3?: string;
    proxyBaseUrl?: string;
    runtimeEnvironment?: IRuntimeEnvironment;
    source?: Partial<Record<"@coveo/atomic" | "@coveo/quantic", string>>;
    trackingId?: string;
    userDisplayName?: string;
}

Properties

analyticsMode?: "legacy" | "next"

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

Starting at V3.0, the default value will be next.

'legacy'
anonymous?: boolean

Whether 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

deviceId?: string

The name of the device that the end user is using. It should be explicitly configured in the context of a native mobile app.

documentLocation?: string

Specifies the URL of the current page or component.

enabled?: boolean

Whether to enable usage analytics tracking.

originContext?: string

Sets the Origin Context dimension on the analytic events.

You can use this dimension to specify the context of your application. Suggested values are "Search", "InternalSearch" and "CommunitySearch"

originLevel2?: string

The origin level 2 usage analytics event metadata whose value should typically be the identifier of the tab from which the usage analytics event originates (e.g., All).

originLevel3?: string

The origin level 3 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 (e.g., https://connect.coveo.com/s/).

proxyBaseUrl?: string

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

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:

runtimeEnvironment?: IRuntimeEnvironment

The Coveo analytics runtime to use, see https://github.com/coveo/coveo.analytics.js for more info.

source?: Partial<Record<"@coveo/atomic" | "@coveo/quantic", string>>

Specifies the frameworks and version used around Headless (e.g. @coveo/atomic).

trackingId?: string

The unique identifier of the tracking target.

userDisplayName?: string

Specifies the user display name for the usage analytics logs.