How to Track HubSpot Form Submissions in Google Analytics 4
Knowing which marketing activities lead to actual conversions and signups is the holy grail. Setting up conversion tracking for your HubSpot forms in Google Analytics 4 gives you a direct line of sight into what's working. This guide will walk you through two reliable methods for getting this data flowing so you can start measuring the full impact of your campaigns.
Why Tracking HubSpot Forms in GA4 is So Important
Before jumping into the setup, let's quickly cover why this connection is a game-changer. When you track HubSpot form fills as GA4 conversion events, you suddenly unlock a deeper level of analysis. You can finally answer crucial questions like:
Which marketing channels (Organic Search, Paid Social, Email) are driving the most lead form submissions?
Which specific blog posts or landing pages are most effective at converting visitors into leads?
How does user behavior differ between those who fill out a form and those who don't?
What is the true conversion rate of your Google Ads or Facebook Ads campaigns?
Without this tracking, your HubSpot forms exist in a data silo. You can see that someone converted, but it's much harder to see the journey they took to get there. Connecting this step to GA4 gives you a unified view of your entire marketing funnel.
Choose Your Method: Simplicity vs. Accuracy
There are two primary ways to track HubSpot form submissions in GA4. Your choice depends on your technical comfort level and how precise your data needs to be.
The 'Thank You Page' Method: This is the simplest and quickest way to get started. It relies on redirecting users to a unique confirmation page after they submit a form. It's easy to set up but can sometimes be inaccurate.
The Google Tag Manager (GTM) Method: This approach is more technically involved but provides much more accurate and flexible tracking. It uses GTM to "listen" for a successful form submission event directly from HubSpot and pushes that data to GA4. This is the gold standard.
We’ll walk through both, starting with the easier option.
Method 1: The 'Thank You Page' Redirect
This method works by treating a visit to a unique "thank you" page as a conversion. If the only way to reach that page is by filling out a specific form, then every pageview on it can be counted as a form submission.
Step 1: Create a Dedicated 'Thank You' Page
First, you need a unique success page that users will see only after submitting your form.
In your website builder (WordPress, Webflow, or even HubSpot itself), create a new page. Let's say its URL is
yourwebsite.com/thank-you-contact.Add a friendly confirmation message like, "Thanks for getting in touch! We'll get back to you shortly."
Crucially, ensure this page is not indexed by search engines (set it to 'noindex') and is not linked from your main navigation or sitemap. You want to minimize the chances of someone landing on it without submitting the form.
Step 2: Configure Your HubSpot Form to Redirect
Next, tell your HubSpot form to send users to this new page after they click 'submit'.
Log into your HubSpot account and navigate to Marketing > Forms.
Select the form you want to track.
Click on the Options tab.
Under "What should happen after a visitor submits this form?" choose "Redirect to another page" and paste the full URL of your new 'Thank You' page.
Click Publish or Update in the top right corner.
Step 3: Set Up a Conversion Event in GA4
Now, we'll tell GA4 that a view of this specific page should be considered a conversion.
In GA4, go to the Admin panel (the gear icon in the bottom left).
Under the Property column, click on Events.
Click the Create event button, and then Create again.
Give your new event a descriptive name. Let's use
contact_form_submission. Google recommends using underscores instead of spaces.Under Matching conditions, set up the following two rules:
Parameter:
event_name, Operator:equals, Value:page_viewParameter:
page_location, Operator:contains, Value:/thank-you-contact(or whatever the slug of your thank you page is).
Click Create. GA4 will now create a new event called
contact_form_submissionevery time someone views your thank you page.
Step 4: Mark Your New Event as a Conversion
The final step is to tell GA4 that this new event is important enough to be called a conversion.
In the Admin panel, navigate to Conversions.
After waiting a few minutes (or up to 24 hours), you should see your new event name (
contact_form_submission) appear in the list of events.Simply flip the toggle switch to the right of your event name to mark it as a conversion. Done!
Heads Up: The main weakness of this method is its potential for inaccuracy. If a user bookmarks the thank you page and visits it later, or if they share the link, it will be counted as a conversion even though no form was submitted. For most teams, this minor discrepancy is acceptable for how easy it is to set up.
Method 2: Using HubSpot Events & Google Tag Manager
This is the professional-grade method. It's more accurate because it tracks the actual form submission action, not a proxy like a page view. It requires using Google Tag Manager (GTM), a free tool that lets you manage tracking codes on your site without having to edit the website code directly.
Step 1: Get the HubSpot Form Listener Code Ready
When an embedded HubSpot form is successfully submitted, it sends a message within the browser's code. We can use a snippet of JavaScript to "listen" for this specific message. Create a custom HTML tag in GTM to deploy this listener.
In your Google Tag Manager container, go to Tags > New.
Name your tag something clear, like "Custom HTML - HubSpot Form Listener".
Click Tag Configuration and choose Custom HTML as the tag type.
Paste the following code into the HTML box:
This script listens for the success message from HubSpot and then pushes an event named hubspot_form_success into GTM’s data layer, along with the unique ID of the submitted form.
Under Triggering, select the All Pages trigger. This ensures the listener is active on every page where a form might exist.
Save the tag.
Step 2: Create a Custom Event Trigger in GTM
Now that our listener is pushing a hubspot_form_success event, we need to create a trigger that fires when GTM hears that event.
In GTM, go to Triggers > New.
Name your trigger "Custom Event - HubSpot Form Success".
Click Trigger Configuration and choose Custom Event as the trigger type.
For the Event Name, enter
hubspot_form_success. It must match the event name from the listener script exactly.Save the trigger.
Step 3: Create a Data Layer Variable (Optional, But Recommended)
The listener script doesn't just send an event name, it also sends the specific form's ID. You can capture this ID with a GTM variable to differentiate between different form submissions in GA4.
Go to Variables > User-Defined Variables > New.
Name it "DLV - hs-form-guid".
Choose Data Layer Variable for the variable type.
For the Data Layer Variable Name, type
hs-form-guid. This needs to match the key from our script exactly.Save the variable.
Step 4: Create the GA4 Event Tag
Finally, we'll create the tag that sends the clean, validated event information over to Google Analytics 4.
Back in Tags, click New.
Name it "GA4 Event - Form Submission".
For Tag Configuration, choose Google Analytics: GA4 Event.
Select your main GA4 Configuration Tag from the dropdown.
For Event Name, enter a user-friendly name, like
generate_lead. You can get even more specific with names likeebook_downloadordemo_request.Under Event Parameters, you can add more context. Click Add row:
Parameter Name:
form_idValue: Click the building block icon and select the
{{DLV - hs-form-guid}}variable you created earlier.
For Triggering, choose the custom event trigger you made earlier, "Custom Event - HubSpot Form Success".
Save your tag.
Step 5: Test and Publish
Before making your changes live, it's vital to test them.
Click the Preview button in the top right of GTM.
Enter your website's URL and connect.
In the new tab that opens, navigate to a page with your HubSpot form and submit it with test information.
In the GTM Tag Assistant (the preview window), you should see
hubspot_form_successappear in the left-hand event list when you submit the form.Click on that event and check that your "GA4 Event - Form Submission" tag fired successfully.
Once you've confirmed it works, go back to GTM, click Submit, and then Publish your container changes.
As with the first method, remember to navigate to Admin > Conversions in GA4 and mark your new generate_lead event as a conversion. All set!
Final Thoughts
Properly tracking your lead generation efforts bridges the gap between marketing activities and business results. Whether you choose the quick 'Thank You Page' method or the more robust GTM approach, connecting HubSpot form data to GA4 enables you to make smarter, data-driven decisions that optimize your entire funnel.
Manually implementing custom event tracking can often involve hours of setup, testing, and debugging in tools like GTM. Instead of building these connections from scratch, we designed Graphed to do the heavy lifting for you. Simply connect data sources like HubSpot and Google Analytics, and our AI data analyst pulls everything together. You can then ask in plain English for reports like, "Show me how many leads we got from HubSpot last month by traffic source," and get an automated dashboard in seconds, allowing you to focus on analyzing results rather than tracking implementation.