HubSpot Tag Builder

Setting up HubSpot and Google Tag Manager? Generate the code you'll need to integrate them with this free tool. For an explainer, follow along with this guide to HubSpot and Google Tag Manager.

Enter the HubSpot form properties you'd like to reference in Tags by their internal names, separated by lines.
Build tags
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Where can I find the internal names for HubSpot contact properties?
Be sure to verify that updates work properly before publishing to Google Tag Manager.
Step 1

Install the HubSpot tracking code

If you're already using HubSpot, you've probably already done this. The HubSpot tracking code is essential for sending website traffic data to HubSpot. You can install this code in various ways, including through Google Tag Manager. Follow the steps provided in this HubSpot support document for guidance.

Step 2

Add a Form Listener Tag

Over in Google Tag Manager, set up a Tag that "listens" for form submissions in GTM.

Set the Tag Type to Custom HTML and paste the following code. (You shouldn't need to change anything.)

Install Custom HTML...

See an example form listener tag, here.

Step 3

Track form submits with a Form Submit Trigger

Still in Google Tag Manager, create a Trigger that fires when somebody submits a form. All your other tools that need to know about form submissions — like Google Ads and Meta Ads — will reference it.

In Trigger Configuration, select Custom Event and set Event Name to hbsptFormSubmit. Set it to fire on all custom events.

See an example form submit trigger, here.

Step 4

Track form fields with Custom Property Variables

Now, create Google Tag Manager Variables for each HubSpot form field you want to track. You can reference these variables in Tags.

See an example property variable, here.

Get in touch

Want to learn more? Let's get in touch.