How to identify a contact in the chat?


#1

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


#2

Hi Lukasz,

I am having the exact same issue.
I'm interested if you found a solution !

Thanks,
Romu


#3

Hi @LukaszWiktor and @Romusc,

The "identify" method of the Tracking Code API only stores the identity information in the tracker; you'll need to call the "trackEvent" or "trackPageView" method to actually pass the identity info to HubSpot. Are you both subsequently calling one of these events?


#4

Hi @Derek_Gervais,

Thanks for the hint! I was only calling identify. Now, I added trackPageView right below but it still didn't help. My code snippet looks like this:

<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/1234567.js"></script>
<script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(["identify",{
         email: "user@example.com",
    }]);
    _hsq.push(["trackPageView"]);
</script>

I have this user already in my Contacts but when they start a chat conversation then it shows up as "Unknown Visitor" :frowning:


#5

Hi @LukaszWiktor,

Is this true even after a page refresh? My gut tells me that the contact identification is working, but the messages client isn't being updated with the identity info. Can you try making the association, then refreshing?


#7

Hiii
I have same issue but after refreshing it's identified in chat conversation. I have SPA in Angular 5. Any other solution for Why should i have to refresh.??


#8

Hi
I have the same issue

<!-- Set up the path for the initial page view -->
<script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(["identify",{
        email: '{{ app.user.email }}',
        id: '{{ app.user.id }}'
    }])
    _hsq.push(["trackPageView"]);
</script>

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/portal_id.js"></script>
<!-- End of HubSpot Embed Code -->

#9

Did you find any solution?


#10

No,
it is not possible.

The chat and analytics are two different systems and they don't communicate each other.

I had to use another chat provider :frowning:


#12

Hi!

Could you tell me which chat provider you use?


#13

Hello, we have the exact same issue. We want to identify the conversations, but instead we only get "Unknown Visitor".

Any solution for this ?


#14

Any updates on this?

My problem is that I need to re-identify my users upon logout / another login, but it seems that the first identify is stucked, and when the chat widget opens, the previous history shows up, and the messages goes in the name (email) of the first identified user no matter if I call again the window._hsq.push([ "identify", { email: .. } ]). What is the proper way to re-identify the chat so I could handle my single page app logout/login process?


#15

@Derek_Gervais I'm using Forms API to submit hubspotutk along with contact name/email/ip upon login, yet I still need to refresh for the contact to be recognized by the bot.

When the user was just logged in for the first time, it's still considered an unknown visitor by the bot, and simply one more refresh would solve the issue. It has nothing to do with timing, I tried dynamically loading the script 10 seconds after the page was fully loaded upon login but I still had to refresh one more time to have the bot recognize the contact.