Guide

How to set up the Meta Conversions API for lead generation

How to set up Conversions API for lead gen: Meta's setup options compared, then a server Lead event with event_id, hashed contacts, fbc and fbp, tested.

By Simone Manto, founder of DropCPL · Published

Here’s how to set up Meta’s Conversions API (the Facebook Conversions API, as many still call it) for lead generation, in five steps:

  1. Pick a setup method: Meta-enabled, partner, Gateway or direct.
  2. Get your Pixel ID and an access token from Events Manager.
  3. On form submit, send a Lead from your server with an event_id, hashed email and phone, fbc, fbp, IP and user agent.
  4. Check the event in Test events.
  5. Confirm deduplication and Event Match Quality.

This guide is the procedure, written for advertisers whose leads come from a form on a landing page. For what server-side tracking fixes, and what it can’t, read server-side tracking for Facebook ads; for where tracking sits in the whole funnel, see the Facebook ads for lead generation playbook.

Meta Conversions API setup options

There’s more than one way to get events into the Conversions API. Meta’s help article comparing Conversions API setup options lists three routes, and Meta for Developers documents a fourth, the Conversions API Gateway. All four are live as of November 2026. For lead gen, the last column is the one to read:

OptionWhat it sendsWhat it takesA Lead the Pixel never fired
Meta-enabled Conversions APIthe same events and parameters the Pixel shares, web only, deduplicated automaticallyone click in Events Manager, free; needs the Pixellost
Partner integrationwhatever the partner sends: commerce platforms (Shopify, WooCommerce, Wix, BigCommerce), tag platforms (Adobe, Google Tag Manager, Tealium), CRM partnersa few clicks on a commerce platform, at no extra cost; elsewhere it depends on the partnerdepends on whether the partner sends from a server that saw the form
Conversions API GatewayPixel events relayed through a server you host, with an event_id generated for deduplicationno code; your own AWS or Google Cloud account, and its feeslost
Direct integrationany event and parameter you choose, from web, app, offline, CRM and messaging sourcesa developer; Meta estimates 2 to 4 weeks for a new integrationsent, by the server that received the form

Meta’s developer docs call the first option “Conversions API with Meta”. It’s the same thing: you switch it on in Events Manager and there’s nothing to host.

Which setup should a lead gen advertiser choose?

Ask where the Lead exists. On a landing page, the form submission reaches a server whatever the browser does. The Pixel’s copy exists only if the Pixel script loaded and ran. Two of the four options start from the Pixel: the Meta-enabled option shares what the Pixel shares, and the Gateway relays what the Pixel sends it. When the Pixel is blocked, neither has anything to forward.

What I’d pick:

  • Your form posts to a backend you control: a direct integration. The server that saves the lead also reports it to Meta, so every lead gets sent, blocked Pixel or not.
  • Your landing pages run on a platform with a Meta partner integration: use it, then confirm in Test events that the Lead arrives as a server event with an event_id.
  • No developer, Pixel already installed: turn on the Meta-enabled option today. It’s free and gives Meta a server copy of everything the Pixel sees, which beats nothing.
  • The Gateway suits teams that want server redundancy across several domains or Pixels without writing code, and that are happy to run cloud infrastructure. For a single lead gen landing page it adds a hosting bill without solving the blocked-Pixel case.

How to set up the Conversions API, step by step

The steps below assume a direct integration, or a tool that runs one for you. The checks in steps 4 and 5 apply to every method.

Step 1: Get your Pixel ID and an access token

Pixel ID. Use the same Pixel for browser and server events, as Meta’s get started guide asks. Events Manager lists it under Data sources. Newer Meta tools call it a dataset: the Dataset Quality API takes a dataset_id that it describes as the ID of the dataset (Pixel), so it’s one number with two names.

Access token. Meta recommends generating it in Events Manager:

  1. Choose the Pixel you want to set up.
  2. Open the Settings tab.
  3. In the Conversions API section, click Generate access token under Set up manually, and follow the pop-up.

The link is visible only to users with developer privileges for the business, which is the usual reason people can’t find it. If you already run your own app and system user, you can generate the token in your business settings instead: assign the Pixel to the system user, select it and click Generate Token. Meta says neither route needs App Review or extra permissions, and tokens generated since v12.0 work with every available Graph API version.

Keep the token on the server, in an environment variable or a secrets store. It never goes in the landing page’s JavaScript. Agencies: one Pixel and one token per client, and make sure the server sends each client’s leads to the same Pixel ID the browser uses on that client’s landing pages.

Step 2: Build the Lead event payload

