Aug 30, 2018 4:09 AM
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
Solved! Go to Solution.
Aug 5, 2020 5:09 PM - edited Aug 6, 2020 10:16 AM
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.
Nov 4, 2021 12:39 AM - edited Nov 4, 2021 12:40 AM
This solution for this.
1. Follow this link to update identify visitor:
https://developers.hubspot.com/docs/api/conversation/visitor-identification
window.hsConversationsSettings = { identificationEmail: "visitor-email@example.com", identificationToken: "<TOKEN FROM STEP 1>" };
2. Call clear function to refresh chatbox identify.
https://developers.hubspot.com/docs/api/conversation/chat-widget-sdk
window.HubSpotConversations.clear({resetWidget:true});
It work perfert for me, hoping helpful to you.
Aug 4, 2021 3:20 AM
Hi,
We are using it in SPA angular 7 app
We want that chatbox should be available to visitor as guest and as soon as user logs in to the system it should identify as user
We are able to generate new token with user's email and we are setting it to window.hsConversationsSettings
But user continue to detected as unknow users
We have tried to make use of
window.HubSpotConversations.widget.refresh();
window.HubSpotConversations.clear({resetWidget:true});
But still on same issue unknow user
Flow
User visit the site -> Unknow user
User login to the site -> Token generated and saved-> window.hsConversationsSettings -> console.log we can see new data -> Still unknow user
2nd flow
User visit the site -> we explicitily set 1 known user (Myuser1) with valid tolen in index.html window.hsConversationsSettings -> know user detected as Myuser1
User login to the site -> Token generated and saved-> window.hsConversationsSettings -> console.log we can see new data -> Still Myuser1
Any one lucky enough in last 2 year that this unknown user solved in Single page application ?
Thanks
Sep 8, 2021 4:08 PM - edited Sep 8, 2021 4:08 PM
@PTamrakar Have you tried to use
Mar 3, 2021 2:57 PM
Rectification, it does work on the Hubbspot Conversations Inbox.
The issue is the slack alert that does show `HubSpotAPP Unknown visitor started a conversation`.
Maybe the slack notification is triggered before the User assignment is resolved?
Mar 3, 2021 2:37 PM
I am also seeing the same issue:
We get the proper token (JWT) and base64 decode shows proper content.
The user does exist on Hubspot.
Yet we get Unknown visitor
Oct 20, 2020 6:14 PM - edited Oct 20, 2020 6:15 PM
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:
Oct 20, 2020 9:38 AM
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 TakushiAssociate Certification Manager |
May 17, 2021 4:15 PM - edited May 17, 2021 4:20 PM
Isaac ( @IsaacTakushi ),
A couple questions on this:
1. We are already doing this for tracking:
_hsq.push([ 'identify', {
firstName,
lastName,
email,
role, // hopefully, this works...
company: tenant
}]);
What is the relationship between this an the call to setting up Chat?
2. Is the only way to get the identificationToken via a seperate API call? Can it be combined with the tracking identify shown above?
3. Unfortunately, our appliacation is not a SPA. So lots of requests. I would prefer not to add an API call on every page request. I assume the only way to manage this is to add another cookie on our end to track when we get the identification token and then if has been more than 12 hours get a new one?
4. Is there a way to get an identification token without creating a contact? I dont' want to create a contact unless they actually start a chat.
Thanks,
~Shea M
Oct 20, 2020 7:29 AM - edited Oct 20, 2020 7:31 AM
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:
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?
Oct 14, 2020 12:45 PM
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!
Oct 20, 2020 10:05 PM
@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
Oct 12, 2020 10:32 AM - edited Oct 12, 2020 10:33 AM
@tilly is it the case that to reliably identify a user in HubSpot Live Chat we need to take out a Pro level subscription?
Oct 12, 2020 8:43 AM
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!
Oct 9, 2020 8:04 AM
@tilly any update about my comment above?
Aug 5, 2020 5:09 PM - edited Aug 6, 2020 10:16 AM
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.
3 weeks ago
Hello @tilly , I've followed the Visitor Identification API documentation and it works most of the time, but sometimes the user still appears as "Uknown Visitor". Is there any known issue regarding this? Is it still in beta? Thank you.
Nov 18, 2021 12:59 PM - edited Nov 19, 2021 9:54 AM
Hey @tilly ,
I am using the new Visitor Identification API to add a new contact from our system, I see token generated from this API response. but I don't see the contact's being added in hubspot.
can someone help with this?
Sep 25, 2020 10:03 AM
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?
Aug 6, 2020 12:39 AM
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
Aug 7, 2020 2:06 PM - edited Aug 7, 2020 2:36 PM
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:
Isaac TakushiAssociate Certification Manager |