Source: https://rox.chat/kb/pt/dev/identification/visitor-ids.html

> In order to identify visitors in the system and link their requests, Rox.Chat provides the possibility for a visitor to have three different identifiers:

# Visitor Identifiers

In order to identify visitors in the system and link their requests, **Rox.Chat** provides the possibility for a visitor to have three different identifiers:

| Identifier            | Type                                                                  | Description                                                                                                                                                                                                                                                                                            | Mandatory |
| --------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------- |
| `visitor_id`          | GUID                                                                  | Internal unique identifier of a visitor in **Rox.Chat**, by which the visitor is identified in the system. It is assigned to a visitor when he/she submits a request for the first time.                                                                                                               | Yes       |
| `provided_visitor_id` | Depends on the particular system from which the identifier is passed. | A visitor identifier assigned in the client's system, reported by the client to the **Rox.Chat** service. For example, it can be a user ID in a CRM system or on a client's website. Used for chat routing and data exchange between **Rox.Chat** and the client's system with which it is integrated. | No        |
| `channel_user_id`     | Depends on the particular channel.                                    | The identifier of the visitor in the communication channel.                                                                                                                                                                                                                                            | No        |

## visitor_id

This pseudo-unique identifier is assigned to each visitor and is displayed in Workspace during the chat in the **ID** field:

![visitor_id](https://rox.chat/kb/pt/img/dev/identification/visitor-ids/visitor-id.webp)

If a user makes a second visit and his/her identifier was stored in browser cookies during the previous visit, he/she is identified by the system as a previously visited visitor with the same `visitor_id` [history](https://rox.chat/kb/pt/for-agents/agent-gui/view-dialog-history.html). Accordingly, if a visitor leaves requests through different browsers, then for **Rox.Chat** he is two different users with different `visitor_id`.

You can search for a visitor's closed chats by `visitor_id` using the search bar on the **History** page:

![Search in History by visitor_id](https://rox.chat/kb/pt/img/dev/identification/visitor-ids/search-visitor-id-in-history.webp)

The internal ID is also passed to the bot when chat is assigned to it (see [Assigning chat to a bot](https://rox.chat/kb/pt/bots/external-bot/v-2-0.html)), and can also be passed to any custom API.

## provided_visitor_id

This identifier is passed along with the visitor's data inside the `visitor.fields` object when the invocation comes from a third-party system or a client site where the visitor is authorized (see [Identification of authorized clients](https://rox.chat/kb/pt/dev/identification/id-2-0.html). The type of `provided_visitor_id` may be arbitrary and depends on the client's system. The client must ensure that the `provided_visitor_id` is **unique**. Otherwise, if identical identifiers are passed for different visitors, for **Rox.Chat** such users will be considered as one person, as a consequence with a common chat history.

You can search for a visitor's closed chats by `provided_visitor_id` by specifying this identifier in the **ID** field on the **History** page:

![Search in History by provided_visitor_id](https://rox.chat/kb/pt/img/dev/identification/visitor-ids/filters-history-search-provided-visitor-id.webp)

## Relationship between provided_visitor_id and visitor_id

When `provided_visitor_id` is first passed to **Rox.Chat**, an internal **Rox.Chat** identifier (`visitor_id`) is computed based on the visitor identifier passed by the client. In this way, **Rox.Chat** identifies each visitor with a non-zero `provided_visitor_id` by assigning its own `visitor_id` to the bundle, so that a visitor authorized on the client's site is considered the same user in **Rox.Chat**. In this case, every time the visitor will be authorized in the client's system and leave new requests, **Rox.Chat** will identify him by his old `visitor_id` and load old chats from the history.

In this case, if a visitor came to the site unauthorized, and then re-authorized in the client's system with the same `provided_visitor_id`, his `visitor_id` before authorization will be changed to the `visitor_id`, which was previously bound to `provided_visitor_id`. That is, for **Rox.Chat** before and after authorization he will be considered two different visitors.

!!! Note "N.B."
    In case a visitor authorizes through a mobile application using **Rox.Chat Mobile SDK**, push notifications related to the support chat will be sent to **all devices** and **all applications** where they are authorized using their `visitor_id` and/or `provided_visitor_id`, i.e. in case there are several mobile applications on one device linked to the same **Rox.Chat** server, notifications about, for example, a new message will be sent to all these applications.

## channel_user_id

This identifier is present in cases when the visitor applies through a communication channel and is displayed in **Workspace** during the chat in the **Contacts** block:

![channel_user_id in Workspace](https://rox.chat/kb/pt/img/dev/identification/visitor-ids/channel-user-id.webp)

As with `provided_visitor_id`, each user with a new `channel_user_id` is assigned a `visitor_id`. In case a visitor requests support through different communication channels (respectively, has a different `channel_user_id` for each request), the system treats it as three different users with different chat history and different `visitor_id`.

The type of channel identifier is determined by the rules of each individual channel. The table shows the description of identifiers for the most common channels with which **Rox.Chat** integrates (in **Rox.Chat** they are considered as a string).

| Channel                                                                                                    | Identifier format                                                               | Example                    |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------- |
| Telegram                                        | An eight-digit numeric identifier.                                              | `67854257`                 |
| Viber                                              | A string consisting of upper and lower case Latin letters, numbers and symbols. | `5dfjdg5lfg8dGjg0DF95+h==` |
| WhatsApp           | Visitor's phone number listed in full, no characters.                           | `10435685475`              |
| [Facebook](https://rox.chat/kb/pt/channels/social-network-messengers/facebook-and-instagram/) | The 15-digit numeric identifier contained in the user's profile link.           | `103458712527651`          |
