# Visitor Identification API trouble

**URL:** <https://community.hubspot.com/t/visitor-identification-api-trouble/31661>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [February 11, 2021, 4:22pm UTC](https://community.hubspot.com/t/visitor-identification-api-trouble/31661 "2021-02-11T16:22:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zaklein](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zaklein/32/44431_2.png) [@zaklein](https://community.hubspot.com/u/zaklein)\
**Post date:** [February 15, 2021, 12:39pm UTC](https://community.hubspot.com/t/visitor-identification-api-trouble/31661/3 "2021-02-15T12:39:56Z")

</div>

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:

```lia-code-sample
<!-- 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:

```lia-code-sample
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 😄

---

_[View the full topic](https://community.hubspot.com/t/visitor-identification-api-trouble/31661)._
