Meta Pixel and Conversions API on WordPress: A Setup That Tracks Leads

To track leads properly from Meta ads on WordPress, run the Meta Pixel in the browser and the Conversions API (CAPI) from your server, send the same event name and the same event ID from both so Meta counts each lead once, and include hashed contact details so Meta can match the event to a person. With only the Pixel, a large share of conversions never reach Meta because of ad blockers, browser privacy limits and cookie restrictions, and campaigns end up optimising on incomplete data.

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:

  1. The event name, exactly, for example Lead in both.
  2. The event ID: the Pixel sends it as eventID, the server sends it as event_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

  1. In Meta Events Manager, open Test events, enter your site URL and submit your own form.
  2. You should see the Lead event arrive from both the browser and the server, marked as deduplicated.
  3. Check Event Match Quality for the Lead event after a day or two, and look at which details Meta says are missing.
  4. 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.

Before you ask

Common questions.

Something else on your mind? Ask it on a 15-minute call.

Do I need the Conversions API if I have the Meta Pixel?

For lead generation, yes. The Pixel alone misses conversions blocked by browsers, ad blockers and declined cookies. CAPI sends them from your server so Meta sees a far more complete picture.

Why are my Meta leads counted twice?

Usually because the Pixel and CAPI events don’t share the same event name and event ID, so Meta can’t deduplicate them. Make both identical and send them within 48 hours of each other.

What is a good Event Match Quality score?

Higher is better. Sending hashed email and phone from your form, plus the fbp and fbc cookies, usually improves the score the most.

Can I set up the Conversions API without coding?

Yes, with a plugin that supports CAPI for your form plugin, or with Meta’s Conversions API Gateway. Custom or server-side tag setups need more technical work.

Does the Conversions API get around cookie consent?

It shouldn’t be used that way. Server-side tracking still needs a lawful basis, so follow your consent choices for both browser and server events.

Written by

Jamshadul Rafi

Freelance web designer in Comilla, Bangladesh. I rebuild Figma designs in WordPress and Elementor for clients on Fiverr and Upwork. These guides come from that client work.

Book a 15-min call
Keep reading

More guides.

All guides

  1. 001 Should Wedding Venues Show Prices on Their Website? 3 min read
  2. 002 Facebook Instant Forms vs a Landing Page: Which Gets Better Leads? 3 min read
  3. 003 Wedding Venue Website Checklist: 15 Things Couples Look For 3 min read
Start a build

Tell me what you're building.

A landing page, a full site, more traffic or a chatbot. A link and one sentence is enough. Before either of us commits, you get:

  1. What's straightforward and what I'd change first.
  2. What needs a decision from you.
  3. A fixed price and how long it takes.

Rather talk it through?

Pick a 15-minute slot. I'm in Comilla, Bangladesh (GMT+6), overlapping EU mornings and US evenings on purpose.

Opens my calendar. No pitch, no obligation — if it’s not a fit I’ll say so.

Prefer email? jamshadulrafi@gmail.com

Get a fixed-price estimate

What do you need?
Rough budget
Fixed price before I start. No obligation.