APIs & Integrations

LukaszWiktor
Participant

How to identify a contact in the chat?

Résolue

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

1 Solution acceptée
tilly
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

How to identify a contact in the chat?

Résolue

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.

Voir la solution dans l'envoi d'origine

116 Réponses
Dexter_Chen
Membre

How to identify a contact in the chat?

Résolue

@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.

Non applicable

How to identify a contact in the chat?

Résolue

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?

6CMarketing
Participant

How to identify a contact in the chat?

Résolue

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

Any solution for this ?

0 Votes
Vinicius_Pavei
Membre

How to identify a contact in the chat?

Résolue

Did you find any solution?

0 Votes
Dimo_Boyadzhiev
Membre

How to identify a contact in the chat?

Résolue

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:

Vinicius_Pavei
Membre

How to identify a contact in the chat?

Résolue

Hi!

Could you tell me which chat provider you use?

0 Votes
Dimo_Boyadzhiev
Membre

How to identify a contact in the chat?

Résolue

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 -->
0 Votes
Non applicable

How to identify a contact in the chat?

Résolue

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.??

0 Votes
Derek_Gervais
Ancien salarié HubSpot
Ancien salarié HubSpot

How to identify a contact in the chat?

Résolue

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?

0 Votes
Derek_Gervais
Ancien salarié HubSpot
Ancien salarié HubSpot

How to identify a contact in the chat?

Résolue

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?

0 Votes
LukaszWiktor
Participant

How to identify a contact in the chat?

Résolue

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:

Romusc
Membre

How to identify a contact in the chat?

Résolue

Hi Lukasz,

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

Thanks,
Romu