This is the setup I use for service businesses running lead ads to a WordPress site. It covers what each piece does, the setup options, and how to check it’s working.
Pixel and Conversions API: what each does
- Meta Pixel is JavaScript in the visitor’s browser. It sees page views and clicks, but it’s blocked or limited by ad blockers, Safari and Firefox privacy features, and visitors who decline cookies.
- Conversions API sends the same events from your server straight to Meta. It isn’t affected by browser blocking, and it can send more reliable details, such as the email a lead typed into your form.
You want both. The Pixel keeps browser signals like the click ID, CAPI makes sure the important events arrive, and deduplication stops Meta counting each lead twice.
How deduplication works
When a visitor submits your form, both the Pixel and CAPI send a Lead event. Meta treats them as one conversion when two things match:
- The event name, exactly, for example
Leadin both. - The event ID: the Pixel sends it as
eventID, the server sends it asevent_id, and the value must be identical, including letter case.
The two events need to arrive within 48 hours of each other. The simplest way to get a matching ID is to generate one when the form is submitted (the lead’s database ID works well), pass it to the Pixel on the success message or thank-you page, and send the same value from the server.
Three ways to set it up on WordPress
1. A plugin that handles both
Plugins such as PixelYourSite, and integrations built into some form and ecommerce plugins, can fire the Pixel and send CAPI events with matching IDs. This is the fastest route for most small sites. Check that the plugin supports your form plugin specifically, and that it sends events on a successful submission, not just on a button click.
2. Meta’s own gateway
Meta’s Conversions API Gateway runs on a small cloud server and forwards Pixel events to CAPI automatically. There’s little to configure in WordPress, but there’s a monthly hosting cost, and you have less control over which contact details are sent.
3. Server-side Google Tag Manager or custom code
The most flexible option, and what I use when a client also needs the same data in GA4 and Google Ads. The site sends events to a server-side tag container, which forwards them to each platform. It takes more setup and a separate server.
Send the right details for better matching
Meta scores each event on Event Match Quality: how well it can connect the event to a real account. The more reliable details you send with CAPI, the better the score and the better Meta can optimise.
- Email and phone from the form, normalised (lowercase, no spaces, phone with country code) and hashed with SHA-256 before sending.
- The fbp and fbc cookies, which carry the browser ID and the ad click ID.
- IP address and user agent of the visitor.
Only send what your privacy policy covers, and respect consent: in the UK and EU, visitors who decline marketing cookies shouldn’t be tracked for advertising in the browser, and your server-side events need a lawful basis too.
Test before you spend
- In Meta Events Manager, open Test events, enter your site URL and submit your own form.
- You should see the Lead event arrive from both the browser and the server, marked as deduplicated.
- Check Event Match Quality for the Lead event after a day or two, and look at which details Meta says are missing.
- Submit the form again on a phone with an ad blocker. The server event should still arrive.
Then make sure the campaign optimises for the Lead event, not for clicks or landing page views.
Common mistakes
- Event IDs that differ in format, such as a number in one place and a string in the other, or a different prefix.
- Firing Lead when the button is clicked rather than when the form actually succeeds, so failed submissions count as leads.
- Two plugins both sending the Pixel, which doubles every event.
- Page caching serving a stale form or token, so submissions fail silently. Always test with caching on.
- Sending contact details unhashed, or hashed without normalising first.
Get the page after the click right too
Tracking tells you what’s happening; the landing page decides how much of it is good news. My guide on why landing pages don’t convert covers the page side, and my ads service covers both, including a calculator for what a better page does to your cost per lead.