HubSpot Forms + Meta Ads Conversion Tracking Setup
I see this specific combination broken in about 35% of the accounts I audit. The biggest issue? Most people think HubSpot’s native Meta pixel integration handles everything, but it doesn’t fire custom conversion events for your specific campaigns. You end up with HubSpot recording the lead but Meta showing zero conversions, making your ROAS look terrible when it’s actually profitable.
What You’ll Have Working By The End
- HubSpot form submissions firing as ‘Lead’ events in Meta Events Manager within 2-3 minutes
- Meta CAPI sending server-side conversion data for better iOS14+ tracking accuracy
- Event deduplication preventing double-counting between pixel and CAPI
- Cross-platform verification showing 85-95% match between HubSpot submissions and Meta conversions
- Proper attribution data flowing into Meta’s optimization algorithms
Prerequisites
- Meta Business Manager admin access
- Meta pixel installed and firing PageView events
- Google Tag Manager container with publish permissions
- HubSpot forms embedded on your website (or HubSpot-hosted pages)
- Meta Conversions API access (Business Manager → Data Sources → Conversions API)
- HubSpot Marketing Hub Professional or above (for webhooks if using CAPI)
Step 1: Set Up Meta Pixel Event in GTM
First, create the client-side tracking that’ll fire when someone submits your HubSpot form.
In GTM, create a new trigger:
- Trigger Type: Custom Event
- Event Name:
hubspot_form_submit - Fire on: All Custom Events
Create a new tag:
- Tag Type: Meta Pixel
- Choose a Pixel: Your Meta pixel ID
- Event: Lead
- Event Parameters: Add these parameters:
content_name:{{Form Title}}content_category:lead_generationevent_id:{{Event ID}}(we’ll create this variable next)
Create these GTM variables:
- Event ID (Data Layer Variable):
event_id - Form Title (Data Layer Variable):
form_title
Step 2: Add HubSpot Form Event Listener
Add this code to your website (either in GTM as a Custom HTML tag that fires on All Pages, or directly in your site’s footer):
// HubSpot form submission listener
window.addEventListener("message", function(event) {
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
// Generate unique event ID for deduplication
var eventId = 'hs_' + event.data.id + '_' + Date.now();
// Push to data layer for GTM
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'hubspot_form_submit',
'event_id': eventId,
'form_id': event.data.id,
'form_title': event.data.formDefinition.formName || 'HubSpot Form',
'page_url': window.location.href
});
console.log('HubSpot form submitted:', event.data);
}
});
// Backup method for older HubSpot embeds
if (window.hsConversationsAPI) {
window.hsConversationsAPI.onReady(() => {
window.addEventListener('hsFormCallback', function(evt) {
if (evt.detail.type === 'onFormSubmitted') {
var eventId = 'hs_' + evt.detail.object.formId + '_' + Date.now();
window.dataLayer.push({
'event': 'hubspot_form_submit',
'event_id': eventId,
'form_id': evt.detail.object.formId,
'form_title': evt.detail.object.formName || 'HubSpot Form',
'page_url': window.location.href
});
}
});
});
}
Step 3: Configure Meta Conversions API (CAPI)
For the 15-25% of users blocking client-side pixels, you need server-side tracking. Set this up in your HubSpot workflow or via webhook.
In HubSpot, create a new workflow:
- Enrollment Trigger: Form submission on any of your forms
- Action: Send webhook to your CAPI endpoint
Here’s the CAPI payload structure you’ll send:
{
"data": [
{
"event_name": "Lead",
"event_time": Math.floor(Date.now() / 1000),
"event_id": "hs_" + contact.formSubmission.formId + "_" + Date.now(),
"event_source_url": contact.formSubmission.pageUrl,
"action_source": "website",
"user_data": {
"em": [sha256(contact.email)],
"ph": [sha256(contact.phone)],
"fn": [sha256(contact.firstname)],
"ln": [sha256(contact.lastname)]
},
"custom_data": {
"content_name": contact.formSubmission.formName,
"content_category": "lead_generation",
"currency": "USD",
"value": 10.00
}
}
],
"access_token": "YOUR_SYSTEM_USER_ACCESS_TOKEN"
}
Important: The event_id must match between your pixel event and CAPI event for proper deduplication. Use the same format: hs_[form_id]_[timestamp].
Step 4: Set Up Custom Conversion in Meta
In Meta Business Manager:
- Go to Events Manager → Custom Conversions
- Click Create Custom Conversion
- Data Source: Your Meta pixel
- Conversion Event: Choose “Lead” from the dropdown
- Rules: Add rule “content_category equals lead_generation”
- Conversion Name: “HubSpot Lead Submissions”
- Category: Lead
- Conversion Value: Set to your average lead value (optional but recommended)
Step 5: Testing & Verification
Test the Client-Side Pixel
- Open your website in an incognito browser
- Open Meta Events Manager → Test Events
- Submit a test form
- Within 30 seconds, you should see:
- Event name: “Lead”
- Parameters: content_name, content_category, event_id
- Browser ID matches your test session
Test Meta CAPI
In Events Manager → Data Sources → Your Pixel → Diagnostics:
- Check “Events Received” shows both Browser and Server events
- Event deduplication rate should show the same event_id appearing in both
- Server events should appear within 2-3 minutes of form submission
Cross-Reference Numbers
Check these daily for the first week:
- HubSpot: Marketing → Reports → Forms Performance
- Meta: Ads Manager → Custom Conversions → “HubSpot Lead Submissions”
Acceptable variance is 5-15%. If Meta shows 20%+ fewer conversions, your CAPI isn’t working properly.
Troubleshooting
Problem: Meta Events Manager shows PageView events but no Lead events. → Your HubSpot form listener isn’t firing. Check browser console for JavaScript errors. Make sure you’re testing on a page with an actual HubSpot form, not just the tracking code.
Problem: GTM Preview mode shows the trigger firing but Meta doesn’t receive events. → Your Meta pixel tag configuration is wrong. Double-check the pixel ID matches exactly. Also verify the Event parameter is set to “Lead” not “lead” (case sensitive).
Problem: Meta shows Lead events but they’re not being attributed to your ads. → The events are firing too long after the ad click. HubSpot forms with heavy validation can delay submission. Check the event_time in Events Manager - if it’s >7 days after click, attribution is lost.
Problem: CAPI events appear in diagnostics but don’t count toward conversions. → Event deduplication is failing. The event_id format between pixel and CAPI must be identical. Check that your timestamp generation method is consistent.
Problem: Conversion count is 2x what it should be. → You’re double-counting pixel and CAPI events. Either your event_id deduplication isn’t working, or you have multiple tracking methods firing. Check Events Manager for duplicate events without matching event_ids.
Problem: Meta reports way fewer conversions than HubSpot form submissions. → Most likely iOS blocking. If the gap is 20-40%, that’s normal for iOS14+. If it’s >50%, check that your CAPI is actually working and verify the user_data hashing is correct (lowercase, trimmed, SHA256).
What To Do Next
Once your HubSpot Forms → Meta tracking is solid, consider these related setups:
- HubSpot Forms Google Ads Conversion Tracking - Track the same leads in Google Ads for cross-platform attribution
- HubSpot Forms to HubSpot CRM Integration - Ensure your leads flow properly into your CRM for sales follow-up
- HubSpot Forms GA4 Conversion Tracking - Add Google Analytics lead tracking for complete attribution picture
- Ready for a free audit? I’ll review your current setup and identify gaps in your conversion tracking → Get Your Free Tracking Audit
This guide is part of the Meta Ads Conversion Tracking Hub — complete setup guides for tracking any lead source in Meta Ads.