Facebook Tips & Strategies

How to Track HubSpot Forms as Facebook Events

By Spencer Lanoue
October 31, 2025

If you're driving traffic from Facebook ads to a HubSpot landing page, you're only seeing half the picture. Knowing your ads generate clicks is one thing, but knowing exactly which ad creative or headline led to a signed-up lead is the data that transforms your campaign from a guessing game into a predictable growth engine. This article provides a definitive guide on how to track HubSpot form submissions as Facebook lead events, giving you the clarity needed to optimize your ads effectively.

Why This Connection is So Important for Your Marketing

Connecting these two platforms might seem like an overly technical task, but the strategic payoff is enormous. When Facebook knows precisely which users are converting, its powerful algorithm starts working for you, rather than taking a shot in the dark. Let's break down the tangible benefits:

  • Pinpoint Your Ad ROI: Stop wondering which campaigns are working. By tracking form fills as conversion events, you can directly attribute leads to specific campaigns, ad sets, and individual ads. This allows you to double down on what’s working and cut what’s not, maximizing every dollar of your budget.
  • Supercharge Ad Optimization: When you set your campaign objective to Conversions/Leads, Facebook's algorithm learns from the data you provide. By firing a "Lead" event for every HubSpot form submission, you're feeding it high-quality signals. The algorithm then gets smarter about identifying users in your target audience who are most likely to convert, leading to a lower cost-per-lead over time.
  • Create High-Value Custom Audiences: Don't just retarget website visitors, retarget people who have shown specific intent. With this setup, you can build audiences of users who have filled out a particular form. You can use this for:
    • Exclusion: Stop showing your top-of-funnel lead magnet ad to people who have already downloaded it.
    • Nurturing: Target people who downloaded an eBook with an ad for a related webinar or product demo.
  • Build Powerful Lookalike Audiences: Once you have a source audience of hundreds of converted leads, you can ask Facebook to build a Lookalike Audience. The platform will analyze the characteristics of your actual leads from HubSpot and find millions of new users who share those traits. This is one of the most effective ways to scale your campaigns and find new customers.

Choosing Your Method: Direct Integration vs. Google Tag Manager

There are two primary ways to make this connection. The method you choose depends on your technical comfort level and the degree of control you need.

1. Direct HubSpot Integration (The Simpler Way): HubSpot offers a native integration with the Facebook ads tool. You can connect your ad account directly within HubSpot's settings. This allows you to sync lead data automatically and attribute contacts to ads. It's a great starting point if you're looking for simplicity and don't need highly granular tracking. However, it can sometimes be a bit of a "black box" and offers less customization.

2. Google Tag Manager (The More Robust Way): Using Google Tag Manager (GTM) gives you a level of precision and flexibility that direct integrations often lack. With GTM, you can create a system that "listens" for a HubSpot form submission and then tells your Facebook Pixel to fire a "Lead" event. While it requires a few more setup steps, it’s the gold standard for reliable conversion tracking. This method gives you full control, allows you to track very specific forms, and works universally across your entire digital marketing stack. For these reasons, we’ll be focusing on the GTM method in this guide.

Getting Your Ducks in a Row: What You'll Need

Before diving into the setup, let's make sure you have everything you need. A little preparation here will make the whole process much smoother. Here’s a quick checklist:

  • HubSpot Admin Access: You’ll need to be an admin on your HubSpot account to check page settings.
  • Facebook Business Manager Admin Access: You must have administrative access to your Facebook Ad Account and the associated Facebook Pixel.
  • Google Tag Manager Account: Your free GTM account needs to be set up, and the container snippet must already be installed on your HubSpot landing pages, website pages, or blog posts where your forms live.
  • Facebook Pixel Installed: Your Facebook Pixel should already be deployed on your website, preferably via your Google Tag Manager container.
  • A Live HubSpot Form: You'll need a live landing page with a HubSpot form embedded on it to test your new tracking setup.

The Ultimate Guide: Tracking HubSpot Forms with GTM and Facebook Pixel

Ready to connect the dots? This step-by-step process will walk you through setting up the GTM listener, trigger, and tag to create a flawless tracking system.

Step 1: Create a Listener Tag for HubSpot Form Submissions

First, we need to tell GTM how to recognize when a visitor successfully submits a HubSpot form. By default, GTM isn't aware of these form events. We can bridge this gap with a small piece of JavaScript that "listens" for HubSpot's success message and pushes an event into GTM's data layer.

  1. Navigate to your Google Tag Manager workspace and click Tags > New.
  2. Name your tag something clear, like cHTML - HubSpot Form Listener.
  3. Under Tag Configuration, choose the Custom HTML tag type.
  4. Copy and paste the following code snippet into the HTML box:<,script type="text/javascript">,
    window.addEventListener("message", function(event) {
    if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
    window.dataLayer.push({
    'event': 'hubspot-form-success',
    'hs-form-guid': event.data.id
    }),
    }
    }),
    <,/script>,
  5. Next, click on Triggering and select the All Pages trigger. This ensures your listener is active on any page where a HubSpot form might appear.
  6. Click Save.

