Meta Pixel, Conversions API and attribution

How do I capture and track the fbclid parameter through my funnel?

Meta appends the fbclid, you do not. Where to read it, how to keep it alive until the form, and how it becomes the fbc value you send back with the Lead.

Published

The fbclid is a Meta-generated parameter that arrives on your landing page URL when someone clicks a Facebook or Instagram ad. You never add it yourself. To track it through the funnel you read it on the first request, store it somewhere that outlives the page, keep the form on the same domain, and send it back to Meta with the conversion as the fbc value. Every step is small, and each one is a place where the value can quietly disappear.

What the fbclid is, and what it is not

Meta’s documentation on the click identifier describes it as a parameter passed with the URL of your website when someone clicks an ad, and states that the automatic attachment does not affect the tracking parameters you have already set. Your own UTM template and the fbclid share the same URL without conflict.

The value is case sensitive. Store it exactly as it arrived: no lowercasing, no trimming, no CRM field that normalises what you paste into it.

Three things the fbclid is not:

  • It is not the ad ID. It does not identify which ad was clicked without a lookup on Meta’s side, so it does not replace {{ad.id}} in your own data.
  • It is not the _fbc cookie. The cookie is what the Pixel writes, in the form version.subdomainIndex.creationTime.fbclid, and it can exist while the URL no longer shows anything.
  • It is not permanent. It belongs to one visit, the one that came from the click.

fbclid holds the short definition, and What is the difference between fbclid and the _fbc cookie? puts the two side by side.

Where the value gets lost

  • A redirect. Any hop between the ad and the landing page can rebuild the URL without its query string: a link shortener, an http to https rule, a CMS redirect, a geo redirect. The visitor still arrives, the page still loads, and the parameter is gone. Point the ad at the final URL, on the domain that serves the landing page.
  • A form that does not carry it. The URL can be perfect and the lead can still arrive with no click attached. The form never copied the value into a hidden field, a multi-step form moved to step two on a URL without it, or a thank-you redirect fired before anything was saved.
  • A form on another domain. If the landing page sits on one domain and the form posts to another, the first-party cookie stays behind. The click identifier is only readable by the domain that set it.
  • A return visit. Meta is explicit that a URL parameter applies to the visit that came from the ad. Someone who leaves and comes back later arrives without it, and only a stored identifier can link that second visit to the first click.

There is a fifth, quieter case: parameters that Meta adds on its own, which you should not build on. Meta says that since January 1, 2024 it may add campaign source, campaign medium, ad ID, campaign ID, ad set ID and a campaign tracking group ID to ad traffic automatically, and the operative word is may. Set your own template so the keys your CRM expects are always the same ones. Facebook URL parameters has the full list and the template.

Capturing it, step by step

  1. Read the parameter on the first request, in the same response that renders the landing page. Server-side is better than JavaScript here, because the value arrives with the request whether or not a script ever runs.
  2. Store it in a first-party cookie set in that response, HttpOnly, scoped to the domain that serves the page. Not local storage, which a redirect or a new tab can leave behind.
  3. Keep the form on the same domain, and post it to the same host.
  4. Copy the value into the lead record on submit, from the cookie rather than from the current URL, because the current URL may have changed in a multi-step flow.
  5. Send it back to Meta with the Lead, as fbc, if the Pixel’s cookie is missing.

The order matters. Capturing at step 4 only, from the URL at the moment of submit, is the most common mistake, and it fails on exactly the flows that matter: a two-step form, a quiz, a page that scrolls into a modal.

Turning it into the fbc value

Meta expects the fbc value in a fixed shape: version.subdomainIndex.creationTime.fbclid, where the version is fb, the subdomain index is 1 for a cookie set on the main domain, the creation time is a Unix timestamp in milliseconds, and the last part is the fbclid itself.

If your server stored the click with its arrival time, build the string from that. If you read the Pixel’s _fbc cookie instead, send it unchanged. The full format, with the normalisation rules, is in _fbc cookie and _fbp cookie, explained.

Send fbc along with the hashed email and phone, the fbp cookie, the visitor’s IP and the user agent. The click identifier is the field that ties the event to a specific click, and it is the one most often missing. Meta Pixel, Conversions API and attribution covers the rest of the payload.

A checklist before you go live

  • The template is in the URL parameters field of the ad, not in the website URL.
  • No key has an empty value.
  • One live click tested end to end: the URL the page receives, the cookie, the hidden field, the lead in the CRM.
  • No redirect between the ad and the landing page drops the query string.
  • The form posts to the domain that served the page.
  • The fbc value in Events Manager matches the click you tested.

If you need to strip the parameter from a URL you are sharing, How do I remove fbclid from a URL? has the steps, and it is worth knowing that removing it also removes the click from any conversion that follows.

What this buys you

A stored fbclid is what makes a lead attributable to a click rather than to a guess. It is also the input to a second question, which ad produced the lead, and that one needs the ad ID in the URL alongside it. How to track the Facebook ad ID in your CRM shows how the two parameters land in the same record, which is what a cost per lead by creative depends on.

Questions on this topic

All questions on this topic →

FAQ

Is the fbclid the same as the _fbc cookie?+

No. The fbclid is the value in the URL. The _fbc cookie is the value the Pixel writes, in the form version.subdomainIndex.creationTime.fbclid. Same click, two containers, and only one of them survives a redirect that drops the query string.

Can I rename the fbclid parameter?+

You should not. Meta generates it and Meta reads it back when you send fbc with an event. Renaming it means your own code has to rebuild the original value before the Conversions API call, and any mistake there is silent.

Does the fbclid survive a redirect?+

Only if every hop carries the full query string. A link shortener, an http to https rule or a CMS redirect can rebuild the URL without it. Test the URL the landing page actually receives after a real click, not the one you typed into Ads Manager.

What if the visitor comes back the next day?+

The URL parameter applies to the visit that came from the ad. If the person returns on their own, there is no fbclid in the URL, and only an identifier you stored on the first visit can link that return to the click.

Ready to find out what
converts, for real?

Free to start.

Start free →