# Live Chat With Visitor Identification

**URL:** <https://community.hubspot.com/t/live-chat-with-visitor-identification/82266>\
**Category:** APIs & Integrations\
**Tags:** sdk\
**Created:** [May 30, 2023, 3:07pm UTC](https://community.hubspot.com/t/live-chat-with-visitor-identification/82266 "2023-05-30T15:07:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmvekin](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@jmvekin](https://community.hubspot.com/u/jmvekin)\
**Post date:** [May 30, 2023, 3:07pm UTC](https://community.hubspot.com/t/live-chat-with-visitor-identification/82266/1 "2023-05-30T15:07:34Z")

</div>

I’m trying to include Live Chat on our website.

First of all, I have included the Tracking Code from Settings → Inboxes → Tracking Code.

Then I used ChatWidget SDK: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/conversation/chat-widget-sdk) to load the chat.

But that does not assign messages to Contact. Every message is sent from ‘Unknown Visitor’.

I tried using [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/conversation/visitor-identification). That page suggests using REST API. However, I am getting error 401 - Authentication credentials not found.

I suppose it has something to do with API keys being deprecated.

So my questions are as follows:

1. Do I have to create Private App to use Visitor Authentication
2. Is a Private App with conversations.visitor\_identification scope enabled is paid feature?
3. What is the difference between Visitor Identification and Tracking Code API ([Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/events/tracking-code)). What is the prefered way?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 31, 2023, 8:27pm UTC](https://community.hubspot.com/t/live-chat-with-visitor-identification/82266/2 "2023-05-31T20:27:59Z")

</div>

Hey, @jmvekin 👋 Thanks for your question.

Here are a few things to get us started:

Q1. Yes, you will need to create a [Private App](https://developers.hubspot.com/docs/api/private-apps), or create a [Public App and set up OAuth](https://developers.hubspot.com/docs/api/creating-an-app), to use the [Visitor Identification endpoint](https://developers.hubspot.com/docs/api/conversation/visitor-identification). This is necessary to provide the required access token to the API.

Please note the following for this specific endpoint:

- “The Visitor Identification API is for telling HubSpot who the visitor is. You should **not** rely on this to authenticate users in your platform.
- Access to the Visitor Identification API requires a _Professional_ or _Enterprise_ level subscription. If the account does not have a qualifying subscription, you will receive a `403` error response from the API.”

Q2. Use of the`conversations.visitor_identification.tokens.create` requires a Professional or Enterprise level subscription. You can find the scopes and required tiers listed here — [Working with OAuth](https://developers.hubspot.com/docs/api/working-with-oauth#:~:text=Visitor%20Identification%20API) (applies to Private Apps as well)

 ![CleanShot 2023-05-31 at 14.21.49.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/8/681bbbb1b299f4a2ecf15317980d9d8b0cba5c2d.png)

It sounds like using the Visitor Identification API seems to be the right approach, based on your goal.

One additional note — the Visitor Identification API works by assigning a unique `vid` to each visitor. This `vid` is then used to link the visitor’s activities to a specific contact in your HubSpot account. When a visitor identified via the API interacts with your live chat, their messages should be linked to the corresponding contact, rather than as ‘Unknown Visitor’.

If there are other details, or you have follow-up questions, please add them here and the community will do their best to help.

Best,

Jaycee
