APIs & Integrations

John_Rau
Member

Submit form via API call

Hi, I am following the instructions at https://developers.hubspot.com/docs/methods/forms/submit_form

I have a form at https://www.fusebill.com/saas-metrics-calculator, 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!
John

8 Replies 8
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Submit form via API call

Hi @John_Rau,

I’ll DM you with some more info.

0 Upvotes
John_Rau
Member

Submit form via API call

@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 : "john.rau@gmail.com"
hs_context :
hutk : "156bea501728d92ed41d3b0743b5482f"
ipAddress : "192.0.132.3"
pageName : "SAAS Metrics Calculator"
pageUrl : "https://www.fusebill.com/saas-metrics-calculator"
redirectUrl : “”

0 Upvotes
John_Rau
Member

Submit form via API call

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

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Submit form via API call

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

0 Upvotes
paul909
Participant

Submit form via API call

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.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Submit form via API call

Hi @John_Rau,

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

0 Upvotes
John_Rau
Member

Submit form via API call

Hey Derek,

Here is one contact that was created via this form call but no web activity recorded before/after the form call. https://app.hubspot.com/contacts/547412/contact/24790501/?interaction=note

Thanks for your help!

0 Upvotes
John_Rau
Member

Submit form via API call

0 Upvotes