Connect Meta Conversions API (CAPI)
How to set up the Meta Conversions API to send qualified lead events and optimize your ad campaigns.
What is the Meta Conversions API?#
The Meta Conversions API (CAPI) allows you to send conversion events directly from the server to Meta (Facebook/Instagram). Unlike the Pixel, which depends on the visitor's browser, CAPI sends data server-side, ensuring greater accuracy.
Why use CAPI?#
- More data: does not depend on cookies or ad blockers
- Better attribution: Meta can associate conversions more accurately
- Campaign optimization: the algorithm receives real quality signals from leads
- Qualified leads = better conversions: by sending only qualified leads, you train the Meta algorithm to find similar people
By sending qualified lead events via CAPI, your ad campaigns start optimizing for lead quality, not just form submission volume. This can significantly reduce the cost per qualified lead.
Prerequisites#
- A Meta Business Manager ad account
- A Facebook Pixel configured
- A Conversions API access token
- An active scoring profile in Zero Bad Leads
Obtain the credentials#
Access the Events Manager
Go to the Meta Events Manager and select the Pixel you want to use.
Get the Pixel ID
The Pixel ID appears just below your Pixel's name. It is a 15-16 digit number (e.g., 123456789012345). Copy this value.
Generate the Access Token
On the Pixel page:
- Click the "Settings" tab
- Scroll to the "Conversions API" section
- Click "Generate access token"
- Copy the generated token
The Access Token has permission to send events on your Pixel. Store it securely and never share it publicly.
Configure in Zero Bad Leads#
Access Outbound Integrations
In the sidebar, click Send Leads. Find the Meta CAPI card and click "Integrate".
Enter credentials
Paste the credentials you obtained:
- Pixel ID: your Pixel ID (e.g.,
123456789012345) - Access Token: the token generated in Events Manager
Configure the event type
Choose the event type to be sent to Meta:
| Event | When to use |
|---|---|
| Lead | Qualified lead (most common) |
| CompleteRegistration | When the lead completes a registration |
| Contact | When the lead initiates contact |
| SubmitApplication | When the lead submits an application |
The Lead event is the most recommended for most cases. It allows Meta to optimize your campaigns to find more people with a profile similar to your qualified leads.
Name the integration
- Integration name: give it a descriptive name (e.g., "Meta CAPI - Qualified Leads")
Activate and test
Activate the integration and click "Send test lead". Check in Events Manager if the event appeared.
Data sent automatically#
Zero Bad Leads sends the following data to Meta, all hashed with SHA-256 to protect privacy:
| Data | CAPI Parameter | Hash |
|---|---|---|
em | SHA-256 | |
| Phone | ph | SHA-256 |
| First name | fn | SHA-256 |
| Last name | ln | SHA-256 |
| Country | country | SHA-256 |
| Lead ID | external_id | SHA-256 |
| Lead IP | client_ip_address | No (required for match) |
| User Agent | client_user_agent | No (required for match) |
| Event ID | event_id | No (deduplication with Pixel) |
| Consent | data_processing_options | No (compliance) |
Personal data (email, phone, name) is sent with SHA-256 hash as required by Meta. Zero Bad Leads never sends plain-text data to the Conversions API.
Requirement: For events to be sent to Meta, the Tracking Script (zbp.js) must be installed on the client's website. Without the script, dispatch jobs for Meta will be marked as "Skipped" to avoid sending low-quality events that hurt optimization. See how to install at Tracking Script (zbp.js).
Improve Event Match Quality with the Tracking Script#
To maximize the quality of events sent to Meta, install the Tracking Script (zbp.js) on your client's website. With it, Zero Bad Leads captures additional browser data:
| Additional data | CAPI Parameter | EMQ Impact |
|---|---|---|
| Meta Browser ID | fbp | High — enables deduplication with the Pixel |
| Meta Click ID | fbc | High — ad click attribution |
| Conversion page | event_source_url | Medium — conversion context |
When this data is present, Zero Bad Leads also changes the action_source from system_generated to website, which gives maximum weight in Meta's bidding model.
Without the script, typical EMQ is 3-5/10. With the script installed, EMQ rises to 7-9/10, significantly improving your campaign optimization. See how to install at Tracking Script (zbp.js).
Verify in Events Manager#
After configuring, go to Events Manager to verify:
- Open the Events Manager
- Select the configured Pixel
- Click the "Test Events" tab
- Check if the event appears in the list
- Review the match quality (Event Match Quality)
A match quality above 6.0 is considered good. The more data sent (email + phone + name), the better the match.
Troubleshooting#
Event does not appear in Events Manager:
- Check that the Pixel ID and Access Token are correct
- Events can take up to 20 minutes to appear in Events Manager
- Use the "Test Events" tab to verify events in real time
Low Event Match Quality:
- Make sure leads have email and phone. The more data, the better the match
- Install the Tracking Script (zbp.js) on the client's website to capture _fbp, _fbc, and other browser data
- Check that IP and User Agent are being collected in the inbound webhook
"Invalid OAuth access token" error:
- The token may have expired. Generate a new one in Events Manager
- Check that the token was not copied with extra spaces
Duplicate event:
- Zero Bad Leads sends a unique
event_idper lead to prevent deduplication - If you also use the Pixel on the frontend, Meta automatically deduplicates by
event_id
For best results, use CAPI together with the Pixel on the frontend. Meta automatically combines both signals (deduplication by event_id) and increases attribution accuracy.
Related articles
How to Connect HubSpot
Step-by-step guide to integrate HubSpot CRM with Zero Bad Leads and automatically send qualified leads.
Dispatch Filters
How to configure filters to send only the right leads to each outbound integration.
Tracking Script (zbp.js)
How to install the tracking script to capture browser data and improve the quality of events sent to Meta and Google Ads.