Advice on correctly identifying a contact's Original Source / Cross Domain Linking
SOLVE
Hi there!
Been working with a wonderful support rep, but we haven't been able to solve my problem. Hoping maybe we can get some different insights here as it's a bit tricky.
Main problem: I'm trying to get the Original Source contact property to be more descriptive. Currently most of the contacts on our new platform have an Original Source of Offline/API whereas they should be Organic Search, Paid Traffic, etc. I suspect it's because cross domain linking isn't set up properly/facing some troubles. Tried the recommended steps, but no luck yet!
What our setup looks like:
-Legacy platform + Marketing website are on the domain "platform.com" (using hubspot forms, landers, and the tracking code)
-New platform is on the domain "platform.cloud" (when you go to the main site - app.platform.cloud, an automatic redirect takes you to auth.platform.cloud that is hosted by our 3rd party login service, Auth0. When you login on auth.platform.cloud, you will get redirected back to app.platform.cloud.) For pipelining data on our new platform, we use a 3rd party service called Segment. The first sign of a new signup/contact being recorded in Hubspot occurs when someone signs up on the Auth0 sign up screen. That payload gets fired from Auth0 -> Segment -> Hubspot.
The platform is a single page application, and I've installed the tracking code on both app.platform.cloud and auth.platform.cloud. Additionally, I've added the .cloud domain in my Hubspot setting and toggled the cross domain linking to ON.
People can get to the new platform by going directly to the link app.platform.cloud or via the marketing website (platform.com ->> app.platform.cloud)
I'm seeing Direct Traffic from Auth.platform.cloud/login whereas I'm expecting something like "Organic Search".
Side note - Even if the cross domain linking was working correctly, I'm wondering if it'll record the actual source of this contact since that's held on the cookie, but we're creating the contact via Auth0 -> Segment.
Advice on correctly identifying a contact's Original Source / Cross Domain Linking
SOLVE
Yes, you need to manually build the authorize url rather than use Auth0's built in library. Using their library will truncate the Hubspot tracking params. Make sure you have all domains for cross domain linking registered on Hubspot, and you have the tracking code snippet on your app, Auth0 lock screen, etc. Should work from there!
// Create params object to get url parameters from marketing source
const urlParams = new URLSearchParams(window.location.search);
// see if hubspot params exist and add to local storage
if (urlParams.has('__hsfp') && urlParams.has('__hstc') && urlParams.has('__hssc')) {
localStorage.setItem('__hsfp', urlParams.get('__hsfp'));
localStorage.setItem('__hstc', urlParams.get('__hstc'));
localStorage.setItem('__hssc', urlParams.get('__hssc'));
}
/**
* Manually build the auth() url
*/
const manualAuthorize = () => {
const domain = [your auth0 domain]
const clientID = [whatever client ID you use]
const redirectUri = [whatever redirect url you use]
const state = uuidv4();
const nonce = uuidv4();
const responseType = [your response type]
const scope = [your scope]
const audience = [your audience]
const options = {
responseType,
nonce,
state,
};
// create transaction
auth.transactionManager.process(options);
// build the base url
let url = `https://${domain}/authorize?response_type=${responseType}&state=${state}&nonce=${nonce}&scope=${scope}&client_id=${clientID}&redirect_uri=${redirectUri}&audience=${audience}`;
// see if hubspot params exist and add
if ('__hsfp' in localStorage && '__hstc' in localStorage && '__hssc' in localStorage) {
const hsfp = localStorage.getItem('__hsfp');
const hstc = localStorage.getItem('__hstc');
const hssc = localStorage.getItem('__hssc');
url = url.concat('&__hsfp=', hsfp, '&__hstc=', hstc, '&__hssc=', hssc);
}
// redirect
window.location.assign(url);
};
Advice on correctly identifying a contact's Original Source / Cross Domain Linking
SOLVE
Yes, you need to manually build the authorize url rather than use Auth0's built in library. Using their library will truncate the Hubspot tracking params. Make sure you have all domains for cross domain linking registered on Hubspot, and you have the tracking code snippet on your app, Auth0 lock screen, etc. Should work from there!
// Create params object to get url parameters from marketing source
const urlParams = new URLSearchParams(window.location.search);
// see if hubspot params exist and add to local storage
if (urlParams.has('__hsfp') && urlParams.has('__hstc') && urlParams.has('__hssc')) {
localStorage.setItem('__hsfp', urlParams.get('__hsfp'));
localStorage.setItem('__hstc', urlParams.get('__hstc'));
localStorage.setItem('__hssc', urlParams.get('__hssc'));
}
/**
* Manually build the auth() url
*/
const manualAuthorize = () => {
const domain = [your auth0 domain]
const clientID = [whatever client ID you use]
const redirectUri = [whatever redirect url you use]
const state = uuidv4();
const nonce = uuidv4();
const responseType = [your response type]
const scope = [your scope]
const audience = [your audience]
const options = {
responseType,
nonce,
state,
};
// create transaction
auth.transactionManager.process(options);
// build the base url
let url = `https://${domain}/authorize?response_type=${responseType}&state=${state}&nonce=${nonce}&scope=${scope}&client_id=${clientID}&redirect_uri=${redirectUri}&audience=${audience}`;
// see if hubspot params exist and add
if ('__hsfp' in localStorage && '__hstc' in localStorage && '__hssc' in localStorage) {
const hsfp = localStorage.getItem('__hsfp');
const hstc = localStorage.getItem('__hstc');
const hssc = localStorage.getItem('__hssc');
url = url.concat('&__hsfp=', hsfp, '&__hstc=', hstc, '&__hssc=', hssc);
}
// redirect
window.location.assign(url);
};
Advice on correctly identifying a contact's Original Source / Cross Domain Linking
SOLVE
This script isn't for the Auth0 lock screen. When a user comes to our website, they get automatically redirected to Auth0 lock. This snippet is used on our app to make sure the parameters stick on the URL when the redirect occurs. Then there's the Hubspot tracking code on our Auth0 lock that will grab those parameters