Custom form tracking

GrowthDrive makes it super easy to track referral links via any form created in HubSpot. Be it an embedded form, pop-up form or book a meeting form. No coding required.

If you would like to track  signups for a custom form for example if you run a SaaS project and use a custom form for account creation, the cleanest way would be

integrate that form with HubSpot. This not only enables you to track GrowthDrive referral links, but it also helps you to correctly track signup sources inside of HubSpot. That

is valuable for automation and reporting.

Here are the steps to integrate your custom form with HubSpot:

1. Add HubSpot tracking code to the page which contains your custom form

Simply add the HubSpot tracking code to the page you want to track. Read this HubSpot guide to learn how.

2. Create a form in HubSpot which would include form fields you would like to integrate

The form you create in HubSpot just need to include email and optionally any other field you would like to integrate with HubSpot. Learn in this HubSpot guide how to create forms.

3. Send POST request on form submission

On form submission send POST request to this URL https://api.hsforms.com/submissions/v3/integration/submit/{portalId}/{formId} - where portalID is theID of your HubSpot portal and can be found in Hubspot URL. The form ID Is ID of the form you have created in step 2 and also can be found in the Hubspot URL while editing your HubSpot form.


Body data of request (example):

fields: [

      { objectTypeId: '0-1', name: 'email', value: user.email },

      { objectTypeId: '0-1', name: 'firstname', value: user.firstName },

      { objectTypeId: '0-1', name: 'lastname', value: user.lastName },

],

context: {

      hutk: cookies.get('hubspotutk'),

},

Fields is an array of all inputs of the HubSpot form, which we want to fill from the custom form. Field object consists of objectTypeId, which should have always value ‘0-1’ (it means that it is contact property), name, which is unique name of the HubSpot form fields and value, which is value filled by user on your custom form.

Context is an object which needs to have one important value and its hutk. Value of this property is stored as a cookie, and it is generated automatically by HubSpot script added in step 1. This property is a unique ID, which is stored by HubSpot and it has related all UTM data for tracking purposes.

Alternative way to track custom forms - the non-HubSpot forms feature

A quick an non-technical way to track your custom form would be to active the non-HubSpot forms tracking inside of forms settings in HubSpot. This method is fast and easy but less accurate. You can integrate only text fields to your HubSpot account and in case multiple users submit the custom form on the same browser their data might get overwritten. Learn more about Non-HubSpot forms here.

Submit a request

You miss a feature or something is not working?