Events go in a POST to:

https://graph.facebook.com/{API_VERSION}/{PIXEL_ID}/events?access_token={TOKEN}

The body holds a data array of up to 1,000 events, according to Meta’s guide to using the API. For a lead gen landing page you’ll normally send one Lead per request, the moment the form arrives.

Example: a Lead from a quote form, sent by the server on 4 November 2026 at 10:15:02 UTC. The two hashes are the SHA-256 of [email protected] and 393471234567.

{
  "data": [
    {
      "event_name": "Lead",
      "event_time": 1793787302,
      "event_id": "lead_8c1f4e2a-7b3d-4f0e-a6c9-2d5b7e9f1a30",
      "action_source": "website",
      "event_source_url": "https://quote.example.com/boiler-service",
      "user_data": {
        "em": ["10928b45363b7d849e040470c3277657f8177ef5a953a092b4302f149757a02e"],
        "ph": ["75565655f639ba28fbb0a88254e0d01fad0a351049bde96a286e336219a33e5f"],
        "fbc": "fb.1.1793787151204.IwAR2F4-dbP0l7Mn1IawQQGCINEz7PYXQvwjNwB_qa2ofrHyiLjcbCRxTDMgk",
        "fbp": "fb.1.1793787151880.1684203391",
        "client_ip_address": "2001:db8:85a3::8a2e:370:7334",
        "client_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
      }
    }
  ]
}

Field by field, with the rules from Meta’s server event and customer information references:

FieldRequired?Value for a landing page LeadHash it?
event_nameyesLead, spelled exactly as on the Pixelno
event_timeyesUnix time in seconds, GMT, when the form was submitted; no more than 7 days oldno
event_idrecommendedone ID per lead, the same string the Pixel sends as eventIDno
action_sourceyeswebsiteno
event_source_urlyes, for website eventsthe URL of the landing page where the form was submittedno
user_data.emuser_data needs at least one fieldthe email, trimmed and lowercasedyes, SHA-256
user_data.phoptionaldigits only, country code includedyes, SHA-256
user_data.fbcoptionalthe _fbc cookie, or a value built from the fbclidno
user_data.fbpoptionalthe _fbp cookieno
user_data.client_ip_addressoptionalthe visitor’s IP, from the request that submitted the formnever
user_data.client_user_agentyes, for website eventsthe visitor’s user agent, from the same requestno

Three things trip up first integrations:

  • Hash only what Meta says to hash. em and ph get normalised, then hashed; fbc, fbp, the IP and the user agent go in clear. Meta’s Business SDKs hash for you. If you write your own code, test it against the expected outputs in Meta’s reference; the Event Match Quality guide has the normalisation rules with worked examples.
  • Use the visitor’s IP and user agent, not your server’s. Behind a proxy or CDN, read them from the forwarded headers your infrastructure sets, on the request that submits the form.
  • Don’t send a Lead that carries only weak data. Meta’s best practices treat an event as invalid if its customer information is only a broad combination such as fn + ge or db + client_user_agent. A lead form collects an email and a phone number, so send them.

Step 3: Send the event when the form arrives

The flow for a form on a landing page:

  1. On the visit, read the fbclid from the landing page URL and keep it with the click. If there’s no _fbc cookie, build fbc from it; _fbc and _fbp cookies, explained has the format.
  2. On submit, generate one event_id, fire the Pixel’s Lead with it as eventID, and post the same ID to your server with the form fields.
  3. On the server, save the lead, then call the Conversions API straight away with that event_id. Meta recommends sending events as soon as they occur, ideally within an hour, and rejects the whole request if any event in it is more than 7 days old.
  4. On failure, retry with the same event_id. Meta keeps only the first copy of an event_name and event_id pair, so a retry can’t create a second lead.

Where the ID should come from, and every way the pairing breaks, is in Meta Pixel and CAPI deduplication.

If your landing pages run on DropCPL, this part is already wired. DropCPL logs the click on the domain that serves your landing page and sends the Lead to Meta server-side through the Conversions API, with an event_id for deduplication plus fbc and fbp. Start free →

Step 4: Test the event with Test events

  1. In Events Manager, open Data sources, choose your Pixel and open the Test events tab.
  2. Copy the test code and add it to the request body as test_event_code, at the top level, next to data.
  3. Submit the form on your live landing page with your own email and phone. Meta’s best practices suggest real details, because test events that don’t match a Meta account may be discarded.
  4. Check that the server Lead arrives with the parameters you expect, and that its browser copy shows as deduplicated.
  5. Remove test_event_code before you go live.

