There's a new version of the HubSpot API

We're also working on a new documentation website, you're invited to check it out and give us your feedback.

Get cross-domain linking parameters

Last updated June 17, 2020

_hsq.push(['addIdentityListener', function(hstc, hssc, hsfp) {}])

Allows you to get the parameters needed to create cross-domain links. This will allow you to build links that support cross-domain tracking for links added after the page loads, or links that function using JavaScript instead of standard anchor tags. 

The HubSpot tracking code can be used across multiple sites with separate domains. This function will allow you to get the query parameters required to create create links that will allow you to track your visitors across those separate domains. These query parameters are used by the HubSpot tracking code to identify a visitor across domains by ensuring that the separate cookies for the separate domains are merged to a single tracked visitor.

Note: Cross-domain links are only needed when linking to a distinct domain (e.g., and that is also being tracked for a single HubSpot account. HubSpot tracking cookies are set at the domain level (, so visits between subdomains ( and should not need the cross-domain link parameters.

Note: Cross-domain links are automatically set up by the HubSpot tracking code on load, so you should only need to update links that are dynamically added to the page after the tracking code is loaded.