How to Fix Unbounce Lead Tracking with Meta Conversions API

How to set up event tracking (lead) with Unbounce correctly?

Hi there,

I’m using the FB pixel event tracker to track leads on an Unbounce landing page.

The issue I’m facing is this: FB pixel is firing a “lead” even if someone presses the button without filling any of the required fields on the Unbounce landing page and no form is submitted. I.e. it is tracking every button press as a lead. However, I want it to only fire a “lead” event once someone successfully fills out the form and is redirected to the thank you page.

How do I set it up correctly? Any tips/insights appreciated!!!

The short answer is:

Why is my Facebook Pixel firing a Lead event before form submission on Unbounce?

Your problem is that the Lead event is currently set to fire on a button click, not a successful form submission, which is why it triggers even if the form validation fails.

To fix this immediately, you need to move the fbq('track', 'Lead'); code from the main landing page button script to fire only on the Form Confirmation Dialog or Thank You Page of your Unbounce setup.

The best long-term solution, which also solves conversion accuracy issues, is to stop relying on browser-side tracking and instead set up server-side tracking using the Facebook Conversions API via an integration with the Unbounce API/webhooks or a dedicated platform like Zapier.

The long answer is:

The behavior you are seeing is a classic tracking error that occurs when the event is tied to a client-side action (the button click) instead of a server-side confirmation (the actual lead being recorded).

When a user clicks the submit button, the Pixel fires the Lead event immediately, regardless of whether Unbounce’s internal form validation – which checks for required fields – passes or fails.

This leads to wildly inflated and inaccurate lead counts in Meta Ads Manager, which corrupts your campaign optimization.

There are two primary ways to fix this inaccuracy on the front end of your Unbounce page:

Thank You Page Method: If your Unbounce form is set to redirect to a new, dedicated thank you page URL upon submission, you should remove the fbq('track', 'Lead'); code from the main landing page altogether.

Instead, place this single line of code in the custom JavaScript section of the thank you page only.

This ensures the event only fires after a successful submission, when the user lands on that final confirmation page.

Form Confirmation Dialog Method: If your Unbounce form uses a Form Confirmation Dialog that appears over the landing page, you need to place the fbq('track', 'Lead'); script inside the custom JavaScript section of that dialog.

This dialog only appears after Unbounce’s validation logic has successfully processed the submitted data.

While these front-end fixes solve the button-click issue, they still rely on the browser-based Meta Pixel, which is inherently unreliable due to ad blockers and privacy changes like iOS 17.

The most robust and future-proof solution is to switch to server-side tracking using the Meta Conversions API (CAPI) and integrating it with the Unbounce API via a middleware like Zapier, or a more professional solution using Server-Side Google Tag Manager with a hosting provider like Stape or Google Cloud Platform.

This combination is an excellent and cheap solution because it guarantees that the Lead event is sent to Meta only when Unbounce successfully registers a lead in its backend database.

This method bypasses all browser-side limitations.

Instead of the user’s browser sending the data, you would configure an Unbounce webhook (a feature available in their API or through Zapier).

This webhook instantly pushes the successful submission data to your server environment, which then sends the Lead event directly to Meta via CAPI.

Services like Stape offer a very cost-effective way to host the necessary server-side Google Tag Manager container, which acts as the intermediary, securely receiving the data from Unbounce and formatting it for Meta.

This server-side connection ensures the most accurate and reliable tracking possible, giving you the clean conversion data Meta’s algorithm needs to optimize your ad spend effectively.

About The Author