Live Chat With Visitor Identification

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 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. 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). What is the prefered way?

Thank you in advance.

Hey, @jmvekin :waving_hand: Thanks for your question.

Here are a few things to get us started:

Q1. Yes, you will need to create a Private App, or create a Public App and set up OAuth, to use the Visitor Identification endpoint. 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 (applies to Private Apps as well)

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