Blog

Send Meta CAPI events with proper FBC and FBP

fbc and fbp are the cookies that tie your CAPI events back to the Pixel. Misformatting them hurts attribution silently.

Meta uses two browser cookies for attribution: _fbc (the Facebook click identifier) and _fbp (the Facebook browser pixel). Your server-side CAPI events need to forward both as user_data.fbc and user_data.fbp. The format matters.

The fbc format

fb.{subdomainIndex}.{creationTime}.{fbclid}

Where:

  • subdomainIndex is the depth of the subdomain that set the cookie. For example.com it is 1, for www.example.com it is 2.
  • creationTime is the Unix timestamp in milliseconds.
  • fbclid is the raw click ID Meta appends to landing URLs.

Example: fb.1.1740000000000.IwAR1abc...

Generating fbc server-side

If the browser already has the _fbc cookie set (the Pixel does this on first hit), forward it as-is. If not, but the URL contains an fbclid parameter, construct the fbc value yourself in the tagging server:

const fbclid = data.fbclid;
const fbcCookie = getCookieValues('_fbc')[0];
if (fbcCookie) return fbcCookie;
if (fbclid) return 'fb.1.' + Date.now() + '.' + fbclid;
return undefined;

The fbp format

Similar structure but a random ID instead of a click ID:

fb.{subdomainIndex}.{creationTime}.{randomId}

The Pixel sets _fbp on first hit and persists it for 90 days. Your server should forward it when present and never try to construct it artificially; without a real Pixel hit, you have no valid randomId to use.

Why both matter

Meta's matching logic uses fbp to identify the browser, and fbc to attribute to a specific click. Without fbc, your conversion is matched but not attributed to a campaign. Without fbp, the conversion is harder to match at all. Send both whenever you have them.

Diagnosing missing fbc

In the Meta Events Manager test tool, look at the user_data section of incoming events. If fbc is missing or shows as "not present," your tagging server is not forwarding it. The most common cause is that the cookie was never set client-side, which means your Meta Pixel was not loaded on the page where the click landed.