# Which API to Identify a User?

**URL:** <https://community.hubspot.com/t/which-api-to-identify-a-user/37541>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [May 18, 2021, 8:43pm UTC](https://community.hubspot.com/t/which-api-to-identify-a-user/37541 "2021-05-18T20:43:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgoggin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kgoggin/32/58551_2.png) [@kgoggin](https://community.hubspot.com/u/kgoggin)\
**Post date:** [May 18, 2021, 8:43pm UTC](https://community.hubspot.com/t/which-api-to-identify-a-user/37541/1 "2021-05-18T20:43:03Z")

</div>

I’m working on integrating analytics and the chat bot on our app, which has authenticated users. I’m unclear on what’s the “correct” way to identify to the logged in user for the sake of both analytics and the chat window. Should I be calling the identify event via the [Tracking Code API](https://developers.hubspot.com/docs/api/events/tracking-code), or using the [Visitor Identification API](https://developers.hubspot.com/docs/api/conversation/visitor-identification), or both? TIA for any help!

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 19, 2021, 7:51pm UTC](https://community.hubspot.com/t/which-api-to-identify-a-user/37541/2 "2021-05-19T19:51:49Z")

</div>

@himanshurauthan , do you have advice for @kgoggin ?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 20, 2021, 12:47pm UTC](https://community.hubspot.com/t/which-api-to-identify-a-user/37541/3 "2021-05-20T12:47:38Z")

</div>

Hi @kgoggin,

It depends more on your use case, so if you are using a chatbot on your app, even if the user is logged in identified user, all the chat will be shown as Unknown visitor in the conversation inbox, and by Using the Visitor Identification API, you can pass authenticated visitor information directly to the chat widget, which identifies them in the Conversations inbox.

On the other hand, the Tracking Code API allows you to dynamically create events and track event data in HubSpot

Hope this helps (don’t forget to mark it as a solution).

Regards,

---

<div class="post-metadata">

**Author:** ![kgoggin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kgoggin/32/58551_2.png) [@kgoggin](https://community.hubspot.com/u/kgoggin)\
**Post date:** [May 21, 2021, 1:07pm UTC](https://community.hubspot.com/t/which-api-to-identify-a-user/37541/4 "2021-05-21T13:07:05Z")

</div>

Thanks @himanshurauthan. So, if I’m using \_both\_ the chat bot and the tracking API, it sounds like I need to identify my users using \_both\_ APIs. That’s the way I’ve got it set up right now and it seems to be doing okay. Just wanted to make sure I wasn’t over-complicating things. Thanks!
