Identify Visitor by email - cross domain

Highlighted
New Contributor

Someone visits Domain-A  and then Domain-B, both of them have HubSpot tracking code, Domain-A has a signup form, Domain-B is where our app lives, so we have a login event (and we know the user by his/her email address).

 

What's the best way to identify the user by his/her email address?

 

I found the javascript snippet that allows sending email address.

var _hsq = window._hsq = window._hsq || [];

_hsq.push(["identify",{

   email: user.email
}]);

But i don't want to display user's email address in javascript code of the app on the page where the user would inspect element. It's not a legal thing, just a perception of me leaking his/her personal info.

 

Someone told me this: the recommended use of the "Identify a visitor" API would be to add the API to your portal's API key. Adding this API to your portal this way, being a pull API, should effectively allow this one to communicate with all of your information successfully in HubSpot. Additionally, we should successfully be able to pass the email address along to the tracking pixel on domain-B to properly attribute those page visits through a contact's cookies! .

 

As I can't make sense out of the above, and I do know how to get my API key, I need guidance either as to how to do that or what would be the best way please..

 

The goal is: i want to see visits to Domain-A under the Contact in HubSpot, even though the signup and the login into the app happen after the visit to Domain-A

Reply
0 Upvotes
3 Replies 3
Highlighted
HubSpot Moderator

Hey @gmogs ,

 

I'm not entirely sure how to make sense of that recommendation either, but generally speaking HubSpot uses query parameters to enable cross-domain tracking: https://knowledge.hubspot.com/reports/set-up-your-site-domains#track-multiple-domains-with-cross-dom...

 

Assuming that everything is set up correctly in your account, this should enable a visitor to be tracked between distinct domains. If domain linking is set up correctly, an identification on domain A should work on domain B as well. Cross domain linking is enabled by default, so if you're running into issues with visitor identification I'd recommend confirming that it's set up properly, and contacting out Support team for additional help.

Reply
0 Upvotes
Highlighted
New Contributor

Hey @Derek_Gervais,

Thanks for your reply. Cross-domain tracking is set up correctly. as domain-A is a subdomain of domain-B in this case, and the automatic cross-domain linking is on, no limitations set. additionally, sometimes the tracking is visible under contacts. the question is how to improve it and ensure it is always tracked and linked with the email address. say if someone clears cookies between submitting a form on domain-A and a login on domain-B

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @gmogs ,

 

I understand; thanks for the additional info. There isn't really a fool-proof way to force the identification of website visitors, especially if they're clearing cookies or using privacy plugins. HubSpot's visitor tracking relies entirely on cookies, so those things will interfere with tracking on a single domain as well.

 

General best practices involve making sure you have a number of conversion points accross your site, and that you have cross domain linking enabled. If you're doing those things, then the majority of typical visitors should be properly identified, barring the edge cases we've discussed.

Reply
0 Upvotes