This script now watches for a message called 'onFormSubmitted' that HubSpot broadcasts upon a successful submission. When it "hears" it, it pushes a new GTM event called `hubspot-form-success` into the data layer, along with the form's unique ID.

Step 2: Create a Data Layer Variable (Recommended)

The code in Step 1 includes the unique ID of the submitted form (`hs-form-guid`). By capturing this ID as a variable in GTM, you can create triggers for specific forms. For example, you could fire a "Demo Request" event for one form and a "Newsletter Signup" event for another.

  1. In GTM, navigate to Variables > New under "User-Defined Variables."
  2. Name the variable dlv - hs-form-guid. The `dlv` prefix is just a common convention to denote a Data Layer Variable.
  3. For Variable Configuration, choose the Data Layer Variable type.
  4. In the "Data Layer Variable Name" field, enter `hs-form-guid`. This must match the name from our custom script exactly.
  5. Leave everything else as is and click Save.

Step 3: Create The Trigger

Now that GTM is listening for the event, we need to create a trigger that fires whenever that event happens. This is what we'll use to launch our Facebook Pixel tag.

  1. Go to Triggers and click New.
  2. Name your trigger something descriptive, like Event - HubSpot Form Success - All Forms.
  3. For the Trigger Configuration, choose the Custom Event type.
  4. In the "Event Name" field, type `hubspot-form-success`. This must match the event name from our listener script.
  5. For now, leave "This trigger fires on" set to All Custom Events.
    (Advanced tip: If you only wanted to track a specific form, you could select "Some Custom Events" and then set a condition where 'dlv - hs-form-guid' equals the ID of the form you want to track.)
  6. Click Save.

Step 4: Create the Facebook Pixel "Lead" Tag

This is the final step where everything comes together. We will create the Facebook Pixel tag that sends the "Lead" event to Facebook whenever our trigger from Step 3 fires.

  1. Return to Tags and click New.
  2. Name the tag FB - Lead - HubSpot Form Submit.
  3. For Tag Configuration, choose the Facebook Pixel tag template. If you don't have it, you can add it from the Community Template Gallery.
  4. Enter your Facebook Pixel ID.
  5. Under "Event Name," select Lead from the dropdown menu of standard events. This is the event that will show up in your Ads Manager reporting.
  6. Click on Triggering below and attach the Event - HubSpot Form Success - All Forms trigger you created in the last step.
  7. Click Save.

Your setup is complete! All you need to do now is click the Submit button in the top right of your GTM workspace to publish your changes.

Did it Work? How to Test and Verify Your Setup

Never assume your new tracking works without testing it. Both GTM and Facebook offer excellent tools to verify your implementation in real-time.

Testing with GTM Preview Mode

GTM's Preview Mode is your best friend for debugging.

  1. In your GTM workspace, click the Preview button in the top right.
  2. A new tab will open. Enter the URL of your HubSpot landing page and click Connect.
  3. Your landing page will open in a new window with a GTM debug panel at the bottom corner.
  4. Fill out and submit your HubSpot form.
  5. In the event summary on the left of the debug panel, you should see the `hubspot-form-success` event appear. Click on it.
  6. You should see that your FB - Lead - HubSpot Form Submit tag fired successfully on this event. If it did, GTM is working correctly!

Verifying in Facebook Events Manager

Once you've confirmed GTM is firing the tag, you should also check that Facebook is receiving the data.

  1. Go to your Facebook Events Manager and select your Pixel.
  2. Click on the Test Events tab.
  3. Under "Test Browser Events," enter the URL of your HubSpot landing page and click Open Website.
  4. Fill out and submit your HubSpot form again.
  5. Switch back to the Test Events tab in Events Manager. Within seconds, you should see a "Lead" event appear, confirming that Facebook has received it.

Final Thoughts

By using Google Tag Manager to track HubSpot form submissions as Facebook Events, you unlock an entirely new level of data-driven advertising. This setup tears down the wall between your marketing efforts and actual business results, giving you the crystal-clear attribution you need to stop guessing and start scaling confidently.

Getting your conversion tracking dialed in buys you time to focus on the top of your funnel: creating great content that actually stops the scroll. We know how frustrating it can be to wrestle with schedulers built for a bygone era of social media. That's why we created Postbase, a social media management tool made from the ground up for modern formats like Reels, Shorts, and TikToks. Our goal is to give you a clean, reliable, and intuitive platform so you can plan, schedule, and analyze your content without the constant friction of legacy tools.

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Add an Etsy Link to Pinterest

Learn how to add your Etsy link to Pinterest and drive traffic to your shop. Discover strategies to create converting pins and turn browsers into customers.

Read more

How to Grant Access to Facebook Business Manager

Grant access to your Facebook Business Manager securely. Follow our step-by-step guide to add users and assign permissions without sharing your password.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Add Translation in an Instagram Post

Add translations to Instagram posts and connect globally. Learn manual techniques and discover Instagram's automatic translation features in this guide.

Read more

How to Optimize Facebook for Business

Optimize your Facebook Business Page for growth and sales with strategic tweaks. Learn to engage your community, create captivating content, and refine strategies.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating