APIs & Integrations

Not applicable

Form API submission doesn't populate page statistics

Hi there,

So I have a certain number of forms to be submitted using the form API and want to attribute the submission to the corresponding landing so the statistic will behave the same as if it is really include in the page. I have managed to get some statistics in terms of form statistics/performance. But the page statistics remains the same for all the time.

I have read and tested as much as I can, but seems no luck to me. The following are the one that I refer the most:

Referring to just the API doc, the best I can do is to put in my own pageUrl and pageName in the submission detail through hs_context. Quite obviously it doesn’t pick up the url as one of the landing pages.

And then I referred to the 2 posts and put in pageId as part of hs_context but no luck. Since I can already put in pageUrl and pageUrl correctly, it doesn’t look like I have included pageId wrongly.

In case it’s really my fault, I have included my data in. This is in PHP.

array (
  'firstname' => 'abcde',
  'lastname' => 'xyz',
  'email' => 'abcde_xyz@gmail.com',
  'hs_context' => '{"hutk":"1d19b71562aac8d35906701ea5d5e3b6","ipAddress":"127.0.0.1","pageName":"enrol-i4-tales-conference","pageUrl":"http:\\/\\/r.aboutmybrain.com\\/enrol-i4-tales-conference","pageId":4592665766}',
)

Another thing I am not sure is that, the API doc said successful requests will give status code 204. But I always get 200 instead. I know they are mostly the same, but if the API said it so explicitly, should I go after 204? or 200 is fine?

Can anyone tell me how could things go wrong in my case?

0 Upvotes
2 Replies 2
Dadams
HubSpot Employee
HubSpot Employee

Form API submission doesn't populate page statistics

Hi @phena109

Do you have a redirectUrl set up for the form you’re using? If you do, the 200 response may be from the page that you’re being redirected to and not from the form endpoint itself (in those cases, the endpoint would return a 302 with the Location header set to the redirectUrl).

For the landing page stats, those don’t update in real time, so the submissions count wouldn’t update immediately after the submission. In general, it would fall under the same delay you’d see for the sources report.

0 Upvotes
Not applicable

Form API submission doesn't populate page statistics

Thanks @dadams,

I only just got the stats today, which is at least more than 1 day away. I hope this is still within the normal range in your experience because the link you provided said between 1~3 hours.

With the 204 code, in my code I didn’t set anything. And as for the form setting page, I set to use thank you statement instead of an address.

thanks,

0 Upvotes