Visitor Identification API and window.HubSpotConversations.widget.refresh() method

Hi,

I have a question about “Visitor Identification API”.

We are trying to implement it on our react app. We have two types of page. Login page for not logged users and private pages for users who have logged. We start hubspot chat on first init of our app. And then when the user logged in we need to identify him. After user logged in we save token and email to this object window.hsConversationsSettings and tried to refresh the widget with window.HubSpotConversations.widget.refresh() method. But it doesn’t work. Also we tried to use another combination window.HSC.widget.remove() and window.HSC.widget.load() methods. But it also doesn’t work Screenshot by Lightshot our users are still “Unknown visitors”. User still getting email request form even we have identified it. Screenshot by Lightshot

We managed to do it only with this method window.HubSpotConversations.resetAndReloadWidget(). But when we use it we have another problem. After user logged in we lost conversation and got two different messages in our Inbox Screenshot by Lightshot

So here is my question: Is there way to refresh/reload widget and don’t lost conversation? We don’t want to get splitted messages from the same user Screenshot by Lightshot Could you please help us?

Best regards, Andrey

@himanshurauthan , any chance you could assist with this one?

Thank you!
@himanshurauthan we would really appreciate your help!

Did you solve it

Is there chance that we can get help with it? @dennisedson @himanshurauthan

@Teun , you are friends with React :grinning_face:. Maybe you can help.

Honestly it is not about React. Mostly it is about “Visitor Identification API”. I asked the same question for support team. As support are not trained developers, they recommended me that any queries on custom coding and custom API be directed to this design forum.

Could you please tell me where I can get qualified dev consultation?

Hi @AndreyMatenka ,

Your first issue is that the hsConversationsSettings can only be used before the Conversations API has loaded.

The second issue is that the resetAndReloadWidget function will reset the current chat, which causes multiple conversations to show up.

The guide that uses the visitor identification API only describes a use-case where you only load the chat widget once the user has logged in. So there is the real problem. You can not identify the user without removing and reloading the widget, which causes multiple threads to show up.

Was this ever resolved? Does that mean that hubspot cannot combine the chat if we reload the widget after adding in the token to hsConversationsSettings?

Hello @AndreyMatenka ,

I’m running into the exact same problem, did you found a solution for this problem?

Thanks