APIs & Integrations

parkeristyping
Member

Landing page not tracking submission via Forms API

I am using the Forms API to submit a form on a HubSpot page.

I believe I’m submitting all of the suggested tracking data, and the form submission shows up correctly on the Contact record (with the title of the landing page it was submitted on). However, it does not seem to be registering as a submission for the landing page.

Is this the expected behavior? Any way to get it to register as a submission for the landing page?

Example payload to Forms API:
URL: https://forms.hubspot.com/uploads/form/v2/2000420/c539b52e-fake-fake-fake-d11ad48c0ce6
METHOD: POST
DATA TYPE: application/x-www-form-urlencoded
BODY: infinity_vid=abea4010-fake-fake-9c0c-7bd298fd7e6f&zip=10009&system_type=system_type_takeover&has_smartphone=has_smartphone_true&feature_interest=feature_interest_enviro%3Bfeature_interest_video&protection_interest=protection_interest_pets&property_type=property_type_rental&firstname=Test&lastname=User&email=test%2Btest%40example.com&hs_context=%7B%22hutk%22%3A%22%22%2C%22ipAddress%22%3A%22170.122.11.100%22%2C%22pageUrl%22%3A%22https%3A%2F%2Fpages.livewatch.com%2Fsimplisafe-new-lf-qa%22%2C%22pageName%22%3A%22Compare+to+Simplisafe±+LF+QA%22%7D

What I see on the contact, and on the landing page:

8 Replies 8
Jason_Feng
Member

Landing page not tracking submission via Forms API

Hi @dadams–Do we need to make these pages using the Hubspot CMS in order to track form submissions via custom forms? How would you recommend doing form tracking in Hubspot campaigns if we’re using a custom form? (see www.namely.com/demo/)

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Landing page not tracking submission via Forms API

Hi @parkeristyping

You can include the pageId parameter in hs_context to count the submission towards the HubSpot page. The pageId needs to be the content ID of the page you’re working with.

0 Upvotes
cyellowleesboun
Member

Landing page not tracking submission via Forms API

Hi @dadams

We’re experiencing a similar problem, and we want to try and implement this as a fix. However, we’re not sure how to find the “content ID” that you’ve referenced. If the pageID needs to be the content ID, where do we find / get the Content ID? Thanks.

0 Upvotes
parkeristyping
Member

Landing page not tracking submission via Forms API

‘{{ content_id }}’ did it for me.

You can also just edit the page and it will be the ID in the URL.

0 Upvotes
cyellowleesboun
Member

Landing page not tracking submission via Forms API

Great, we’ll take a look, thanks.

0 Upvotes
parkeristyping
Member

Landing page not tracking submission via Forms API

Cool. Thanks for the quick reply @dadams!

0 Upvotes
parkeristyping
Member

Landing page not tracking submission via Forms API

Actually quick follow-up @dadams. A or B?

A: “pageId”: "12345"
B: “pageId”: 12345

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Landing page not tracking submission via Forms API

The ID should be a number, so B: "pageId": 12345

0 Upvotes