The Meta Conversions API (CAPI) lets you report affiliate conversions to Meta from your server instead of from a browser pixel. For an affiliate this is the only reliable option, because the conversion happens on the advertiser's site where you cannot place code. The network sends a postback to your tracker, the tracker matches it to the original click, and the tracker posts a server event to Meta with the click's fbclid, IP and user agent. Meta then attributes the conversion to the ad, the ad set and the campaign, and your optimization gets the signal it needs.

This guide walks through the full setup with BATracker: capturing the fbclid in the traffic source, adding the pixel and access token, mapping conversion events, wiring the network postback, testing with Events Manager, and reading the results per ad. It assumes you already run Meta ads and know your way around a tracker.

Quick answer

  • What the integration does: turns every network postback into a Meta server event attributed to the exact ad click.
  • What you need from Meta: a Pixel (dataset) ID and a Conversions API access token from Events Manager.
  • What you need in the tracker: a traffic source that stores fbclid as the external ID, a Meta pixel with the token, a campaign with the pixel attached and an event mapped, and your universal postback URL in the network.
  • Dedup: BATracker sends the conversion ID as event_id, so retries never double count. Do not fire the same conversion from the browser.
  • Where to look when it fails: Pixel Logs in BATracker (payload, status, response) and Test Events in Events Manager.

Why affiliates need CAPI rather than a pixel

A browser pixel fires on the page where the conversion happens. In affiliate marketing that page belongs to the advertiser. You see the click leave your lander, then nothing until the network's postback arrives. Meanwhile ad blockers, Safari's tracking prevention and in-app browsers already drop a share of browser events even when you do own the page.

Server-side reporting removes the browser from the loop. Your tracker already knows the click: timestamp, IP, user agent, the fbclid Meta appended, geo, device, and your sub IDs. When the postback arrives, the tracker has everything a Meta server event needs. How BATracker sends conversions to Meta CAPI and TikTok Events API explains the delivery pipeline in depth; this article is about setting it up correctly.

How the flow works

  1. The user clicks your Meta ad. Meta appends fbclid to the destination URL, which is your campaign URL on your tracking domain.
  2. BATracker records the click, stores fbclid as the external ID, assigns a 25-character click ID, and redirects to the lander or offer. Redirects are typically processed in under 10 ms on the tracker.
  3. The offer URL carries {click_id} in the network's sub parameter. The user converts on the advertiser's site.
  4. The network fires your postback: https://track.yourdomain.com/postback?clickid=<id>&payout=<amount>.
  5. BATracker matches the click, stores the conversion, then posts a server event to https://graph.facebook.com/v24.0/<pixelId>/events with the mapped event name.
  6. The send is logged with payload, HTTP status and Meta's response.

Prerequisites

  • A Meta ad account with a Pixel (dataset) and a Conversions API access token. Both are created in Events Manager under the dataset's settings.
  • A verified tracking domain in BATracker (Settings, Domains).
  • An offer whose URL passes {click_id} to the network, and the network configured to fire BATracker's universal postback. If this is new to you, read how to set up S2S postback tracking first.

Step 1: Traffic source that captures the fbclid

Create a traffic source for Meta. BATracker's Facebook Ads preset uses fbclid as the External ID Parameter and the following URL parameters. Each parameter is mapped to a tracking field (sub1 to sub20) so you can report on it later.

Parameter in your campaign URL Meta dynamic value Suggested tracking field
campaign_id {{campaign.id}} sub1
adset_id {{adset.id}} sub2
ad_id {{ad.id}} sub3
placement {{placement}} sub4
site_source {{site_source_name}} sub5
platform {{platform}} sub6
campaign_name, adset_name, ad_name {{campaign.name}}, {{adset.name}}, {{ad.name}} sub7 to sub9

The External ID Parameter must be fbclid. That single setting is what makes the Meta integration work: the tracker stores the value as external_id, shows it in the Visit Log, and uses it to build the fbc field of the server event. Do not type a macro for fbclid in your URL; Meta adds the parameter itself on every ad click. Meta's documentation on ClickID and the fbp and fbc parameters confirms that the fbc value can be built from an fbclid query parameter when no cookie exists, which is exactly the affiliate situation.

Meta's dynamic values such as {{campaign.id}} are entered through the URL parameters field of the ad. Check the current list in the URL parameters builder in Ads Manager, since Meta changes available values by objective.

Step 2: Put the campaign URL in the ad

Your campaign URL looks like this:

https://go.yourdomain.com/c/<campaignId>?campaign_id={{campaign.id}}&adset_id={{adset.id}}&ad_id={{ad.id}}&placement={{placement}}&site_source={{site_source_name}}

Use it as the website URL of the ad, or put the domain in the URL field and the parameter string in the URL parameters field. Either way, Meta appends fbclid at click time. Use a 302 or JavaScript redirect mode; the double meta refresh exists for referrer hiding and is not needed here.

Step 3: Add the Meta pixel to BATracker

Go to Settings, Pixels, and add a pixel of type Meta. Fill in the name, the Pixel ID and the access token. The token is encrypted at rest with AES-256-GCM and is only decrypted by the worker that sends events. Nothing else needs to be configured on the pixel itself; events are chosen per campaign.

Press Test Event. The dialog accepts an optional test event code from the Test Events tab in Events Manager. BATracker sends a synthetic event with that code and logs the result as a test fire in Pixel Logs. If Events Manager shows the event within a minute, the ID and token are correct.

Step 4: Attach the pixel to the campaign and map the event

