F2F API

Meta CAPI

Meta Conversions API for F2F creators

A complete, production-grade walkthrough for sending F2F subscriptions, tips and PPV unlocks to Meta through the Conversions API, with first-party click capture and pixel deduplication.

Why F2F creators need the Meta Conversions API

Meta ads remain the largest paid acquisition channel for creators on F2F, but the classic Meta Pixel was designed for a world where a single website owned the whole funnel. A typical F2F funnel looks very different. A fan sees a Reel or a Story ad, taps through inside the Instagram in-app browser, lands on a link page or a tracking link, and then completes the actual purchase on F2F.com. You cannot place a Meta Pixel on F2F.com, the in-app browser isolates cookies from the fan's regular Safari or Chrome session, and iOS App Tracking Transparency removes the device identifier for the majority of iPhone users who decline tracking.

The result is that Meta sees the click but rarely sees the conversion. Campaigns that are actually profitable look unprofitable, the delivery algorithm optimizes toward the wrong audiences, and media buyers cut budgets on the creatives that work best. Agencies that move to server-side tracking commonly see 30% to 50% more attributed purchases in Ads Manager, without changing anything about the campaigns themselves.

The Meta Conversions API (CAPI) solves this by letting a server send conversion events directly to Meta. F2F API listens for transactions on F2F in real time, joins each transaction back to the original ad click using the first-party identifiers you captured, hashes the personal data, and posts the event to your Meta dataset within seconds. Because the event comes from a server, it is not affected by ad blockers, Safari ITP cookie caps, or in-app browser isolation.

Core identifiers Meta uses for matching

Meta matches a server event to a person using a set of customer information parameters. The more parameters you send, and the more accurate they are, the higher your Event Match Quality score and the better your attribution. For F2F funnels these are the parameters that matter most:

  • fbc: the click identifier. Meta appends fbclid to every outbound ad click URL. You convert it to the format fb.1.{timestamp}.{fbclid} and store it in the _fbc cookie. This is the single most valuable parameter because it ties the event to a specific ad click.
  • fbp: the browser identifier stored in the _fbp cookie by the Meta Pixel on your link page. It identifies the browser across visits.
  • em: the fan's email address, trimmed, lowercased and SHA-256 hashed. F2F API supplies this when the fan's email is available from the transaction.
  • client_ip_address: the IP address of the fan at click time, captured by your tracking link server. Never hash this value.
  • client_user_agent: the full user agent string from the click request. Never hash this value either.
  • external_id: a stable, hashed identifier for the fan, such as the F2F fan ID. It helps Meta connect repeat purchases from the same fan.

F2F API stores the click-time identifiers (fbc, fbp, IP and user agent) against the tracking link visit, and enriches them later with the purchase-time identifiers (em, external_id, value and currency) when the conversion settles.

Step 1: Create a dataset and access token

In Meta Events Manager, create a new dataset (formerly called a pixel) for each creator or for each brand you run ads for. Many agencies use one dataset per creator so that optimization signals stay clean and reporting stays simple. Note the dataset ID, a numeric string of 15 to 16 digits.

  1. Open Events Manager and select Connect Data Sources, then Web.
  2. Name the dataset after the creator and choose Conversions API as the connection method.
  3. Under Settings, find Conversions API and choose Generate access token. Copy the token immediately; Meta only shows it once.
  4. For long-lived production use, create a System User in Business Manager, assign it the dataset with full control, and generate a non-expiring token with the ads_management permission. Tokens generated from a personal profile can expire or be revoked when that person leaves the business.

Store the token in F2F API, not in your own front-end code. The token grants write access to your dataset, so it must stay on the server.

Step 2: Capture fbclid in a first-party cookie

When a fan clicks your ad, Meta appends ?fbclid=... to the destination URL. Your tracking link or link-in-bio page must read that parameter and store it immediately, because it disappears as soon as the fan navigates away. The simplest browser version looks like this:

// Store fbclid in a 90-day first-party cookie
const params = new URLSearchParams(window.location.search);
const fbclid = params.get('fbclid');
if (fbclid) {
  const fbc = `fb.1.${Date.now()}.${fbclid}`;
  document.cookie = `_fbc=${fbc}; path=/; max-age=${90 * 86400}; SameSite=Lax; Secure`;
}

A server-side version is more robust, because Safari ITP limits cookies written by JavaScript to seven days, while cookies set by your own server in an HTTP response can live for the full 90 days. Pick your stack below:

# Verify your tracking link sets the first-party _fbc cookie
curl -I "https://link.yourdomain.com/go/creator?fbclid=TEST_CLICK_123"

# Expected response header:
# Set-Cookie: _fbc=fb.1.<timestamp>.TEST_CLICK_123; Path=/; Max-Age=7776000; SameSite=Lax; Secure

Whichever version you use, your tracking link should forward the stored _fbc, _fbp, the client IP and the user agent to F2F API when it records the click. F2F API then holds these values against the fan's eventual F2F transaction.

Step 3: Send conversion events through F2F API

