# Update email in tracking\_code\_api/identify\_visitor

**URL:** <https://community.hubspot.com/t/update-email-in-tracking-code-api-identify-visitor/11453>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [December 4, 2018, 4:54pm UTC](https://community.hubspot.com/t/update-email-in-tracking-code-api-identify-visitor/11453 "2018-12-04T16:54:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [December 4, 2018, 4:54pm UTC](https://community.hubspot.com/t/update-email-in-tracking-code-api-identify-visitor/11453/1 "2018-12-04T16:54:56Z")

</div>

When a user compiles a form I send \_hsq.push([“identify”,{ email: XXX }]); and then via API I create a Contact.

What happens if a user first send a form with [name@email.com](mailto:name@email.com) and later send another form (without deleting cookies) with [secondname@email.com](mailto:secondname@email.com)? Both times I issue the \_hsq.push, two Contacts are created in HubSpot (as emails are different) but it looks like the first one get pageviews in his activities. It looks like the second \_hsq.push does ot update the value. Could you please confirm this?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [December 5, 2018, 10:11pm UTC](https://community.hubspot.com/t/update-email-in-tracking-code-api-identify-visitor/11453/2 "2018-12-05T22:11:25Z")

</div>

Welcome, @pmonte!

Yes, that is expected behavior. The `identify` function relies on the `email` value to identify contacts, so passing an unknown email will create a new contact.

Is there a reason you’re using the `identify` method on your forms instead of the [Forms API](https://developers.hubspot.com/docs/methods/forms/submit_form_v3)? This API is better-suited to forms and allows you to update a contact’s email address by passing the `hutk` cookie token value.
