Edit: changed ".com" to ".comm" as "new users can only insert two links in posts".
I have read through majority of the documentation in regard to tracking users and the forms API and I am still having trouble.
What I am trying to do, is overwrite the information in the browser cookie with a new contact. So once a user has logged into my external website with their email, I want to use that email to identify the contact.
To give an idea of my process:
Upon user login, I use the _hsq.push(["identify", { email: "x@y.comm" }]) to identify the new user. Let us assume this creates a new contact. All good so far.
The user navigates to a form which asks for firstname and lastname. Upon submission, the contact being updated is not x@y.com, but the user of a previous session: previoususer@website.comm. I was under the impression the website user had been identified as the former. Not only this, but the form data is autofilled with previoususer@website.comm.
Obviously part of this could be remedied by collecting the email in the form as well, but I'm wondering how to do this without. Essentially, how do I clear the cookie of a previous session and assign a new identity to it?
Just to clarify, my issue is not that the data is not being pushed to HubSpot, it is that the cookie data which autofills forms and such does not update accordingly with the identity.
Just to make sure that we're on the same page, are you triggering an event/page view after calling the identify method? The identify function call stores the data in the tracker, but the data is not actually passed to HubSpot with this call. The data will only be passed when tracking a pageview or an event.