Usage Analytics Write API (v1)

Analytics API - Version 14

Adds a click event via POST Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8
cookie Parameters
visitor
string
Deprecated

The unique identifier of the visitor. If not provided, a new identifier will be created and returned as a HTTP cookie.

Request Body schema: application/json
required

The click event to add.

actionCause
required
string

The type of operation that triggered this event. Example: 'firstSearch', 'searchEnter'

collectionName
required
string

The @syscollection of the document that was clicked

documentPosition
required
integer <int32>

The position of the document (one-based) that was clicked in the list of resultsThis number must take into consideration pagination settings. If the pages contain ten results each, the third document of the second page is at the position 22.

documentUriHash
required
string

The @sysurihash of the document that was clicked

language
required
string

The language that end user is using. Use ISO 639-1 codes. See ISO 639-1 for more information

originLevel1
required
string

The origin this event took place

originLevel2
required
string

The origin this event took place

searchQueryUid
required
string

The searchQueryUid of the search that returned the document that was clicked. This must be a valid searchQueryUid that contains the provided documentUri and documentUriHash.

sourceName
required
string

The @syssource of the document that was clicked

anonymous
boolean

Indicates if the user is anonymous.

object

Custom data that can contain all the user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Spaces in the key are converted to underscores. Uppercase characters in the key are converted to lowercase characters. It is highly recommended that you create your custom dimension before adding customData

device
string
Deprecated

The name of the device that the end user is using

documentTitle
string

The title of the document that was clicked.

documentUri
string
Deprecated

The @sysuri of the document that was clicked

documentUrl
string

The URL of the document that was clicked.

mobile
boolean
Deprecated

Whether the end user's device is a mobile device or not

originLevel3
string

The origin this event took place

queryPipeline
string

The query pipeline of the search that returned the document that was clicked.

rankingModifier
string

The ranking modifier that affected the clicked document.

splitTestRunName
string

The name of the A/B test run, if one is active.

splitTestRunVersion
string

The version of the A/B test run, if one is active.

userAgent
string

The user agent string of the end user's browser. See User Agent for more information.

userDisplayName
string

The display name of the user performing the search event.

username
string

The unique identifier of the user performing the search event. If not provided, the username will be extracted from the token.

Responses

Request samples

