How to identify a contact in the chat?

SOLVE
Highlighted
Occasional Contributor

Hi,

how can I identify a visitor in the chat box? I've tried the identify API

 var _hsq = window._hsq = window._hsq || []; 
_hsq.push(["identify", { email: "${email}" }]);

but it didn't work. New chat conversations still appear as "Uknown Visitor"

I'd appreciate your help.

Thanks,
Lukasz

108 Replies 108
Highlighted
HubSpot Product Team

@vruben -- Thank you for checking in! Hoping to have an update for you all very soon. Keep an eye out for a product notification, and I will make sure to post a note here as well. 

Reply
0 Upvotes
Highlighted
New Contributor

If it's possible to answer, are we talking days or weeks? We migrated to hubspot thinking the chat would be a great replacement of Intercom and are now regretting that. Chats are coming in from people without proper labeling, as you know. And every day we dont have this, it causes issues.

 

So if its days, I'll gladly wait. If it's weeks, then ill need to switch for the time being.

 

Thanks

Reply
0 Upvotes
Highlighted
New Contributor

Shouldn't the "Identify" method just update both cookies and identify the user across all services? As a dev you would expect to call "Identify" and for hubspot to stitch all the data associated with that session to the user in question, rather than having to do one thing for analytics and one thing for the chat.

Reply
0 Upvotes
Highlighted
Regular Contributor

This request has been pending for 2 years and still no solution. This platform is almost useless to request anything. 

Highlighted
Solution
HubSpot Product Team

The Visitor Identification API is now in public beta! You can read more about it and get started here. This is open to all Pro+ portals as of now, no need to be ungated. 

 

The new Visitor Identification API enables you to provide details about visitors' identities to the chat widget after they've been authenticated by an external login system. So, if a visitor logs in (by providing their email address), the Visitor Identification API can send their identity to HubSpot's chat widget.

 

This API also works automatically with HubSpot's private content membership for CMS Hub or Knowledge Base, no additional setup required!

 

Please let me know if you have any questions or feedback. This API is still in beta, by using this API you agree to our developer beta terms.

View solution in original post

Highlighted
New Contributor

Good Morning,

 

just tried it without an app, but API/Token only. Got error complaining about missing scopes:

 

{"status":"error","message":"This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.","correlationId":".....","errors":[{"message":"All of the following scopes are required.","context":{"requiredScopes":["conversations.visitor_identification.tokens.create"]}}],"links":{"scopes":"https://developers.hubspot.com/scopes"},"category":"MISSING_SCOPES"}

linking to dead url:

https://developers.hubspot.com/scopes

 

Pls. advice

Highlighted
HubSpot Employee

Hi, @patroqueeet.

 

I'll look into this. Could you share your app ID and the scopes you are currently requiring?

 

I've learned that @tilly helped you uncover the issue directly.

 

Here are links to the most updated OAuth documentation (mentions scopes) and the older but still relevant scopes documentation.

 

For others reading this, make sure to add the conversations.visitor_identification.tokens.create scope in your app definition's Auth tab, as shown below:

 

conversations.visitor_identification.tokens.create scope.jpg

Isaac Takushi

Alumnus, HubSpot Developer Support
Reply
0 Upvotes
Highlighted
Regular Contributor

It seems the visitor identification API does only create a contact, when the customer sends a chat message. Is this the intended behaviour?

 

We're sending email, firstName, lastName to get a token. Contacts should be created then if not stored at HS. 

Reply
0 Upvotes
Highlighted
HubSpot Product Team

Hi @cl77 -- That is correct, the Visitor Identification API only creates a contact if and when they initiate a chat.

 

To make sure I understand your use case and needs, what is your expectation for this API? How are you currently using it? Thanks!

Reply
0 Upvotes
Highlighted
Regular Contributor

Hello Hubspot team,

 

The whole visitor identification doesn't work whenever the chat is loaded on the knowledge base. Because the knowledge base is opened from our mobile app, even though we know the email the chat is not able to identify the visitor. 

Please let us know the solution for this.

 

NOTE: This must be happening because on the knowledge base loaded by Hubspot instantly loads up the chat.

 

 

Reply
0 Upvotes
Highlighted
Occasional Contributor

Hi @tilly  My company started using Hubspot this year and we're on the starter plan. We were pretty jazzed about being able to use the chat widget in our intranet to provide support to our agents, but as a result of not having automatic user identification we've had very low engagement.

 

Is there a way for me to purchase or unlock access to the new visiter identification API without upgrading my whole plan?

Reply
0 Upvotes
Highlighted
Regular Contributor

@tilly any update about my comment above?

Reply
0 Upvotes
Highlighted
HubSpot Product Team

Hi @avichopra - Thanks for the tag. The Visitor Identification API should work from the KB, but it sounds like we may need additional specifics to get to the root cause. I recommend reaching out to our support team for next steps in troubleshooting the behavior you are seeing.

 

Hi @jpw_andy - At this time, the Visitor Identification API will work with any Pro level subscription across any Hub (Marketing, Sales, Service, or CMS) but is not available for an individual upgrade. Thank you for this feedback!

Highlighted
New Contributor

@tilly is it the case that to reliably identify a user in HubSpot Live Chat we need to take out a Pro level subscription?

Reply
0 Upvotes
Highlighted
HubSpot Product Team

Hi @mark_cf! The chat widget can also identify visitors based on existing cookies or submitted email addresses, which does not require a Pro subscription. The Visitor Identification API as a method of identifying chat visitors does require a Pro subscription. Let me know if you have additional questions!

Reply
0 Upvotes
Highlighted
New Contributor

@tilly, I'm a small business just getting started.  I can't afford to pay $800/month but hate to ask my visitors for their email when I already know it.  It's just a bad user experience for my visitors.  Seems odd that HubSpot doesn't give all users access to basic API features like this.  Are there any other ways to identify visitors without asking them for their email in the chat?  Does this code still work? https://legacydocs.hubspot.com/docs/methods/tracking_code_api/identify_visitor

Highlighted
New Contributor

Hello @tilly @IsaacTakushi 

I followed the steps from the api docs here:
https://developers.hubspot.com/docs/api/conversation/visitor-identification
but we still see users coming in inbox as  Unknown Visitors, even after setting the required params in the "window.hsConversationsSettings" object


window.hsConversationsSettings = {
  loadImmediately: false,

  identificationEmail: "visitor-email@example.com",

  identificationToken: "tokenId"

};

and then we load the widget: 

window.HubSpotConversations.widget.load();
 

I think we had like 1 or 2 persons identified with their mail, and after some logouts/logins they also started appearing as Unknown Visitors. 

Can someone provide some solution for this?

Reply
0 Upvotes
Highlighted
HubSpot Employee

Hi, @John3212.

 

@dennisedson will be able to help you out here.

 

Based on your description of the issue, I suspect that the identificationEmail and identificationToken may not be set every time the page loads for an authenticated visitor. Per Step 3 in the documentation:


This context will not be carried across page loads automatically if these parameters are no longer set. Tokens are temporary and will expire after 12 hours.

Isaac Takushi

Alumnus, HubSpot Developer Support
Reply
0 Upvotes
New Contributor

I`ve been checking everytime in the chrome dev console to see if the mail and the token are set in the window.hsConversationsSettings object, and they are always set there, i just tried again:
T1r4in6



Reply
0 Upvotes