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

**URL:** <https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310>\
**Category:** APIs & Integrations\
**Tags:** sdk\
**Created:** [November 2, 2021, 7:09am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310 "2021-11-02T07:09:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreyMatenka](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@AndreyMatenka](https://community.hubspot.com/u/AndreyMatenka)\
**Post date:** [November 2, 2021, 7:09am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/1 "2021-11-02T07:09:13Z")

</div>

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](https://prnt.sc/1y1dscn) our users are still “Unknown visitors”. User still getting email request form even we have identified it. [Screenshot by Lightshot](https://prnt.sc/1y1eb10)

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](https://prnt.sc/1y1f1wb)

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](https://prnt.sc/1y1f1wb) Could you please help us?

Best regards, Andrey

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [November 3, 2021, 3:06pm UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/2 "2021-11-03T15:06:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![YVoloshyn](https://avatars.discourse-cdn.com/v4/letter/y/3e96dc/32.png) [@YVoloshyn](https://community.hubspot.com/u/YVoloshyn)\
**Post date:** [November 12, 2021, 12:39pm UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/3 "2021-11-12T12:39:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rkc](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rkc/32/200145_2.png) [@Rkc](https://community.hubspot.com/u/Rkc)\
**Post date:** [October 2, 2023, 4:57am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/4 "2023-10-02T04:57:46Z")

</div>

Did you solve it

---

<div class="post-metadata">

**Author:** ![AndreyMatenka](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@AndreyMatenka](https://community.hubspot.com/u/AndreyMatenka)\
**Post date:** [November 24, 2021, 7:03am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/5 "2021-11-24T07:03:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [November 24, 2021, 2:21pm UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/6 "2021-11-24T14:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AndreyMatenka](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@AndreyMatenka](https://community.hubspot.com/u/AndreyMatenka)\
**Post date:** [November 24, 2021, 2:32pm UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/7 "2021-11-24T14:32:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [November 24, 2021, 6:17pm UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/8 "2021-11-24T18:17:19Z")

</div>

Hi @AndreyMatenka ,

Your first issue is that the [hsConversationsSettings](https://legacydocs.hubspot.com/docs/methods/conversations_api/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](https://developers.hubspot.com/docs/api/conversation/visitor-identification) 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.

---

<div class="post-metadata">

**Author:** ![JVillano](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@JVillano](https://community.hubspot.com/u/JVillano)\
**Post date:** [April 5, 2023, 1:46am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/9 "2023-04-05T01:46:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![SBruyere](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@SBruyere](https://community.hubspot.com/u/SBruyere)\
**Post date:** [March 29, 2022, 11:39am UTC](https://community.hubspot.com/t/visitor-identification-api-and-window-hubspotconversations-widget-refresh-method/46310/10 "2022-03-29T11:39:43Z")

</div>

Hello @AndreyMatenka ,

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

Thanks
