Problems Passing Tracking Cookie to Forms


Hi we are having issues passing the “htuk” parameter with the “hs_context” header. Essentially this has not been passed with our leads for 18months so we have 50K leads with their source as “Direct Traffic” which is exceptionally unhelpful in tracking the origination of our leads. So I am working with our developers to deploy a fix.

Thus far have not had any success fixing the problem. We are working in a test environment and pulling a cooking from a new browser to pass and create a new lead in hubspot. Here is a screenshot of the command line showing the call as undertaken by our developer. Engineering is reluctant to push to production until we can confirm it is working in a test environment.

Any help or guidance would be greatly appreciated.



Hey Brendan,

The issue you’re having is that you need to pass up the value of hs_context as a JSON string rather than as a URL encoded object. Just a small change to your python like this should be able to sort you out:

import json

jsonEncodedContext = json.dumps(hs_context_object)
user_data['hs_context'] = jsonEncodedContext

I hope that helps,

  • Engineer, HubSpot Forms