Forms

How do I create a custom form to work with HubSpot?

Last updated: July 25, 2018

If you need additional functionality that is not available with standard HubSpot forms, you can work with your developer to integrate your external forms with HubSpot's Forms API.

  • Create a form in HubSpot and get the form GUID from the URL (this appears in the address bar while editing the form). Add the form GUID and your HUB ID to the API Post URL that you will submit the form results to via your server-side form action script.
  • Our API requires the use of a server-side script that executes when a user submits the form. This custom script's url would be added to the action attribute of your HTML form.
  • This custom server side script would post to this endpoint. The POST URL should be updated with your Hub ID and form GUID.
  • In addition to sending the url encoded form data collected from your HTML form fields, the server side script needs to request the user's hubspotutk cookie and other visitor data used to populate the hs_context parameter. With this additional data, HubSpot will be able to record the visitors analytic information.
  • If no IP address is included in a form submission, the IP address will be set to the IP of the system making the request to the Forms API, which might be your own server. This could prevent contacts from being tracked if you've taken steps to filter your own IP address from your analyticsWork with the developer who created your form to make sure it's set up to include the IP address.

You can find documentation on the submit form data endpointFor additional resources, please check out our Developers Forum.

Was this article helpful?

If you still need help you can get answers from the , or to contact support.