Identify a visitor

_hsq.push(["identify", { {identity details} }]);

Identify a visitor. This function can be used to identify a visitor by email address.  If there is an existing contact record with a matching email address, the existing contact will be updated.  Otherwise, a new contact record will be created.  In both cases, the analytics data collected for the visitor will be associated with the contact record.

This function can also be used to update other contact properties as well.

Note - There are a few things to keep in mind when using this function:
  • This 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 (with either the trackPageView or trackEvent functions).
  • You must include an email address to tie the data to a contact.  Custom properties can be updated with this function, but only an email will associate the data with a contact.

In addition to identifying a record by email address, you can also use a custom external id to identify a visitor, by simply using 'id' as the identifier.  As with email, identifying a record using 'id' will associate the analytics data for the visitor with that id.  However, unlike with an email address, including an 'id' by itself will not create a contact. Also, this 'id' is treated as a completely external identity, so while analytics data can be associated with a specific contact record by the id (if, for example, you've previously identified a record by id and by email, or the record was previously identified by id and the visitor also has a form submission), the contact record cannot be looked up by this id.