Issue with getting form submissions cookie'd correctly



We have implemented the code as per the below link

In the following forms

As per my client we are getting the following issue

We are having issues with Cookie’ing users after they fill out the forms located on the above forms.

It seems that on the above screenshot there is an issue with the API call. Can we look into it?

The main thing we want is to make sure we are Cookie’ing users so we can follow them throughout the website.

Yes, when they users fill out the forms they are getting in our contact records, but the cookie will help us deduplicate and track these users when they navigate across the website.

There currently is an issue with the Forms API. It should be adding a Cookie to the user’s browser history, but it is currently failing as reflected here:

Can you please look into this and let me know the solution


Hi @anil.sharma,

I checked the links to you posted (thanks for the detail) and it seems like cookie is getting dropped in the visitor’s browser correctly. What appears to be missing is the association between the cookie and the email address. Do you have an example of the POST body you are sending into HubSpot?

I believe the messages error may be related (it’s a symptom of not being able to associate the cookie to a contact record) but is not the root of the problem.



Hi @zwolfson

Here is the example of post body we are sending into HubSpot:




Hey @anil.sharma,

It looks like the hs_context is getting double encoded which is why the cookie isn’t getting associated properly. Then end result should look more like:



Thanks, @zwolfson this fixed my issue.