Tracking and data

HubSpot forms and calendar in GTM

HubSpot forms and the meetings calendar use iframes and their own JavaScript events that GTM's standard triggers cannot catch. Correct tracking of HubSpot conversions requires a custom listener.

What gets tracked

  • Form submissions
  • Meetings bookings
  • Embedded or popup calendar

The flow

  • Listener tag
  • dataLayer event
  • Custom Event trigger
  • GA4 generate_lead

Common faults

  • Listener fires late
  • Popup forms missed
  • Double counting
  • API changes

Why standard GTM triggers do not work for HubSpot

GTM's built-in form submit trigger works with regular HTML forms. HubSpot forms load dynamically in an iframe and use their own JavaScript callbacks through the HubSpot Forms API. GTM cannot see what happens inside the iframe with a standard configuration.

The result is that form conversions disappear from GA4 data, Google Ads and Meta Pixel do not get the conversion signals, and your actual lead volume looks lower in every tracking platform.

HubSpot form tracking in GTM

The solution is a Custom HTML tag in GTM that injects a listener through the HubSpot Forms API. The listener catches the form submit event and pushes it to the dataLayer, from where GTM tags for GA4, Google Ads and Meta can fire.

The base code uses window.addEventListener('message', ...) for HubSpot v4 forms and the window.hsFormsOnReady callback for older versions. The tag should trigger on All Pages and run early in the page load.

HubSpot meetings calendar tracking

The HubSpot Meetings calendar generates different event IDs than the standard forms. The listener listens for the message event with the type MEETINGS_BOOKING_SUCCESSFUL. It is the most reliable way to catch completed meeting bookings, whether the calendar widget is embedded on the page or shown as a popup.

Setup step by step

Step 1: Create a Custom HTML tag in GTM with the listener code, triggered on All Pages.

Step 2: Create a dataLayer variable for the event name, for example eventName.

Step 3: Create Custom Event triggers that listen for hs_form_submission and hubspot_meeting_booking.

Step 4: Create a GA4 event tag with the event name generate_lead, triggered by your trigger.

Step 5: Verify in GTM Preview that the dataLayer event appears and the GA4 tag fires.

Common errors and troubleshooting

  • The listener fires too late, which is fixed by triggering the tag on Page View, not DOM Ready
  • Popup forms are not caught and may need a separate listener
  • Double registration if both HubSpot native analytics and GA4 through GTM are active
  • Incorrect field values if the HubSpot v4 forms API structure has changed

Frequently asked questions

Why can GTM not see HubSpot form submissions?

HubSpot forms load dynamically in an iframe and use their own JavaScript callbacks, so GTM's standard form submit trigger cannot see what happens inside.

How do I track the Meetings calendar?

Listen for the message event with the type MEETINGS_BOOKING_SUCCESSFUL. It works whether the widget is embedded on the page or shown as a popup.

Why do I get double conversions?

Double registration can happen when both HubSpot native analytics and GA4 through GTM are active.

Want to talk it through?

Tell me what you are working on and I will get back to you with straight answers.

Let's talk