Back to Blog
Attribution & Trackingmetafacebookconversion tracking

How to Set Up Meta Conversion Tracking for Lead Generation (Pixel + CAPI)

Learn how to set up Meta Pixel and Conversion API (CAPI) for your lead capture forms. Step-by-step guide to tracking conversions, lowering CPL, and sending better data back to Meta.

LeadCapture.io TeamMarch 26, 20268 min read

If you're running Meta ads for lead generation and not sending conversion data back properly, you're flying blind. Meta can't optimize for your best leads if it doesn't know which ones converted. Your CPL stays inflated. Your lead quality stays inconsistent. And you're left guessing.

This guide walks you through the full setup for Meta conversion tracking inside LeadCapture, step by step. We'll cover both the Meta Pixel (client-side) and the Conversion API, or CAPI (server-side), because using both together is the best practice for accurate attribution and better lead quality from Meta.

We also recorded a full video walkthrough if you prefer to follow along visually:

Why You Need Both Meta Pixel and CAPI for Lead Gen

There's a lot of conflicting advice out there about whether to use the Meta Pixel, CAPI, or both. Here's the short answer: use both.

The Meta Pixel fires on the client side (in the browser) when a prospect hits a specific step in your funnel. It's fast and straightforward to set up.

The Conversion API (CAPI) fires on the server side, sending conversion events directly from your backend to Meta. This gives you more reliable data, especially when browser-side tracking gets blocked by ad blockers, iOS restrictions, or cookie limitations.

When you run both together, you get the most complete picture. And Meta automatically de-duplicates the events, so you don't need to worry about double-counting conversions.

The result: Meta gets better signal, sends you better traffic, and your CPL drops.

What You'll Need Before Starting

