APIs & Integrations

raylenmargono
Mitglied

How to manually stamp utm using the javascript api?

hi,

 

We are using SSO during registration and it strips away the UTM information on redirect. To work around this we are storing the utm information in cookies and serving it through the library for other tracking tools.

 

What's the recommended way to manually stamp the UTM information for a user?

 

Thank you!

 

0 Upvotes
2 Antworten
Willson
HubSpot Employee
HubSpot Employee

How to manually stamp utm using the javascript api?

Hey @raylenmargono 

 

Assuming you're looking to pass these UTM params when the registration is creating contacts in HubSpot, your best bet is to use our Forms API so that you can pass the pageUri /w UTM parameters and also pass the hutk with our context parameter. 

 

This parameter allows you to pass specific data such as:

"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"

The hutk is the cookie aspect to do with our tracking code which, when creating a contact will update the source to match the conversion source.

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
raylenmargono
Mitglied

How to manually stamp utm using the javascript api?

Hi @Willson ,

 

Thank you for your quick response - i appreciate it. Sorry for the confusion was wondering if there was a way to do this with the tracking api on the browser.

 

https://legacydocs.hubspot.com/docs/methods/tracking_code_api/tracking_code_overview

0 Upvotes