Visitor Identification API trouble

Hi @GVASSELIN

I might need to get some more information regarding your specific case, but here’s some guidance in the meantime:

In general, I would recommend setting window.hsConversationsSettings.loadImmediately = false before loading your HubSpot Tracking Code (assuming you’re already using the JavaScript Tracking Code as part of your chatflow install). For example, with this modification, your HubSpot Tracking Code install script might look something like this:

<!-- Start of HubSpot Embed Code -->
<script>
 window.hsConversationsSettings = {
 loadImmediately: false
 };
</script>

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

Effectively what we’re doing here is ensuring any chatflows that meet a “Target” criteria set in the HubSpot web UI don’t automatically load as the page loads. This gives you an opportunity to identify the visitor using identificationEmail and identificationToken before loading the chatflow widget. For example:

window.hsConversationsSettings = {
 identificationEmail: "example@test.com",
 identificationToken: "TOKEN-FROM-API"
};

window.HubSpotConversations.widget.load();

I’ve tested this approach and it successfully leads to the visitor being identified in the HubSpot conversations inbox. Hope this points you in the right direction. If not, please provide some more information and I’ll try to help you get to the bottom of it.

All the best,

Zach

P.S. Thanks for the nudge @dennisedson :grinning_face_with_smiling_eyes: