APIs & Integrations

pmonte1
Member

Update email in tracking_code_api/identify_visitor

SOLVE

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 and later send another form (without deleting cookies) with 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?

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Update email in tracking_code_api/identify_visitor

SOLVE

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? This API is better-suited to forms and allows you to update a contact's email address by passing the hutk cookie token value.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
1 Reply 1
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Update email in tracking_code_api/identify_visitor

SOLVE

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? This API is better-suited to forms and allows you to update a contact's email address by passing the hutk cookie token value.

Isaac Takushi

Associate Certification Manager
0 Upvotes