Hubspotutk Tracking

Hello everybody, How are you?
Just wanted to ask a question that I would greatly appreciate any insights onHere is a bit of context:
Currently in our website We have Free trial redirect that will send our users into the form in a auth0 website. After the user either logs in/signs up, then they are redirected to another website that communicates with our main website as they have the same root domain.
Our problem lies that when a user does not accept cookies in the main website, then goes to the free trial log in/sign up page (auth0) Hubspot recognizes this lead as an Offline source due to being first introduced through the API instead of Direct traffic.
Could we communicate the hubspotutk cookie in the auth0 form API so we are able to describe our users’ sources accurately?
I would greatly appreciate any insights you can provide!

Hey @AlejandroVieira,

You can use the Forms API to pass through this information. It’s done using the “context” object when submitting your form to HubSpot. The “context” object contains information relating to the submission - particularly the user token/cookie which is used for source attribution and metadata relating to the page title and URL.

"context": {
 "hutk": ":hutk", // include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission
 "pageUri": "www.example.com/page",
 "pageName": "Example page"
 }

Doing this should stop the issue with offline sources. HubSpot will then categorise original source based on the table below. More information here.

One thing to note is the message above, if they’re not accepting cookies or using adblocker then they will continue to come through as an offline source. There is no way to combat that. You can setup workflows to update the Original Source so potentially setting up a workflow to manually update to help your source reporting.

Best of luck with the project! :blush:

Thank you so much for the help!!
Now I know that through the Forms APi i’m able to retrieve the hutk cookie, was wondering if this was possible to do with some of the more recent APIs Hubspot has released or is the FormsAPI the only viable source to get this done?
Thank you!!

Hey @AlejandroVieira,

No problem - happy that it helped! :blush: There are three ways to associate a visitors browser cookie with their record in HubSpot.

  1. Forms API - Included within the context parameter in your request body.
  2. Timeline API - This is used by integrators to create events describing something that happened on an external system. For instance if someone registered or attended an event. When creating these events you associate them to CRM records using the object ID but for contacts you can also use the hutk. It’s described in a bit more detail in the documentation.
  3. Tracking Code API - You can use the identify() function to associate a cookie to a contact in the CRM, you need to ensure you have the users email address when you make the call.

Outside of the above APIs there is no other way to retrieve or pass the user token (cookie) into HubSpot.

Hope it helps!