Note: The following instructions are for the Drupal 6 HubSpot module.

The HubSpot module extends Webform with a new field type ("component"), named "HubSpot POST URL." The module then intercepts any Webform submitted with this field and sends its results to HubSpot, while ignoring any Webform which doesn't contain the field.

To have a Webform's data sent to HubSpot for leads tracking, complete the following steps:

  1. Log in to your HubSpot account. Click the down arrow next to your name then click on Settings. Click the HubSpot Lead API link under Integrations.
  2. Press Add New Form and specify the form name, email list, and lead nurturing campaign as desired.
  3. Submit the form. HubSpot will now provide an API POST URL; save this somewhere.
  4. In your Drupal admin, use the "Add content" page to create a new Webform. Enter as many questions ("components") as you'd like. (See the Webform documentation if you need help.) Set their field keys according to the "Form field keys" section below.
  5. Finally, create a component named "hubspot" with the type "HubSpot POST URL". Supply the API POST URL in the box provided and save the form.

The Webform will now automatically send any submissions directly to HubSpot via the POST URL you provided. You may customize, theme, or alter the form as much as you like, so long as the HubSpot POST URL field remains.

Please note that HubSpot applies a 500-character limit to each form field submitted, so you may want to set the "Maxlength" setting on the Webform fields appropriately.

Form field keys

Each Webform component's "field key" specifies what the field will be named when sent to HubSpot. Certain field keys have significance with HubSpot. For example, submitting a field with the key "FirstName" allows HubSpot to automatically recognize it as the person's first name when displaying the lead information. Here is a list of HubSpot-recognized field keys:

FirstName, LastName, and FullName
Use FirstName or LastName to send those fields separately; send FullName for HubSpot to automatically split the name into first and last names.
Email, Phone, Fax, Website, and TwitterHandle
Specify these field keys to get the user's contact information recognized by HubSpot.
Company, NumberEmployees, AnnualRevenue, and JobTitle
Capture the user's employment information.
Address, City, State, ZipCode, Country
Capture the user's location.
Message
Allow the user to send a custom message.

Specify these as the Field Key when adding components in your form. The field key is not shown to users filling out the form, but only used by HubSpot to display the data; the "Label" field specifies what your users will see.

Note that you may provide other custom fields with any field key you like, if you have other data you wish to collect. HubSpot will store all data sent to it and display it in the "Form Data" tab when viewing each lead.

Also, if you're using HubSpot's Salesforce integration, you must use field keys that correspond to the field's API Name in Salesforce.