managed-components / hubspot

Managed Component for Hubspot
Other
1 stars 3 forks source link

Use `manager.fetch` for forms #1

Closed Manouchehri closed 1 year ago

Manouchehri commented 1 year ago

Instead of doing a POST request on the client side, this MC should ideally use the https://api.hsforms.com/submissions/v3/integration/submit/:portalId/:formGuid endpoint with manager.fetch for submissions.

https://github.com/managed-components/hubspot/blob/f3d09fde7f11f60027389e5a479b15db7837186e/src/index.ts#L171-L184

I can't find any docs on the hubspot.com/collected-forms/submit/form endpoint, so not sure why that was chosen initially.

Manouchehri commented 1 year ago

Basically the same issue as https://github.com/managed-components/facebook-pixel/pull/5.

bjesus commented 1 year ago

As I wrote elsewhere, this doesn't seem to be a bug actually. Not everything can be done server-side, as much as I wish that was the case... It depends on the tool vendor to process these requests properly.