APIs & Integrations

felipecalad
Member

Doubts about visitor identity using Visitor Identification API

- When I use the Visitor Identification API, do I still need to use the following code?:

_hsq.push(["identify", hsIdentity]);
_hsq.push(['trackPageView']);

- What should I execute after a known visitor with token logs out from the app? Do I need to clear manually the messagesUtk cookie?

- Using the visitor token as said in the API doc, the callbacks set to hsConversationsOnReady are not running so I needed to create an interval to check the availability of the Conversations SDK to run the widget load/refresh code. ¿Is there anything wrong with the documentation or what might I be doing bad?

0 Upvotes
2 Replies 2
WendyGoh
HubSpot Employee
HubSpot Employee

Doubts about visitor identity using Visitor Identification API

Hey @felipecalad,

 

The visitor identification API is used in conjunction with HubSpot's live chat tool. As such, if you're looking to track page view, you'd still need to use the Events API | Web Analytics.

 

Additionally, 

Please note: For visitors identified with this API, HubSpot will not drop the messagesUtk cookie. HubSpot will also skip any email capture questions since email address is already known. Because the messagesUtk cookie and email capture do not apply to these chats, the associated settings in the chatflow will not show for visitors identified through the Visitor Identification API.
 
As for the third question, do you mind clarifying the concern here? I'm not seeing in the documentation that state that the hsConversationsOnReady aren't running. Am I missing something here?
0 Upvotes
felipecalad
Member

Doubts about visitor identity using Visitor Identification API

Thanks Wendy.

 

1. Ok, I'll use the events API to track page views then.

2. Just to confirm, I do not need to do anything to log out users as long as they still using the Visitor Identification API once they log in again, do I?

3. By some reason the callbacks set to window.hsConversationsOnReady are not running at all. In which situations or why does this callbacks are ignored?

Reference: https://developers.hubspot.com/docs/api/conversation/visitor-identification-api To defer accessing the API until it's initialized, you may use the window.hsConversationsOnReady helper

0 Upvotes