Submit form via API call


#1

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


#2

Javascript code snippet of API call: https://gist.github.com/raujohn/0a1379219d0acd6b244f6f88ac705872


#3

Hi @John_Rau,

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


#4

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!


#5

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.


#6

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


#7

@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 : “”


#8

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


#9

Hi @John_Rau,

I’ll DM you with some more info.