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 newVisitor Identification APIenables 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.
If you include an email field in the chat itself, you will be able to identify users every time. This discussion pertains to customers who want to identify users without having to rely on the in-chat email field.
I meant, will we be able to use a LiveChat API that simply allows for putting email/identifying information to the support side, so indeed without relying on the in-chat email field. But also without relying on the tracking API/cookies. So something like:
You're correct that the identify function will always create a new contact record for new email addresses.
I believe the upcoming functionality will support the use case you describe. From my understanding, it will allow you to identify visitors for chats without creating them.
Any update on this pending functionality? Running into the issue right now where chats are coming from "unknown sender" but they assume we know who they are. Being able to label who is contacting us is absolutely necessary for this to be useful to us.
We were about to migrate the chat from Intercom to Hubspot to integrate marketing and sales with service, but not being able to recognize logged in customers properly is a huge loss for us. Might need to cancel our pro subscriptions until this issue is solved.
we are experiencing the same problem with our users, that are logged in to our platform. Having to ask them about whom they are, drastically reduces the customer experience. We have migrated to HubSpot from intercom, following of the need to have it all in one place. We had no such issues with our previous provider 😞
@cbarley Thanks much for this info. I'm new to HubSpot (and Javascript) so I don't have a strong foundation, but I could really use some clarity around how this works. I believe my problem matches this thread topic: We're using the HubSpot Conversations API, and we're having conversations show up as Unknown Visitor. My issue is not that it doesn't work, it's that it's not reliably working. We have a SPA React app and we're following the instructions on this page, and we often get a contact associated with the name, but frequently we don't. What we're seeing is:
* When opening an incognito window and logging in for the first time, we get Unknown Visitor about 20% of the time. * After logging out of our app then logging back in, we get Unknown Visitor 100% of the time. Logging out and logging back in again will usually resolve it, although sometimes the name received in HubSpot is actually the previous login, not the current one.
When the identity changes, we push the new identity and trackPageView per this thread. When the location changes, we setPath and trackPageView. When the user logs out, we revokeCookieConsent and trackPageView, then clear the converation, refresh the widget and reload the page.
I've removed as much uncertainty as I can: Everything going to hubspot is serialized, has a widget refresh after each operation, and only runs the next operation once the refresh (or reload) is finished. I've verified we're sending the correct email and the events are in order. As far as I know the tracking code is being triggered and it's always sending the correct email (I assume https://track.hubspot.com/__ptq.gif is the tracking URL, that's where I'm seeing the identity attached).
Everything looks good, and more importantly, everything seems to be the same every time, but it's just random whether or not we'll get an Unknown Visitor. Is there any insight in to how this works?
On our platform all visitors must be logged in which means that for all connexions we have their email address and they are registered in our Hubspot CRM.
I am wondering why there is no feature in the Conversations API that enables to push throught the visitor email address while the chat is loading? So, if the visitor starts a conversation we can identify him in Hubsport and/or Slack or whatever other tool we are using to engage with him.
It would be much easier than using cookies and three different APIs (from what I've understand from technical documentation and from this thread). But I might have missed something... is there any feature in the Conversations API where we could post the visitor's email address each time the chat loads to make sure to identify him if he engages the conversation?
Hey @Madura , I tested with a real email address and it worked again with the exact code above. You just need to 1. push the data into the tracking code by using an identify call 2. call a trackPageView or trigger an event to send that data to HubSpot 3. Refresh the widget immediately and the user can then chat. This will identify the contact inside of the Conversations Tool inside of HubSpot. Not totally sure about identifying the user within the literal chat widget, but I just might not have tested enough. It seems like it should be possible though
I've been spending the last few hours on this but I'm still having issues in using the refresh API.
I'm using the exact same code you posted; I also verified that things are lined up just fine temporally (the sequence of events is correct: once the hsConversation API is ready my code pushes the "identify" value and the "trackPageView" into _hsq and then calls the refresh function).
Though, nothing happens, my user is still "unknown" to HubSpot (even though I've provided id and email matching one of my contacts). Similarly, if I setup the Chatflow to show only for tracket contacts, the widget never shows, even though I provide the id and email of the contact before calling refresh.
I still need to do a hard reload of the page to see the widget popping up. 😞
This is the code I run (in a simplified version, without setTimeout and fake data):
{"@type":"HIDE_WIDGET","type":"HIDE_WIDGET","metadata":{"@type":"HIDE_WIDGET_META","reason":"NO_MATCHING_WELCOME_MESSAGE","description":"No matching welcome message for portal XXXXX page http://localhost:3000/mypageurl or visitor does not match targeting rules"}}
Might this be linked to the widget not refreshing as intended?
Ah, one additional thing:
I noticed that if I open my contact detail page in HubSpot, I correctly see ALL the "trackPageView" events I pushed! Even though the chat widget keep not recognizing the user (unless I refresh the page), the "trackPageView" event I push seems to correctly reach HubSpot and map to the correct contact!
Hi @damdam , the contact's name or email can't show inside the chat bubble since personalization tokens aren't able to be used in that setting, but if you identify the contact, you should be able to see in the Conversations Tool inside HubSpot that they aren't an Unknown Visitor anymore.
The weirdness of that behavior you're seeing right now could also be because you're testing on localhost. I've seen strange behavior there so you should probably just test out on an unpublished test page in HubSpot.
I'm aware of the issue with the personalization token 🙂 That's not what I was talking about. My problem is exactly what you guessed: in HubSpot the visitor is not recognized as a contact and shows up as "Unknown visitor" (until I refresh the browser page that is, from that moment onward it is properly recognized).
I honestly don't see why using localhost might be a problem, since there's no mention of any domain in Hubspot (so HubSpot wouldn't be able to apply any special behaviour depending on the URL of the incoming request); if that was the case, I would expect the visitor not to be recognized, ever, not even after a page refresh (and that is not the case).
I'll try connecting through a tunnel (to proxy my localhost address through a public address) and see if there's any difference but I won't hold my breath on this.. I've a feeling that it won't change that much.
I'll keep you posted 🙂
Thanks again for the prompt feedback, much appreciated!
Was there ever a solution on this? we have the same problem, visitors are identified as unknown until refresh the page we only want to show chat to people in a targeted segment, so need to know who they are and not hope that they refresh the page, on a single page application