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.
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.
Note: This external ID can only be used with the HubSpot tracking code. This ID cannot be used to retrieve or update any records through any other HubSpot tools or APIs.