One detail catches people out: Meta says events sent with test_event_code aren’t dropped. They flow into Events Manager and are used for targeting and measurement, so your test lead is a real Lead as far as Meta is concerned. Keep the tests few. If nothing shows up, compare your request with what Meta’s Payload Helper generates for the same fields.

Step 5: Check deduplication and Event Match Quality

Once you’re live, Meta’s guide to verifying a setup points to four places in Events Manager:

  • Overview. Server events should appear within 20 minutes of being sent. The count there is taken before deduplication, so a jump after launch is expected.
  • Event Deduplication tab, in the Lead event’s details: the rate of events deduplicated, and how much the Pixel and server overlap. Meta reads low overlap as a sign of keys that aren’t unique or that only one side sends; in practice it’s often a browser ID and a server ID that were never the same string. The deduplication guide explains how to read it.
  • Event Match Quality. Meta recommends aiming for 6.0 or higher where possible. Read the Lead’s score, not the PageView’s; Event Match Quality for lead generation covers what moves it and how long it takes to update.
  • Event freshness. It shows the average delay between event_time and arrival. A Lead that reaches Meta hours late points at a queue, not at matching.

Conversions API Gateway setup

If you chose the Gateway, Meta’s setup guide runs like this:

  1. In Events Manager, open the Settings tab and click Get started under Set up with Conversions API Gateway.
  2. Review the prerequisites, then pick your preferences, a cloud setup and one hosting region.
  3. Open AWS, or copy the URL for your AWS administrator. A quick-create stack opens with every field filled in: leave ProvisioningData alone and click Create stack. Meta puts the install at 30 to 40 minutes.
  4. From the stack’s Outputs, open the CapigSetupURL, create the admin account and log in.
  5. Wait for data. Meta says server and browser counts can take 5 minutes to 2 hours to populate.
  6. Add a custom domain in the Admin UI. Meta recommends it for data routing and says it may reduce costs.

Then run the Test events and deduplication checks above. Keep in mind what you’ve built: a server that forwards what the Pixel sends it. If the Pixel never fires, the Gateway has nothing to forward.

Common Conversions API setup mistakes

MistakeWhat happensFix
One event in a batch is more than 7 days oldMeta returns an error for the whole request and processes none of itsend events as they happen
event_source_url or client_user_agent missingthe event lacks a parameter Meta requires for website eventssend both with every Lead
fbc, fbp, IP or user agent hashedthe values stop matching anythinghash contact fields only
Phone hashed without the country codea valid-looking hash that matches nobodyadd the country code before hashing
Your server’s IP sent as the visitor’sthe IP describes your server, not the persontake it from the visitor’s request
Pixel and server on different Pixel IDsthe two copies can’t be deduplicatedone Pixel ID on both sides
event_time in millisecondsMeta expects Unix secondsdivide by 1,000
test_event_code left in productionMeta asks for it to be removed outside testingdelete it at launch

FAQ

How do I get a Conversions API access token?+

In Events Manager, choose your Pixel, open the Settings tab and click Generate access token under Set up manually, in the Conversions API section. The link is visible only to users with developer privileges for the business. If you run your own app and system user, you can generate the token in your business settings instead. Meta says neither route needs App Review.

Do I need a developer to set up the Conversions API?+

Not for every option. The Meta-enabled Conversions API is a one-click, web-only setup that mirrors your Pixel, and commerce platforms such as Shopify or WooCommerce offer partner integrations. The Conversions API Gateway needs a cloud account but no code. A direct integration needs a developer, and Meta estimates 2 to 4 weeks for a new one.

How do I test Conversions API events?+

Open the Test events tab of your Pixel in Events Manager, copy the test code and send it as test_event_code next to the data array. Submit your form, check that the server event arrives and that the browser copy is deduplicated, then remove the code. Meta says test events are not dropped, so a test lead counts as a real Lead.

What is the Conversions API Gateway?+

Meta software that you host in your own cloud account, on AWS or Google Cloud. The Meta Pixel sends its events to the Gateway, which forwards them to the Conversions API with an automatically generated event_id. It needs no code and costs only the cloud or partner fees. For website events it forwards what the Pixel sends; Meta also documents sending offline, app and CRM events to it, by file upload or, from version 1.6.0, a server endpoint.

Which parameters does a website Lead event need?+

event_name, event_time, action_source set to website, event_source_url and user_data, which must include client_user_agent for website events. Add an event_id for deduplication, the hashed email and phone, and fbc, fbp and the visitor's IP address unhashed.

Ready to find out what
converts, for real?

Free to start.

Start free →