Submit form via API call


Hi, I am following the instructions at

I have a form at, which after you use the calculator, you can enter your email address to see how your metrics compare to industry averages. The idea is when the email address is entered, it will submit a form and create a contact in Hubspot.

I have it working with jQuery and the Hubspot API - it is creating a contact and recording the form submission in Hubspot.

However, it is not recording any of the activity before and after the form is submitted (ie website page views, etc), for that same contact. I am successfully passing the hutk parameter when the form is submitted. I thought that by passing the hutk cookie to the form it would link up the website browsing activity with the form submission all in one contact, but it isn’t.

What am I doing wrong?

Javascript snippet will be sent in a reply to this thread

This contact should have activity before (anonymous activity), and after (recorded activity) in their activity log, as they browsed several pages before and after submitting.

It seems that althouh the form submission is coming through it is not being linked to the cookied activity.

Thanks in advance for anyone’s help!


Javascript code snippet of API call:


Hi @John_Rau,

Can you send me the link to an example contact in HubSpot?


Hey Derek,

Here is one contact that was created via this form call but no web activity recorded before/after the form call.

Thanks for your help!


Is there any solution that can be posted to this?

We’re having this exact same problem. The activity will not show up in the contact but the code returned is always 203 along with all the data being set correctly.

Is it hs_context related? I cant seem to find a solution.


Hi @John_Rau,

Based on the submission data for that contact, the hs_context parameter was malformed on submission. That’s why there’s no tracking info, since the hubspotutk parameter wasn’t associated properly. Can you send me the raw form submission request you’re making so that I can take a closer look?

@paul09 solutions here are very case-dependent. I’d recommend starting a new topic with an example contact so that I can take a closer look at your exact situation


@Derek_Gervais this is what is being sent:

calculator_average_product_price : "1"
calculator_customers_gained_prev_mo_ : "45"
calculator_customers_lost_prev_mo_ : "5"
calculator_number_of_customers : "23"
email : ""
hs_context :
hutk : "156bea501728d92ed41d3b0743b5482f"
ipAddress : ""
pageName : "SAAS Metrics Calculator"
pageUrl : ""
redirectUrl : “”


I should note the values under hutk are part of that object:


Hi @John_Rau,

I’ll DM you with some more info.