Content type
application/json
{
  • "actionCause": "string",
  • "anonymous": true,
  • "collectionName": "string",
  • "customData": {
    },
  • "device": "string",
  • "documentPosition": 0,
  • "documentTitle": "string",
  • "documentUri": "string",
  • "documentUriHash": "string",
  • "documentUrl": "string",
  • "language": "string",
  • "mobile": true,
  • "originLevel1": "string",
  • "originLevel2": "string",
  • "originLevel3": "string",
  • "queryPipeline": "string",
  • "rankingModifier": "string",
  • "searchQueryUid": "string",
  • "sourceName": "string",
  • "splitTestRunName": "string",
  • "splitTestRunVersion": "string",
  • "userAgent": "string",
  • "userDisplayName": "string",
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitId": "string",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Adds a custom event via POST Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8
cookie Parameters
visitor
string
Deprecated

The unique identifier of the visitor. If not provided, a new identifier will be created and returned as a HTTP cookie.

Request Body schema: application/json
required

The custom event to add.

eventType
required
string

The type of this event

eventValue
required
string

The type of operation that triggered this event

language
required
string

The language that end user is using. Use ISO 639-1 codes. See ISO 639-1 for more information

originLevel1
required
string

The origin this event took place

originLevel2
required
string

The origin this event took place

anonymous
boolean

Indicates if the user is anonymous.

object

Custom data that can contain all the user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Spaces in the key are converted to underscores. Uppercase characters in the key are converted to lowercase characters. It is highly recommended that you create your custom dimension before adding customData

device
string
Deprecated

The name of the device that the end user is using

lastSearchQueryUid
string

The searchQueryUid of the last search event that occurred before this event

mobile
boolean
Deprecated

Whether the end user's device is a mobile device or not

originLevel3
string

The origin this event took place

splitTestRunName
string

The name of the A/B test run, if one is active.

splitTestRunVersion
string

The version of the A/B test run, if one is active.

userAgent
string

The user agent string of the end user's browser. See User Agent for more information.

userDisplayName
string

The display name of the user performing the search event.

username
string

The unique identifier of the user performing the search event. If not provided, the username will be extracted from the token.

Responses

Request samples

Content type
application/json
{
  • "anonymous": true,
  • "customData": {
    },
  • "device": "string",
  • "eventType": "string",
  • "eventValue": "string",
  • "language": "string",
  • "lastSearchQueryUid": "string",
  • "mobile": true,
  • "originLevel1": "string",
  • "originLevel2": "string",
  • "originLevel3": "string",
  • "splitTestRunName": "string",
  • "splitTestRunVersion": "string",
  • "userAgent": "string",
  • "userDisplayName": "string",
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitId": "string",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Health check for the analytics service Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8

Responses

Response samples

Content type
application/json
{ }

Adds multiple search events via POST Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8
cookie Parameters
visitor
string
Deprecated

The unique identifier of the visitor. If not provided, a new identifier will be created and returned as a HTTP cookie.

Request Body schema: application/json
required

The search events to add. Please note that that the clientId from the first search event will be used to compute the visit.

Array
actionCause
required
string

The type of operation that triggered this event. Example: 'firstSearch', 'searchEnter'

contextual
required
boolean

Indicates if the query is modified by contextual filters (for instance, a query to find similar documents)

language
required
string

The language that end user is using. Use ISO 639-1 codes. See ISO 639-1 for more information

originLevel1
required
string

The origin this event took place

originLevel2
required
string

The origin this event took place

queryText
required
string

The text that was searched

responseTime
required
integer <int32>

The time, in milliseconds, between the moment the query was sent and the moment the results were received. Must be greater than zero

required
Array of objects (ResultModelV14)

The results of this search event

searchQueryUid
required
string

The unique identifier of the search event. Must be a UUID

advancedQuery
string

The advanced part of the query that was sent to the index. Usually this contains various query elements that were not manually added by the user.

anonymous
boolean

Indicates if the user is anonymous.

object

Custom data that can contain all the user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Spaces in the key are converted to underscores. Uppercase characters in the key are converted to lowercase characters. It is highly recommended that you create your custom dimension before adding customData

device
string
Deprecated

The name of the device that the end user is using

mobile
boolean
Deprecated

Whether the end user's device is a mobile device or not

numberOfResults
integer <int32>

The number of results found. Must be equal to or greater than zero

originLevel3
string

The origin this event took place

queryPipeline
string

The query pipeline of the search event.

splitTestRunName
string

The name of the A/B test run, if one is active.

splitTestRunVersion
string

The version of the A/B test run, if one is active.

userAgent
string

The user agent string of the end user's browser. See User Agent for more information.

userDisplayName
string

The display name of the user performing the search event.

userGroups
Array of strings

The groups that the end user performing the event is a member of

username
string

The unique identifier of the user performing the search event. If not provided, the username will be extracted from the token.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Gets the status of the analytics service Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8

Responses

Response samples

Content type
application/json
{ }

Clears all cookies associated with this API Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8

Responses

Get the user current visit informations Deprecated

This endpoint is deprecated and will be removed on October 1st, 2024.

Authorizations:
v8
query Parameters
user
string

The unique identifier of the user performing the search event. If not provided, the username will be extracted from the token.

cookie Parameters
visitor
string
Deprecated

The unique identifier of the visitor. If not provided, a new identifier will be created and returned as a HTTP cookie.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "visitorId": "string"
}

Analytics API - Version 15

Log click event via POST

Logs a click event. Typically, when the end-user opens or previews a result, the search interface logs a click event.

Authorizations:
v8
query Parameters
org
string

The name of the organization (Coveo Cloud V2 only)

prioritizeVisitorParameter
boolean
Deprecated
Default: false

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. Whether to force the service to use the provided visitor query string parameter, rather than automatically attempting to override this parameter with the visitor cookie.

visitor
string
Deprecated

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. The unique identifier of the visitor. Unless prioritizeVisitorParameter is set to true, the service automatically attempts to override this query string parameter with the visitor cookie. If no visitor parameter is provided and the visitor cookie is absent, a new identifier is created and returned as the visitorId property in the response body, and as a visitor cookie.

Request Body schema: application/json
required

The click event to add.

actionCause
required
string

The type of operation that triggered this event (see analyticsActionCauseList

documentPosition
required
integer <int32>

The 1-based index position of the item that was clicked in the result list. This number must take into consideration pagination settings. If the pages contain ten results each, the third item of the second page is at the position 23.

language
required
string

(Required, except when logging View events). The language of the end-user. Must be a valid ISO 639-1 code

searchQueryUid
required
string

The unique identifier of the event which led the search interface to log the click event. It is recommend to use the searchUid in the response of the corresponding search request to the Search API, or any UUID v4 of length less than or equal to 36 characters. UUIDs longer than 36 characters are truncated by the service. This must be a valid searchQueryUid for an event that contains the provided documentUri and documentUriHash.

sourceName
required
string

The @source of the item that was clicked

anonymous
boolean

Whether the interaction that caused the search interface to log the event was triggered by an anonymous user. If set to true, the Usage Analytics Write API will not extract the name and userDisplayName, if present, from the search token

clientId
string

A value that uniquely identifies the user who is logging the event. Must be a valid UUID.

collectionName
string

The @syscollection of the item that was clicked

object

The user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Whitespaces in keys are converted to underscores. Uppercase characters in keys are converted to lowercase characters. The value could be any valid JSON, but it is handled as string over Coveo usage analytics. It is highly recommended that you create your custom dimension before adding customData

documentAuthor
string

The author of the item that was clicked

documentCategory
string

The category of the clicked item

documentTitle
string

The title of the item that was clicked

documentUri
string
Deprecated

The @uri of the item that was clicked

documentUriHash
string
Deprecated

The @urihash of the item that was clicked. Deprecated, please use customData.contentIdValue instead.

documentUrl
string

The URL of the item that was clicked

originContext
string

The origin of the event. Used to specify the deployment from which the user performs the action. Suggested values are Search, InternalSearch, CommunitySearch, or the originLevel1 value

originLevel1
string

The name/identifier of the search interface from which the event originates. If unspecified and the request is authenticated with a search token, the service attempts to extract the searchHub value from the access token that authenticated the request

originLevel2
string

The name/identifier of the tab from which the event originates

originLevel3
string

The URL of the page that redirected the browser to the search interface from which the event originates, i.e. document.referrer

outcome
integer <int32>

An indication of how good the outcome of this event is. A value of -5 corresponds to the worst possible outcome, a value of 0 corresponds to a neutral outcome, and a value of 5 corresponds to the best possible outcome

queryPipeline
string

The name of the query pipeline which processed the query that led to the click event. When unspecified, the service uses the pipeline value set in the search token, if any

rankingModifier
string

The ranking modifier that affected the clicked item

splitTestRunName
string

The name of the A/B test run, if one is active. See Managing A/B Tests

splitTestRunVersion
string

The version of the A/B test run, if one is active

trackingId
string

A value to identify which web property an event is related to. This can only contain lowercase letters, numbers, and underscores (_).

userAgent
string

Information about the browser and operating system of the end-user who caused the search interface to log an event. See User Agent for more information

userDisplayName
string

The display name of the user performing the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the userdisplayName value from the access token that authenticated the request

username
string

The name of the user security identity who caused the search interface to log the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the username value from the access token that authenticated the request. If this fails, the username value is left blank. If unspecified and the request is authenticated with an API key, username is set to anonymous

Responses

Request samples

Content type
application/json
{
  • "actionCause": "documentOpen",
  • "anonymous": false,
  • "clientId": "489aa3e3-aed2-4563-8e81-62bb73178a56",
  • "collectionName": "Default",
  • "customData": {
    },
  • "documentAuthor": "John Doe",
  • "documentCategory": "KBSupport",
  • "documentPosition": 1,
  • "documentTitle": "Coveo for Salesforce",
  • "documentUriHash": "xyhvGJJGRDM3OiG5",
  • "language": "en",
  • "originContext": "CommunitySearch",
  • "originLevel1": "ExternalSearch",
  • "originLevel2": "all",
  • "outcome": 0,
  • "queryPipeline": "External Search",
  • "rankingModifier": "Reveal ART",
  • "searchQueryUid": "df60b2fb-c276-49ae-b704-2ee45609f3a6",
  • "sourceName": "AnswersCloud",
  • "splitTestRunName": "splitTest",
  • "splitTestRunVersion": "splitTestRunAlpha",
  • "trackingId": "online_store",
  • "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3249.481 Safari/537.36",
  • "userDisplayName": "Alice",
  • "username": "alice.smith@example.com"
}

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Collect GA-style events

Authorizations:
v8
Request Body schema: application/json
required
property name*
additional property
object

Responses

Request samples

Content type
application/json
{
  • "property1": { },
  • "property2": { }
}

Log custom event via POST

Logs a custom event. Typically, when the end-user interacts with a page in a way that needs to be recorded, but that is neither a search, a click, or a view event (e.g., toggling the result list layout, changing end-user preferences), the page logs a custom event.

Authorizations:
v8
query Parameters
org
string

The name of the organization (Coveo Cloud V2 only)

prioritizeVisitorParameter
boolean
Deprecated
Default: false

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. Whether to force the service to use the provided visitor query string parameter, rather than automatically attempting to override this parameter with the visitor cookie.

visitor
string
Deprecated

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. The unique identifier of the visitor. Unless prioritizeVisitorParameter is set to true, the service automatically attempts to override this query string parameter with the visitor cookie. If no visitor parameter is provided and the visitor cookie is absent, a new identifier is created and returned as the visitorId property in the response body, and as a visitor cookie.

Request Body schema: application/json
required

The custom event to add.

eventType
required
string

The custom event type

eventValue
required
string

The custom event value

language
required
string

(Required, except when logging View events). The language of the end-user. Must be a valid ISO 639-1 code

anonymous
boolean

Whether the interaction that caused the search interface to log the event was triggered by an anonymous user. If set to true, the Usage Analytics Write API will not extract the name and userDisplayName, if present, from the search token

clientId
string

A value that uniquely identifies the user who is logging the event. Must be a valid UUID.

object

The user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Whitespaces in keys are converted to underscores. Uppercase characters in keys are converted to lowercase characters. The value could be any valid JSON, but it is handled as string over Coveo usage analytics. It is highly recommended that you create your custom dimension before adding customData

lastSearchQueryUid
string

The unique identifier (typically, the searchUid) of the query that caused the search interface to log the custom event, if applicable

originContext
string

The origin of the event. Used to specify the deployment from which the user performs the action. Suggested values are Search, InternalSearch, CommunitySearch, or the originLevel1 value

originLevel1
string

The name/identifier of the search interface from which the event originates. If unspecified and the request is authenticated with a search token, the service attempts to extract the searchHub value from the access token that authenticated the request

originLevel2
string

The name/identifier of the tab from which the event originates

originLevel3
string

The URL of the page that redirected the browser to the search interface from which the event originates, i.e. document.referrer

outcome
integer <int32>

An indication of how good the outcome of this event is. A value of -5 corresponds to the worst possible outcome, a value of 0 corresponds to a neutral outcome, and a value of 5 corresponds to the best possible outcome

splitTestRunName
string

The name of the A/B test run, if one is active. See Managing A/B Tests

splitTestRunVersion
string

The version of the A/B test run, if one is active

trackingId
string

A value to identify which web property an event is related to. This can only contain lowercase letters, numbers, and underscores (_).

userAgent
string

Information about the browser and operating system of the end-user who caused the search interface to log an event. See User Agent for more information

userDisplayName
string

The display name of the user performing the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the userdisplayName value from the access token that authenticated the request

username
string

The name of the user security identity who caused the search interface to log the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the username value from the access token that authenticated the request. If this fails, the username value is left blank. If unspecified and the request is authenticated with an API key, username is set to anonymous

Responses

Request samples

Content type
application/json
{
  • "anonymous": false,
  • "clientId": "489aa3e3-aed2-4563-8e81-62bb73178a56",
  • "customData": {
    },
  • "eventType": "facet",
  • "eventValue": "facetSearch",
  • "language": "en",
  • "lastSearchQueryUid": "7bfc652a-9dea-4811-b3f9-6d24345c37ce",
  • "originContext": "CommunitySearch",
  • "originLevel1": "ExternalSearch",
  • "originLevel2": "all",
  • "outcome": 0,
  • "splitTestRunName": "splitTest",
  • "splitTestRunVersion": "splitTestRunAlpha",
  • "trackingId": "online_store",
  • "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3249.481 Safari/537.36",
  • "userDisplayName": "Alice",
  • "username": "alice.smith@example.com"
}

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Get service status

Returns the status of the Usage Analytics Write service. Possible values are 'UP', 'unavailable' and 'degraded'.

Authorizations:
v8

Responses

Response samples

Content type
application/json
{ }

Log search event batch via POST

Logs one or more search events. Typically, when an end-user interacts with a search interface in a way that triggers a query to the Search API (e.g., submitting a query from the search box, selecting a facet value, etc.), the search interface logs a search event. Logging a batch of more than three items should generally be avoided, due to possible timing issues (e.g., all items in a batch inherit the same datetime).

Authorizations:
v8
query Parameters
org
string

The name of the organization (Coveo Cloud V2 only)

prioritizeVisitorParameter
boolean
Deprecated
Default: false

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. Whether to force the service to use the provided visitor query string parameter, rather than automatically attempting to override this parameter with the visitor cookie.

visitor
string

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. The unique identifier of the visitor. Unless prioritizeVisitorParameter is set to true, the service automatically attempts to override this query string parameter with the visitor cookie. If no visitor parameter is provided and the visitor cookie is absent, a new identifier is created and returned as the visitorId property in the response body, and as a visitor cookie.

Request Body schema: application/json
required

The search events to add.

Array
actionCause
required
string

The type of operation that triggered this event (see analyticsActionCauseList)

language
required
string

(Required, except when logging View events). The language of the end-user. Must be a valid ISO 639-1 code

queryText
required
string

The original basic query expression (q) in the corresponding search request

responseTime
required
integer <int32>

The amount of time (in milliseconds) between the moment the query that caused the search interface to log a search event was sent to the Search API and the moment the Search API returned the results. Must be greater than zero

searchQueryUid
required
string

The unique identifier of the event which led the search interface to log the search event. It is recommended to use the searchUid in the response of the corresponding search request to the Search API, or any UUID v4 of length less than or equal to 36 characters. UUIDs longer than 36 characters are truncated by the service.

advancedQuery
string

The original advanced query expression (aq) in the corresponding search request. Usually, this contains various query elements that were not manually added by the user

anonymous
boolean

Whether the interaction that caused the search interface to log the event was triggered by an anonymous user. If set to true, the Usage Analytics Write API will not extract the name and userDisplayName, if present, from the search token

clientId
string

A value that uniquely identifies the user who is logging the event. Must be a valid UUID.

contextual
boolean

Indicates if the query is modified by contextual filters (for instance, a query to find similar items)

object

The user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Whitespaces in keys are converted to underscores. Uppercase characters in keys are converted to lowercase characters. The value could be any valid JSON, but it is handled as string over Coveo usage analytics. It is highly recommended that you create your custom dimension before adding customData

Array of objects (FacetStateModelV15)

The facet state information in JSON ARRAY format at the time the search operation was performed

indexId
string

The index name the search query performed against

numberOfResults
integer <int32>

The number of results which were returned by the query that caused the search interface to log a search event. Must be equal to or greater than zero

originContext
string

The origin of the event. Used to specify the deployment from which the user performs the action. Suggested values are Search, InternalSearch, CommunitySearch, or the originLevel1 value

originLevel1
string

The name/identifier of the search interface from which the event originates. If unspecified and the request is authenticated with a search token, the service attempts to extract the searchHub value from the access token that authenticated the request

originLevel2
string

The name/identifier of the tab from which the event originates

originLevel3
string

The URL of the page that redirected the browser to the search interface from which the event originates, i.e. document.referrer

outcome
integer <int32>

An indication of how good the outcome of this event is. A value of -5 corresponds to the worst possible outcome, a value of 0 corresponds to a neutral outcome, and a value of 5 corresponds to the best possible outcome

queryPipeline
string

The name of the query pipeline which processed the query that caused the search interface to log a search event. When unspecified, the service uses the pipeline value set in the search token, if any

Array of objects (ResultModelV15)
Deprecated

The results of this search event

splitTestRunName
string

The name of the A/B test run, if one is active. See Managing A/B Tests

splitTestRunVersion
string

The version of the A/B test run, if one is active

trackingId
string

A value to identify which web property an event is related to. This can only contain lowercase letters, numbers, and underscores (_).

userAgent
string

Information about the browser and operating system of the end-user who caused the search interface to log an event. See User Agent for more information

userDisplayName
string

The display name of the user performing the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the userdisplayName value from the access token that authenticated the request

userGroups
Array of strings

The groups that the end-user performing the event is a member of. If the request is authenticated with a search token, the service also attempts to extract the userGroups value from the access token that authenticated the log search event request, and logs those groups as well.

username
string

The name of the user security identity who caused the search interface to log the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the username value from the access token that authenticated the request. If this fails, the username value is left blank. If unspecified and the request is authenticated with an API key, username is set to anonymous

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Get service status

This endpoint is exposed for backward compatibility reasons. Use monitoring/health instead. Returns the status of the Usage Analytics Write service. Possible values are 'online', 'unavailable' and 'degraded'.

Authorizations:
v8

Responses

Response samples

Content type
application/json
{ }

Log view event via POST

Logs a view event. Although view events are not currently available for usage analytics reports, they are required to feed Coveo Machine Learning event recommendations models. A page corresponding to an item which should be considered as a possible candidate result for the output of a Coveo Machine Learning event recommendation model must log a view event on its own whenever it is navigated to.

Authorizations:
v8
query Parameters
org
string

The name of the organization (Coveo Cloud V2 only)

prioritizeVisitorParameter
boolean
Deprecated
Default: false

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. Whether to force the service to use the provided visitor query string parameter, rather than automatically attempting to override this parameter with the visitor cookie.

visitor
string
Deprecated

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. The unique identifier of the visitor. Unless prioritizeVisitorParameter is set to true, the service automatically attempts to override this query string parameter with the visitor cookie. If no visitor parameter is provided and the visitor cookie is absent, a new identifier is created and returned as the visitorId property in the response body, and as a visitor cookie.

Request Body schema: application/json
required

The view event to add.

language
required
string

(Required, except when logging View events). The language of the end-user. Must be a valid ISO 639-1 code

location
required
string

The URL of the viewed page or component, usually document.location.href

anonymous
boolean

Whether the interaction that caused the search interface to log the event was triggered by an anonymous user. If set to true, the Usage Analytics Write API will not extract the name and userDisplayName, if present, from the search token

clientId
string

A value that uniquely identifies the user who is logging the event. Must be a valid UUID.

contentIdKey
string

The name of a field in the index that identifies the item uniquely. A good practice is to use @permanentid

contentIdValue
string

The value of the field selected as contentIdKey. Generally the @permanentid value in the index

contentType
string

The type of content in the page

object

The user defined dimensions and their values. Keys can only contain alphanumeric or underscore characters. Whitespaces in keys are converted to underscores. Uppercase characters in keys are converted to lowercase characters. The value could be any valid JSON, but it is handled as string over Coveo usage analytics. It is highly recommended that you create your custom dimension before adding customData

originContext
string

The origin of the event. Used to specify the deployment from which the user performs the action. Suggested values are Search, InternalSearch, CommunitySearch, or the originLevel1 value

originLevel1
string

The name/identifier of the search interface from which the event originates. If unspecified and the request is authenticated with a search token, the service attempts to extract the searchHub value from the access token that authenticated the request

originLevel2
string

The name/identifier of the tab from which the event originates

originLevel3
string

The URL of the page that redirected the browser to the search interface from which the event originates, i.e. document.referrer

outcome
integer <int32>

An indication of how good the outcome of this event is. A value of -5 corresponds to the worst possible outcome, a value of 0 corresponds to a neutral outcome, and a value of 5 corresponds to the best possible outcome

referrer
string

This parameter is exposed for backward compatibility reasons. Use originLevel3 instead

splitTestRunName
string

The name of the A/B test run, if one is active. See Managing A/B Tests

splitTestRunVersion
string

The version of the A/B test run, if one is active

title
string

The title of the item

trackingId
string

A value to identify which web property an event is related to. This can only contain lowercase letters, numbers, and underscores (_).

userAgent
string

Information about the browser and operating system of the end-user who caused the search interface to log an event. See User Agent for more information

userDisplayName
string

The display name of the user performing the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the userdisplayName value from the access token that authenticated the request

username
string

The name of the user security identity who caused the search interface to log the event. Can only be specified when authenticated with a token with impersonate privilege. If unspecified and the request is authenticated with a search token, the service attempts to extract the username value from the access token that authenticated the request. If this fails, the username value is left blank. If unspecified and the request is authenticated with an API key, username is set to anonymous

Responses

Request samples

Content type
application/json
{
  • "anonymous": false,
  • "clientId": "489aa3e3-aed2-4563-8e81-62bb73178a56",
  • "contentIdKey": "'@permanentid'",
  • "contentIdValue": "648a63d6a19545297692b4ae41a7d5e947c711be5f3c23dff69af3106960",
  • "contentType": "Docs",
  • "customData": {
    },
  • "language": "en",
  • "originContext": "CommunitySearch",
  • "originLevel1": "ExternalSearch",
  • "originLevel2": "all",
  • "outcome": 0,
  • "splitTestRunName": "splitTest",
  • "splitTestRunVersion": "splitTestRunAlpha",
  • "title": "Coveo for Salesforce",
  • "trackingId": "online_store",
  • "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3249.481 Safari/537.36",
  • "userDisplayName": "Alice",
  • "username": "alice.smith@example.com"
}

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

Delete visit cookie

Deletes the current visitorId cookie. A new one will be generated during the next interaction with the service, which will also create a new visitId.

Authorizations:
v8

Responses

Get current visit

Returns the current visitId, visitorId and clientId.

Authorizations:
v8
query Parameters
clientId
string

The unique identifier of the visitor. If a client id is provided, it is prioritized over any value passed for the visitor id parameter.

org
string

The name of the organization (Coveo Cloud V2 only)

prioritizeVisitorParameter
boolean
Deprecated
Default: false

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. Whether to force the service to use the provided visitor query string parameter, rather than automatically attempting to override this parameter with the visitor cookie.

user
string

The unique identifier of the user performing the search event. If not provided, the username will be extracted from the token.

visitor
string
Deprecated

'''DEPRECATED''' The clientId parameter should be used instead of visitorId in the event payload to capture the visitor identifier. The unique identifier of the visitor. Unless prioritizeVisitorParameter is set to true, the service automatically attempts to override this query string parameter with the visitor cookie. If no visitor parameter is provided and the visitor cookie is absent, a new identifier is created and returned as the visitorId property in the response body, and as a visitor cookie.

Responses

Response samples

Content type
application/json
{
  • "clientId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  • "visitorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}