HubSpot API integration with Gravity Forms

A lot of companies use a CRM (Customer Relationship Management) system to manage customers and contacts. A well-known CRM is HubSpot, which is also used by some of our clients. And with Gravity Forms as one of the most used WordPress plugins for creating and managing forms, the perfect combination of collecting and managing data from (potential) customers and contacts. Therefore, a perfect integration between WordPress and HubSpot, through Gravity Forms, is a must for any company that wants a streamlined process. And this is exactly what we have built on at Marketing.

Mike Groot

by Mike Groot

Published: November 16, 2021
Last modified: December 13, 2021

We are not doing anything new, and there are already possibilities to integrate HubSpot into WordPress. But the functionalities are very different and (often) important features are missing or do not work as expected. For example, not all functions work in all HubSpot packages, changing layout and design is limited, a lot of duplicate work has to be done and it’s difficult to apply good SEO and Analytics.

HubSpot WordPress plugin

HubSpot already has a plugin available for WordPress that allows forms from HubSpot to be loaded into WordPress, or data from forms on the website to be forwarded to HubSpot. Now this is of course perfect for getting the data from a contact form directly into the CRM, for example, but there are also a lot of limitations when things get more complex.

The forms that are placed with the official plugin work perfectly together with the data in Hubspot itself, as it is loaded and filled directly from HubSpot. The biggest disadvantage is that the form is displayed using Javascript and iFrames.

This gives a number of implications:

  • No tracking of analytics tools (such as Google Analytics or Google Tag Manager);
  • Design customization is very limited (can only be done from HubSpot itself);
  • While iFrames don’t have a negative impact on SEO, it doesn’t help either.

In addition, only one contact person can be set in the official plugin, which is used for all forms and data. As a result, it is not possible to split entries towards people within your own organization, something that is often desirable for large organizations and most certainly for multinationals.

Of course, the official HubSpot plugin can handle more than just forms, such as managing contacts directly from WordPress. This can be useful when WordPress, or for example Woocommerce, is used as the lead system.

Gravity Forms HubSpot add-on

There is also an extension available from Gravity Forms which has the possibility to forward submissions from your own forms to HubSpot. This has the ability to link data between the form and HubSpot itself (“mapping”), assign contact owners per form and data is sent as if it were HubSpot Forms.

Unfortunately, it also has a major problem; it is unable to fetch data from HubSpot which can be used in the form. For example, select boxes, checkboxes and radio buttons have fixed values in HubSpot which must be copied exactly into your own form. If this does not happen or if a value is incorrect, this will result in error messages and the submission will not arrive in HubSpot.

Our solution

At, in collaboration with our customers, we have developed our own plugin that gives the possibility to forward submissions from Gravity Forms to HubSpot via their API.

Although we have only delivered the first version, and there are still plenty of improvements and new functionalities to be added, the shortcomings of the official plugin and extension have been resolved.

2-way sync

For example, it is possible to link almost all fields in Gravity Forms with HubSpot, including dates, select boxes, radio buttons and checkboxes. With fixed values in HubSpot (as is the case with select boxes) there is the option to indicate that the options are first fetched from the API and automatically filled in the form. This has the great advantage that sent data is always up-to-date and correct, even when changes have been made in HubSpot itself.

Less is more!

Finally, we have chosen to modify Gravity Forms as little as possible, and only send data when Gravity Forms has finished processing. This has the advantage that it works perfectly with other plugins or Gravity Forms add-ons.

A look behind the scenes

But how exactly does the plugin work?

Very little happens in the management part of Gravity Forms; an API key has to be given, and a few extra options have been added to the settings of a form field.

  • Hubspot name: this is the property name used in HubSpot, and this is where the filled in value will be sent.
  • Activate Hubspot: a simple check to indicate that this field should be sent to HubSpot. This makes it possible to request information that is processed within Gravity Forms, but does not have to be forwarded to HubSpot.
  • Format Date Field: since HubSpot processes dates in a specific way, you can specify here to convert the value to the correct format. If a date property in HubSpot is registered as a text field, this is not necessary.
  • Dynamic hubSpot Field: for fields that have fixed values in HubSpot, the data can be retrieved and filled automatically. Very useful for select boxes, radio and checkboxes.

Furthermore, nothing needs to be done, and Gravity Forms works exactly as it normally does. Therefore 100% freedom in how the form looks, how it works and which fields are sent to HubSpot.

The techniques used are also kept simple to avoid problems with other plugins and custom code. For example, only standard hooks (method in WordPress to modify or overwrite code) have been used, and the official API package (package with standardized code) from HubSpot itself has been used. This way we can guarantee that no problems will occur with updates in the future, or that they can be solved very quickly and easily.

Ready to use, now

Our plugin is already running on a number of websites, and more and more of our customers notice that a good integration is necessary. No matter which package of HubSpot is used, even free HubSpot’s Free Tools, it can be used in conjunction with our solution.

Although we currently only use the plugin on websites that we build and manage, we are also working hard to get the plugin ready to make available directly from this website for use on any website.

If you are interested in how our solution can integrate your website and HubSpot, please feel free to contact us.

Shopping Cart