Open the campaign, find Conversion Pixels, and add the Meta pixel. Choose the conversion event Meta should receive when a standard conversion arrives. The selectable list includes Purchase, Lead, CompleteRegistration, Subscribe, StartTrial, InitiateCheckout, AddToCart, AddPaymentInfo, Contact, Schedule, SubmitApplication, Search, ViewContent, AddToWishlist and FindLocation. For a CPA lead offer pick Lead; for a deposit, sale or paid trial pick Purchase.

If the network can send more than one event type, use Custom Conversions on the same campaign. Each row maps a postback event name (the event parameter the network sends, for example registration or deposit) to a pixel and a Meta event. When a postback carries that event name, BATracker fires the mapped event instead of the primary one, which lets you send CompleteRegistration for the sign-up and Purchase for the deposit from one campaign. Custom events are stored separately from conversions, so your revenue columns stay clean.

A campaign can carry several pixels. If you run the same offer from two ad accounts, attach both pixels and BATracker fires them in parallel; one failing never blocks the other.

Step 5: Network postback

In the network, paste BATracker's universal postback with the network's macros in place of the tokens:

https://track.yourdomain.com/postback?clickid={click_id}&payout={payout}&txid={transaction_id}

clickid is required (click_id and cid are accepted aliases). payout is optional and falls back to the offer's payout when missing. txid enables duplicate detection: a second postback with the same transaction ID returns success to the network but creates no second conversion and no second Meta event. event is optional and is what custom conversions key on.

What BATracker sends to Meta

Field Value
event_name The event mapped on the campaign (or the custom conversion)
event_time Unix time when the postback was received
event_id The conversion ID, stable across retries
action_source website
user_data.client_ip_address, client_user_agent From the original click
user_data.fbc fb.1.<timestamp>.<fbclid> built from the stored fbclid
user_data.country, ct, st, external_id, em, ph SHA-256 hashed where present
custom_data.value, currency, order_id Payout, currency, transaction ID

Meta's deduplication guidance requires matching event_id and event_name between browser and server events within a 48-hour window. In an affiliate flow you normally have no browser conversion event, so the stable event_id mainly protects you from BullMQ retries: the conversion row is written first, the send is retried up to three times with backoff, and the same event_id goes out each time.

Testing the full chain

  1. Open your campaign URL with a fake fbclid, for example &fbclid=test123, on your phone.
  2. In the Visit Log, find the click and confirm the external_id column shows test123 and the sub fields are filled.
  3. Fire the postback by hand in a browser: https://track.yourdomain.com/postback?clickid=<that click ID>&payout=1.
  4. Open the Conversion Log: the conversion should appear with payout 1.
  5. Open Pixel Logs (Settings, Postbacks, Logs tab): the Meta fire shows the payload, the HTTP status and Meta's response, which includes events_received: 1 on success.
  6. In Events Manager, the event appears under the dataset within a minute or two. With a real fbclid from a real ad click, Meta will also show it as attributed.

If step 5 shows an error, the response text tells you why: an expired token, a wrong pixel ID, or a rejected parameter. Fix it and resend by firing the postback again with a new txid.

Common mistakes

  • External ID Parameter left empty. The click is recorded, the event is sent, but without fbc Meta has only IP and user agent to match on. Set it to fbclid before you launch.
  • Firing conversions from the lander too. Some affiliates add a browser Purchase event on the lander's CTA click. That event is not a conversion and it inflates Meta's count. Keep the lander pixel at PageView or ViewContent and let the server send the conversion.
  • Testing with real purchases only. Use a manual postback and a test event code first; it costs nothing and isolates configuration errors from attribution questions.
  • Event mismatch between campaign and ad set optimization. If the ad set optimizes for Lead but the campaign sends Purchase, Meta learns from the wrong signal. Match them.
  • Missing txid. Networks resend postbacks. Without a transaction ID you rely on the per-click duplicate check, which is a weaker guard than an explicit transaction ID.
  • Late postbacks. Networks that approve conversions days later still deliver a usable event, but Meta's parameters documentation limits how old event_time may be. BATracker uses receipt time, which keeps the event inside the window as long as the postback arrives promptly after approval.

Optimization with sub IDs and reports

Because ad_id, adset_id and placement land in tracking fields, the BATracker report can be grouped by them. Compare cost, conversions, revenue and ROI per ad ID against what Ads Manager attributes. A gap between the two is normal (different attribution windows and modeled conversions on Meta's side), but a gap that only affects one placement usually means the in-app browser on that placement dropped the fbclid or the user never reached the lander. The ROI calculation guide covers how to read these columns.

Three habits that pay off:

  • Group by placement and site_source weekly. Audience Network and Instagram Reels often show very different CR at the same CPC.
  • Use custom conversions to send upstream events (registration, first deposit) as separate Meta events, then let the ad set optimize on the one that correlates with payout.
  • Keep bot and datacenter traffic out of the funnel with BATracker's filters so your clicks and your events describe real users. The bot detection article shows the filter setup.

Policies

Server-side reporting does not change what Meta allows. Report real conversions only, keep landers compliant with Meta's advertising policies and the local rules of the vertical you run, and use the tracker for measurement rather than for showing reviewers a different page. Meta can and does review destination pages after the fact.

Bottom line

For an affiliate, the Conversions API is how Meta learns what your traffic is worth, because the conversion happens on a page you do not control. The setup is short: store the fbclid as the external ID in the traffic source, add the pixel and token, attach it to the campaign with the right event, and point the network's postback at your tracker. BATracker handles the rest: the server event with fbc, IP and user agent, a stable event_id for retries, and a log line for every send so you can see exactly what Meta received. See the features overview for the related reporting and filter tools.