Before jumping into the setup, make sure you have access to the following:

  • Meta Events Manager (with admin access to your Pixel)
  • Your Meta Pixel ID
  • Your Dataset ID (found in Events Manager settings)
  • A CAPI Access Token (we'll generate this together)
  • A LeadCapture account with a funnel built or in progress

If you don't have a LeadCapture account yet, you can start a free 7-day trial at leadcapture.io. No credit card required.

Step 1: Add Your Meta Pixel ID in LeadCapture

First, go into your funnel settings inside LeadCapture.

  1. Navigate to Settings
  2. Scroll down to Tracking and Analytics
  3. Make sure tracking is enabled
  4. Enter your Meta Pixel ID

To find your Pixel ID, go into Meta Events Manager, select your pixel, and grab the ID from the top of the page or from the settings section.

Paste that into the Pixel ID field inside LeadCapture and save.

Pro tip: LeadCapture's AI Copilot can also help with this. Just ask it "How do I set up Meta conversion tracking?" and it will walk you through the process and even add your Pixel ID for you if you provide it.

How LeadCapture Captures FBP and FBC Automatically

One thing worth calling out here: LeadCapture automatically captures the FBP (Facebook browser ID) and FBC (Facebook click ID) from the cookie when a prospect loads your landing page. These values get sent back to Meta with your conversion events.

You can also map FBP and FBC to your CRM or lead distribution tool for even more granular attribution.

This matters because it helps Meta match conversions more accurately to the ad click that drove them, which means better optimization and better traffic over time.

Step 2: Set Your Conversion Event

Next, you need to tell LeadCapture which step in your funnel should fire the conversion event back to Meta.

  1. Open your funnel in the builder
  2. Decide which step represents a completed lead (this could be the contact info step, an OTP verification step, or your final confirmation)
  3. Click the pencil icon on that step to open the settings panel
  4. Scroll down to Meta Pixel Event
  5. Select Lead (or whichever event type fits your setup)
  6. Hit Save

Now, whenever a prospect completes that step in your funnel, LeadCapture fires the conversion event back to Meta.

Important: The event only fires once per actual conversion. If someone clicks the submit button multiple times, it doesn't fire multiple events. They have to actually complete the step and become a conversion.

Step 3: Whitelist Your Domains in Meta (Don't Skip This)

This is the step most people miss, and it breaks everything.

If you load your page and see a yellow warning icon in the Meta Pixel Helper browser extension, the problem is almost always that your domain isn't on Meta's allowed list.

Here's how to fix it:

  1. Go to Meta Events Manager
  2. Select your dataset and go to Settings
  3. Scroll down to the Domain Allow List
  4. Add the following domains:
    • my.leadcapture.io (LeadCapture's default subdomain)
    • Any custom domains you're using for your funnels

Make sure you select "Allow List" and not "Block List" when configuring this. If you accidentally set up a block list, it will block your tracking right out of the gate.

If you skip this step, neither your Pixel nor CAPI will work correctly. This applies to the default LeadCapture subdomain and any custom domains you've configured.

Step 4: Set Up Conversion API (CAPI) Server-Side

Now let's add the server-side layer. This is where the real attribution power comes in.

Get Your Dataset ID

  1. Go to Meta Events Manager
  2. Select your dataset and go to Settings
  3. Your Dataset ID is displayed at the top of the settings page
  4. Copy it

Generate Your Access Token

Still in the Events Manager settings:

  1. Scroll down to find the Direct Integration option
  2. Select Direct Integration (not the Conversion API Gateway)
  3. Keep the default option: "Set up with Dataset Quality API"
  4. Click Generate Access Token
  5. Wait for it to generate, then copy the token to your clipboard

Important: Meta does not save this token for you. If you lose it, you'll need to generate a new one. Save it somewhere secure.

Add CAPI Credentials in LeadCapture

  1. Go back to your funnel settings in LeadCapture
  2. Scroll down to Tracking and Analytics
  3. Make sure your Meta Pixel ID is already filled in (CAPI requires this)
  4. Enable the CAPI toggle
  5. Enter your Dataset ID
  6. Enter your Access Token
  7. Click Save

That's it. Server-side conversion tracking is now live.

Step 5: Test Your Setup

Before going live with ad spend behind this, test everything.

  1. In the CAPI settings, add a Test Event Code (something like TEST12345)
  2. Save your settings
  3. Load your funnel and submit a test lead
  4. Check Meta Events Manager to verify the event came through
  5. Look for both the client-side Pixel event and the server-side CAPI event
  6. Once confirmed, remove the test code and save again

Use the Meta Pixel Helper Chrome extension to verify client-side events are firing correctly. If you see a green checkmark, you're good. If you see a yellow warning, revisit Step 3 (domain whitelisting).

Optional: Enhanced Matching for Better Traffic Quality

LeadCapture also supports Enhanced Matching, which sends additional hashed data points back to Meta to improve match rates.

If your funnel captures fields like:

  • City
  • State
  • Zip code
  • Country

You can map these fields in the CAPI settings. This data gets hashed before being sent, so it's privacy-safe. Meta uses it to better match conversions to ad interactions, which helps improve the quality of traffic you receive.

This step is completely optional but can meaningfully improve your results over time, especially at higher lead volumes.

Do You Need Both Pixel and CAPI Running at the Same Time?

You don't technically need both. But you should set up both if you can.

Here's why:

  • The Pixel alone misses conversions when browsers block tracking (ad blockers, Safari ITP, iOS privacy changes)
  • CAPI alone misses the real-time browser-side signals that help with attribution
  • Both together give Meta the most complete conversion data, and Meta de-duplicates automatically so you won't get double-counted events

The extra 10 minutes it takes to set up CAPI is worth it. You'll get more accurate reporting, better optimization, and ultimately better leads from Meta.

Quick Setup Checklist

Here's everything at a glance:

  • Meta Pixel ID added in LeadCapture settings
  • Conversion event (Lead) assigned to the correct funnel step
  • Domains whitelisted in Meta Events Manager (my.leadcapture.io + custom domains)
  • CAPI enabled with Dataset ID and Access Token
  • Test event submitted and verified in Events Manager
  • Test event code removed before going live
  • Enhanced matching fields mapped (optional)

Start Tracking Conversions in Minutes

If you're running Meta ads for lead gen and you're not sending conversion data back through both Pixel and CAPI, you're leaving performance on the table.

LeadCapture makes this setup straightforward. Your Pixel ID, CAPI credentials, conversion events, and enhanced matching all live in one place. And if you get stuck, AI Copilot can walk you through the whole thing.

Start your free 7-day trial at leadcapture.io - no credit card required, 60-day money-back guarantee.

If you have questions about getting Meta conversion tracking set up, drop a comment or reach out. Always happy to help.

Ready to capture more leads?

Build and optimize high-converting lead funnels, quizzes, and forms with AI-powered lead capture software.

Start Free Trial