# Unable to Identify Users

**URL:** <https://community.hubspot.com/t/unable-to-identify-users/17630>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [December 10, 2019, 3:52am UTC](https://community.hubspot.com/t/unable-to-identify-users/17630 "2019-12-10T03:52:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anupbalfour](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anupbalfour/32/44643_2.png) [@anupbalfour](https://community.hubspot.com/u/anupbalfour)\
**Post date:** [December 10, 2019, 3:52am UTC](https://community.hubspot.com/t/unable-to-identify-users/17630/1 "2019-12-10T03:52:12Z")

</div>

Hi everyone,

I am using the below code but the users info is not passing into Hubspot CRM and my users are still showing as unknown visitor. how do i make it automatically create a contact so when responding to my website chats through the hubspot portal i know which user i am talking to by first name without them having to give the bot the first name?

```auto
 <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/<?php echo $hubspotID; ?>.js"></script>
 <script type="text/javascript">
 function onConversationsAPIReady() {
 var _hsq = window._hsq = window._hsq || [];
 _hsq.push(["identify",{
 email: "<?php echo $userEmail; ?>",
 firstname: "<?php echo $userFN; ?>",
 lastname: "<?php echo $userLN; ?>",
 user_id: "<?php echo $userID; ?>",
 project_id: "<?php echo $userProject; ?>"
 }]);
 _hsq.push(['trackPageView']);
 setTimeout( () => {
 window.HubSpotConversations.widget.refresh();
 }, 1000)
 }

 function sendIdentify(){
 window.HubSpotConversations.on('conversationClosed', payload => {
 });
 }

 if (window.HubSpotConversations) {
 onConversationsAPIReady();
 sendIdentify();
 } else {
 window.hsConversationsOnReady = [onConversationsAPIReady, sendIdentify];
 }
 </script>

```

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [December 10, 2019, 6:27am UTC](https://community.hubspot.com/t/unable-to-identify-users/17630/2 "2019-12-10T06:27:38Z")

</div>

Hey @anupbalfour,

It is currently working as expected that if you’re using the[`identify`](https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor), [`trackPageView`](https://developers.hubspot.com/docs/methods/tracking_code_api/track_page_view), and [`HubSpotConversations.widget.refresh()`](https://developers.hubspot.com/docs/methods/conversations_api/widget_refresh) methods and are still seeing chats coming in as “_Unknown Visitors_”.

This is further explained by Isaac here: [https://community.hubspot.com/t5/APIs-Integrations/How-to-identify-a-contact-in-the-chat/m-p/272830/highlight/true#M24773](https://community.hubspot.com/t5/APIs-Integrations/How-to-identify-a-contact-in-the-chat/m-p/272830/highlight/true#M24773) (The accepted solution post).