Once the dataset is connected in your F2F API dashboard, F2F API automatically sends events when transactions happen on F2F. You can also push events yourself, which is useful for custom funnels or for backfilling. The request below sends a PPV unlock as a Meta Purchase event:

curl -X POST "https://api.apif2f.com/v1/capi/conversions" \
  -H "Authorization: Bearer $F2F_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "creator_id": "crt_8f2a91",
    "networks": [
      "meta"
    ],
    "event_name": "Purchase",
    "event_id": "evt_5c1d7e",
    "event_time": 1767225600,
    "value": 24.99,
    "currency": "USD",
    "user_data": {
      "email": "fan@example.com",
      "fbc": "fb.1.1767225000000.IwAR2xyz",
      "fbp": "fb.1.1767224990000.123456789",
      "client_ip_address": "203.0.113.24",
      "client_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)"
    }
  }'

F2F API trims, lowercases and SHA-256 hashes the email before forwarding it to Meta, sets action_source to website, and adds the event_source_url of your tracking link. The default event mapping is: tracking link visit to ViewContent, free follow to Lead, new subscription to Subscribe, and PPV unlocks, tips and renewals to Purchase.

Choosing optimization events

For most creators, optimize campaigns for Subscribe when you want volume and for Purchase when you want high-value fans. Because renewals are also sent as Purchase events with their actual value, value-based bidding naturally learns which audiences produce long-term spenders, not just first-month subscribers.

Step 4: Deduplicate Pixel and server events

If you run the Meta Pixel on your link page and also send server events, Meta may receive the same conversion twice. Meta deduplicates two events when both the event_name and the event_id match and they arrive within 48 hours of each other. The rules are simple:

  • Generate the event_id once, on your server, as a UUID.
  • Pass it to the browser so the Pixel call uses the same value: fbq('track', 'Lead', {}, { eventID: id }).
  • Send the identical value in the server payload as event_id.
  • Never reuse an event ID for a different conversion, or Meta will drop the second one as a duplicate.

For purchases that happen on F2F.com, there is no browser event to deduplicate against, so F2F API generates a deterministic event ID from the F2F transaction ID. Retries of the same transaction therefore never double count.

Step 5: Maximize Event Match Quality

Event Match Quality (EMQ) is a score from 0 to 10 that Meta shows for each event in Events Manager. Scores above 6.0 are good; above 8.0 is excellent. F2F funnels usually reach 7 to 9 when the following are in place: a valid fbc for clicked traffic, the real client IP forwarded through any proxy or CDN using X-Forwarded-For, the full user agent, and a hashed email. Adding external_id helps further for repeat buyers.

The most common cause of a low score is a reverse proxy that replaces the client IP with its own address. If your tracking links run behind Cloudflare or a load balancer, read the original IP from CF-Connecting-IP or X-Forwarded-For rather than the socket address.

Step 6: Validate in Events Manager

Before going live, open the Test Events tab in Events Manager and copy the test event code, which looks like TEST12345. Add it to your F2F API dataset settings, or include test_event_code in a manual request. Test events appear in real time and do not affect campaign optimization. Check that each event shows the expected name, value, currency and matched parameters, and that deduplicated events are marked as such. Remove the test code once you are satisfied.

After launch, monitor the Overview tab for event volume, the Diagnostics tab for warnings, and the F2F API request logs for any non-200 responses from Meta. Each log entry includes the Meta fbtrace_id, which Meta support asks for when investigating issues.

Troubleshooting matrix

SymptomProbable CauseResolution
Low Event Match Quality (<6.0)Missing hashed email or IP/User AgentEnsure proxy headers forward client IP; hash emails in lowercase SHA-256
Duplicate ConversionsMismatched event_id between Pixel and CAPIVerify server generates UUID and shares it with browser event payload
Missing PurchasesF2F webhook delay or unhandled currencyConfirm webhook endpoint handles multi-currency ISO strings (USD, EUR, GBP)
Invalid Access Token (Code 190)Expired or unprivileged system user tokenGenerate a non-expiring System User Token with ads_management in Meta Business Manager
Server 400 Bad ParameterRaw unhashed email passed in em fieldAlways trim, lowercase, and SHA-256 hash personal identifiers prior to submission
Missing _fbc on iOS trafficLink tracking stripped by third-party appImplement link wrapping or landing page intermediate cookie persistence

Event timing and late conversions

Meta accepts events with an event_time up to seven days in the past. F2F API sends events within seconds, but if your integration was paused, backfill promptly. Events older than seven days are rejected and cannot be attributed. Renewals that occur months after the original click are still sent, because Meta attributes them using the stored fbc and hashed email within your attribution window settings.

Privacy and compliance

Only send data you have a lawful basis to share. Show a clear cookie notice on your link pages, honor opt-outs by skipping the _fbc cookie when a visitor declines, and use Meta's Limited Data Use flags for traffic from regions that require them. F2F API never sends raw email addresses or phone numbers to Meta, and you can disable any identifier per dataset from the dashboard.

Recover your lost conversions.

Free sandbox access, 1,000 monthly requests, no credit card. API automation and server-side ads tracking in one key.

Prefer email? hello@apif2f.com