HubSpot Forms and Google Analytics EventsSOLVE
Feb 19, 2020 3:00 PM
I'm trying to track HubSpot Form submissions as events in Google Analytics. Really, I'm using Google Tag Manager, hoping to pass the event information to Google Analytics
Here's where I'm running into an issue:
The HubSpot form is implemented through a time-based lightbox popup (Convert Plus).
In GTM, the tag trigger is set up on Trigger Type: Form Submission firing on Form ID.
In this case, I've tried both the HubSpot form's ID and the lightbox container's ID (because why not).
I've also tried setting it to fire on Click URL with the target page (an online PDF.)
With that said, the form tag still doesn't appear in the GTM preview panel.
Now, I've seen these posts on GA events and HubSpot forms but I haven't attempted any of them because 1. I'll admit I'm out of my depth here, and 2. The lightbox popup manager is throwing me for a loop when it comes to embed codes.
Solved! Go to Solution.
Feb 23, 2020 2:14 PM
Due to how Hubspot forms work the built in form submission listener in GTM won't work; you have to actually litsen for Hubspot's particular submission callback to track it. Here's a step-by-step on creating a custom listener for tracking hubspot form submissions with GTM:
If you want to track only a particular form you can just add && event.data.id === "[your form GUID here]" to the end of the if statement in the form listener tag the instructions have you add. Like so :
Hope this helps!