--- title: What's the client ID? slug: masb0234 canonical_url: https://docs.coveo.com/en/masb0234/ collection: coveo-analytics source_format: adoc --- # What's the client ID? The _client ID_ is a unique value generated by the [`coveo.analytics.js` library](https://docs.coveo.com/en/1818/) that identifies a browser client on a Coveo-powered search page. It replaces an earlier value, the [visitor ID](https://docs.coveo.com/en/273/), which is now deprecated. The [client ID](https://docs.coveo.com/en/lbjf0131/) is used as a proxy for an anonymous user, where a [user ID](https://docs.coveo.com/en/268/) isn't available or isn't supplied by the user. The combination of a client ID and a user ID helps Coveo track the [number of unique visitors](https://docs.coveo.com/en/2041#unique-client-id) to your site. The client ID doesn't directly identify a human user, but rather, the user's browser, and multiple users may use that browser. By default, the client ID is supplied to [Coveo Analytics](https://docs.coveo.com/en/182/) and is kept in a [first-party cookie](https://docs.coveo.com/en/mbeg8404/) as well as the [local storage](https://docs.coveo.com/en/mbeh0288/) of the browser. See [Local storage and cookies](https://docs.coveo.com/en/3348/) for details. > **Note** > > In the local storage, you may [still see the `visitorID` value](https://docs.coveo.com/en/mc2e2218#why-do-i-still-see-the-name-visitor-id-in-the-local-storage) instead of the `clientID`. ## Advantages of using the client ID While the client ID bears some similarities to the visitor ID, such as their longevity as well as their usefulness for gathering events, the client ID is preferred for several reasons. For instance, it doesn't rely on [third-party cookies](https://docs.coveo.com/en/mbeg0180/), which is an advantage since more and more browsers are blocking them. Another reason to use the client ID is because it's generated client-side, which gives front-end control of the ID generation. This resolves race condition issues experienced with the visitor ID. These issues occur when there are multiple analytics scripts since the visitor ID is generated by Coveo Analytics. Furthermore, multiple visitor IDs can refer to the same anonymous user; while it's possible to match them, it's a time-consuming process. > **Notes** > > * When both the client ID and the visitor ID are present, Coveo Analytics selects the client ID to resolve the visit associated with an event. > Furthermore, when the client ID is present, Coveo Analytics doesn't return a cookie containing the visitor ID value. > > * When sending an event, if there's no ID provided, Coveo Analytics generates a visitor ID. > The generated ID is returned in the response (see [What if a client ID isn't sent?](https://docs.coveo.com/en/mc2e2218#what-if-a-client-id-isnt-sent)). ## Does my implementation pass the client ID? To ensure that the client ID is being passed, it's essential that the version of the [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/) used by your Coveo implementation is either the [January 2021 version](https://docs.coveo.com/en/m56a0507#january-2021-release-v210082) or a newer one. This is because as of January 2021, we implemented a mechanism for clients to send the client ID through the [Write API](https://platform.cloud.coveo.com/docs?urls.primaryName=Usage%20Analytics%20Write#/Analytics%20API%20-%20Version%2015) to track user visits. > **Note** > > If you aren't using the Coveo UA library, you can still send the client ID by adding it to the payload on the call to the UA [Write API](https://platform.cloud.coveo.com/docs?urls.primaryName=Usage%20Analytics%20Write#/Analytics%20API%20-%20Version%2015). Verify which version of the JavaScript Search Framework you're currently using. You can identify the version from [a search interface](https://docs.coveo.com/en/327#method-1-from-a-search-interface) or [the distribution files](https://docs.coveo.com/en/327#method-2-from-the-distribution-files). * If you're using a version older than the January 2021 version, you must then upgrade to a [more recent version](https://docs.coveo.com/en/o1aj0225/). * If you're using the January 2021 version (or newer), then you don't need to do anything further except [test the client ID](#test-the-client-id) to ensure that it's functioning properly. > **Note** > > All Coveo [Headless](https://docs.coveo.com/en/headless/latest/) and [Atomic](https://docs.coveo.com/en/atomic/latest/) integrations use the correct version of the library, therefore the client ID is sent. The following table lists the applicable version upgrades for different Coveo integrations: [cols="2",options="header"] |=== |Integration |Upgrade |Coveo for Salesforce a| Upgrade to [4.13](https://docs.coveo.com/en/3236#march-2021-release-v413) (or higher). .2+|Coveo for Sitecore a|If you track view events, you have two options: * Upgrade to [5.0.943.3](https://docs.coveo.com/en/l22b0522/) and manually [upgrade the `coveoua.js` file to v2](https://docs.coveo.com/en/n58b7080/). * Upgrade to [5.0.1227.1](https://docs.coveo.com/en/n3ne0564/) (or higher) |If you don't track view events, upgrade to [5.0.943.3](https://docs.coveo.com/en/l22b0522/) (or higher). |Coveo for ServiceNow a| Upgrade to 21.2.51 (or higher). |Coveo for Zendesk a| Upgrade [all search pages to 2.10083](https://docs.coveo.com/en/m56a0507#february-2021-release-v210083) (or higher). |Custom web (with `coveoua.js`) or React Native (with `react-native.es.js`) a| Upgrade [`coveoua.js`](https://github.com/coveo/coveo.analytics.js/tags?after=2.0.1) to the February 2020 version 2.0.0 (or higher). |=== > **Note** > > Although you can upgrade to the January 2021 version, we recommend upgrading to the latest version available to ensure optimal performance. > **Important** > > If you have a custom integration, in addition to using a newer JSUI version, you must also ensure that the entirety of your integration is up to date. > For example, if you're using a combination that includes the [Collect endpoint](https://docs.coveo.com/en/l41i0031#whats-the-collect-endpoint), ensure that the client ID is being sent to both the Coveo Analytics and the Collect endpoints. > Also ensure that you've removed the visitor ID tracking mechanism. > Otherwise, visits will consequently be split in two and this will affect reporting accuracy. ## Test the client ID There are several ways to verify that your Coveo implementation is passing the client ID: * You can access the [Visit Browser](#visit-browser). * You can create a [custom dashboard](#custom-dashboard). * You can use your browser's [developer tools](#developer-tools). ### Visit Browser You can use the [**Visit Browser**](https://platform.cloud.coveo.com/admin/#/orgid/usage/visit/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/visit/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/visit/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/visit/)) in the [Coveo Administration Console](https://docs.coveo.com/en/183/) by sorting through events. For example: ![Find client ID in the Visit Browser | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/find-clientid-visit-browser.png) ### Custom dashboard You can create a **Client ID verification** dashboard. . On the [**Reports**](https://platform.cloud.coveo.com/admin/#/orgid/usage/reports/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/reports/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/reports/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/reports/)) page, [add a blank dashboard](https://docs.coveo.com/en/1631#add-a-dashboard). . In the upper-right corner of the window, click icon:dots-circle-horizontal[alt=dots-circle-horizontal,width=16], and then select **Paste JSON configuration**. . In the **Import a Report Configuration** panel that appears, paste the JSON configuration below, and then click **Import and save**. **Report configuration to import**
Details ```json { "displayName": "Client ID verification", "type": "DASHBOARD", "configuration": { "description": "This report is to validate that all events are sending the client ID.", "dateRange": { "range": "weeks", "length": 1, "offset": -1 }, "compareRange": { "range": "weeks", "length": 1, "offset": -2 }, "tabs": [ { "id": "9487", "title": "Tab 1", "sections": [ { "title": "", "position": { "col": "1", "row": "1", "sizex": "6", "sizey": "11", "minSizex": 2 }, "cards": [ { "id": "7006", "href": "", "title": "All events", "sortBy": "DocumentView", "filters": "", "metrics": [ "DocumentView", "CustomEvent", "PerformSearch" ], "cardType": "DetailedStatistics", "position": { "col": 1, "row": 2, "sizex": 4, "sizey": 4, "minSizex": 1, "minSizey": 2 }, "ascending": false, "showCount": false, "dimensions": [ "customEventType", "originLevel1" ], "headerHref": "", "showHeader": true, "metricsSort": [ "PerformSearch", "DocumentView", "CustomEvent" ], "metricFilters": "", "dimensionsSort": [ "originLevel1", "customEventType" ], "metricsHeaders": {}, "bindOnLastSearch": true, "dimensionsHeaders": {}, "editMode": false }, { "id": "34FF", "href": "", "title": "Events sending a Client ID", "sortBy": "DocumentView", "filters": "(clientid!~'null' AND clientid!~'' AND clientid!=null)", "metrics": [ "DocumentView", "CustomEvent", "PerformSearch" ], "cardType": "DetailedStatistics", "position": { "col": 1, "row": 7, "sizex": 2, "sizey": 4, "minSizex": 1, "minSizey": 2 }, "ascending": false, "showCount": false, "dimensions": [ "customEventType", "originLevel1" ], "headerHref": "", "showHeader": true, "metricsSort": [ "PerformSearch", "DocumentView", "CustomEvent" ], "metricFilters": "", "dimensionsSort": [ "originLevel1", "customEventType" ], "metricsHeaders": {}, "bindOnLastSearch": true, "dimensionsHeaders": {}, "editMode": false }, { "id": "BEA1", "href": "", "title": "Events leveraging a third-party cookie", "sortBy": "PerformSearch", "filters": "(c_third_party_cookie_set==true)", "metrics": [ "DocumentView", "CustomEvent", "PerformSearch" ], "cardType": "DetailedStatistics", "position": { "col": 3, "row": 7, "sizex": 2, "sizey": 4, "minSizex": 1, "minSizey": 2 }, "ascending": false, "showCount": false, "dimensions": [ "customEventType", "originLevel1" ], "headerHref": "", "showHeader": true, "metricsSort": [ "PerformSearch", "DocumentView", "CustomEvent" ], "metricFilters": "", "dimensionsSort": [ "originLevel1", "customEventType" ], "metricsHeaders": {}, "bindOnLastSearch": true, "dimensionsHeaders": {}, "editMode": false }, { "id": "2AB6", "href": "", "style": "info", "title": "Events sending Client ID", "value": "The table below needs to be identical to the \"All events\" table. If there are missing events, it means those events are not sending a Client ID, which is now required.\n", "cardType": "NoteCard", "position": { "col": 1, "row": 6, "sizex": 2, "sizey": 1, "minSizex": 1, "minSizey": 1 }, "eventType": "join", "headerHref": "", "isMarkdown": true, "editMode": false }, { "id": "DBCE", "href": "", "style": "info", "title": "Events leveraging third-party cookie", "value": "The table below needs to be empty. If it's not empty, it means that a search hub is still leveraging a third-party cookie to set the Visitor ID.\n", "cardType": "NoteCard", "position": { "col": 3, "row": 6, "sizex": 2, "sizey": 1, "minSizex": 1, "minSizey": 1 }, "eventType": "join", "headerHref": "", "isMarkdown": true, "editMode": false }, { "id": "A1D6", "href": "", "style": "info", "title": "All events", "value": "The event count in this table should always be the sum of the event counts from the two other tables in this dashboard.", "cardType": "NoteCard", "position": { "col": 1, "row": 1, "sizex": 4, "sizey": 1, "minSizex": 1, "minSizey": 1 }, "eventType": "join", "headerHref": "", "isMarkdown": true, "editMode": false } ], "editMode": false } ], "active": true, "editMode": false } ], "filters": "$", "version": 6 }, "allAnalyticsViewer": true, "filters": [] } ```
. [Adjust the date range](https://docs.coveo.com/en/1542#method-2-pick-a-date-range) to specify the date your upgrade was completed. . Inspect the report to ensure that the **All events** and **Events sending a Client ID** cards are identical, with the same events and event counts, and that the **Events leveraging a third-party cookie** card is empty. ### Developer tools Use your browser's developer tools to view the client ID. . Open a Coveo-powered search page. . Open your web browser's developer tools. > **Note** > > The examples in this article use the **Google Chrome** developer tools. > For browser-specific information, see: > > * [Google Chrome](https://developers.google.com/web/tools/chrome-devtools/open) > > * [Mozilla Firefox](https://developer.mozilla.org/en-US/docs/Tools) > > * [Safari](https://support.apple.com/en-ca/guide/safari/sfri20948/mac) . Select the **Network** tab. . On the search page, perform a query to trigger an event. . Back in the developer tools window, under the **Name** column, click the latest call to Coveo Analytics. . Select the **Payload** tab. Then, under the **Request Payload** section, expand the `actionCause` to view the client ID. For example: ![Client ID in payload](https://docs.coveo.com/en/assets/images/coveo-analytics/clientid-developer-tools.png)