Click IDs Are the Real Attribution Key: GCLID, FBCLID, WBRAID and Server-Side Tracking
The 60-second version
Every attribution argument rests on a query parameter in the landing URL. What each click ID is, the five places it dies, and the two server-side systems that recover it.
- What happened, in one line
- What to do about it this week
- What you can safely ignore
Every attribution argument you have ever had — Google vs Meta, platform vs CRM, this month vs last — rests on a single fragile thread: a query parameter in the landing-page URL. When someone clicks your ad, Google appends ?gclid=abc123, Meta appends ?fbclid=xyz789. If that string survives all the way to your checkout, you can join the click to the order and know exactly what worked. If it gets stripped anywhere along the way, the order still happens, the money still arrives — but your database has no idea an ad caused it.
Most teams treat click IDs as plumbing they will never look at. Then one day the numbers drift, the CRM shows a rising share of "Direct / Organic", and nobody can say which campaign actually drove the revenue. This post is the missing manual: what each click ID is, where it dies, and the two server-side systems that recover it.
The short version: a click ID is a receipt stapled to the visitor
The Life of a Click ID
Data JourneyAd click
Google appends gclid, Meta appends fbclid to your landing URL. This is the only moment the platform and your site share a common key.
Site journey
Redirects, consent banners, cross-domain hops and privacy features each get a chance to strip or expire the parameter before checkout.
Order row
If you persist the ID onto the order at checkout, every order carries its own attribution. If not, it is gone forever.
A click ID is not a cookie, not a pixel, and not an identity. It is a one-time receipt: random, single-use, meaningful only to the platform that issued it. Its entire job is to let you say, months later, "order 88412 came from Google campaign X" — by asking Google what it knows about receipt abc123.
The one-line mental model: UTMs tell you where traffic came from. Click IDs let the platform match your reported order back to the exact click, auction and creative. You need the first for your own reports; you need the second for the platform's bidding to learn from your real revenue.
The field guide: which ID belongs to whom
| Click ID | Issuer | Where you see it | Lifespan notes |
|---|---|---|---|
gclid | Google Ads | Search, Shopping, YouTube, Display clicks | Classic click ID; survives as long as your storage does, but Safari ITP caps the cookie jar around it |
gbraid / wbraid | Google Ads | iOS app clicks (gbraid) and iOS web clicks (wbraid) since ATT | Privacy-preserving replacements that carry less information by design — no user-level detail |
fbclid | Meta | Facebook/Instagram outbound clicks | Appended on every outbound click; frequently stripped by iOS link-decoration protections |
msclkid | Microsoft Ads | Bing clicks | Same pattern, smaller volume — but free attribution if you capture it |
ttclid | TikTok | TikTok clicks | Same pattern again |
There is nothing to "configure" to get these. They arrive uninvited on every ad click. The only decision is whether you store them.
Where click IDs die: the five kill sites
1. Redirect chains and link shorteners
Every hop between the click and the landing page is a chance to drop the query string. A common chain — ad → tracking template → shortener → CMS redirect → final page — can shed parameters at any hop that rebuilds the URL instead of forwarding it. Audit this with a single test click per channel per quarter; it takes ten minutes and catches the most embarrassing breakage.
2. Consent banners that fire tags late
If your tag manager only writes the click ID to storage after the visitor accepts tracking, every visitor who ignores, dismisses, or bounces before consenting arrives at checkout with no stored ID. Storing the raw click ID string in first-party storage at page load — before any consent decision — is a meaningfully different act from sending it anywhere, and your privacy review should treat the two steps separately.
3. Cross-domain hops (shop → checkout → payment)
Headless storefronts, hosted checkouts and third-party payment pages each start a new context. Unless the ID is forwarded explicitly (query passthrough or linker parameter), the checkout domain never sees it. This is the number-one cause of "plenty of clicks, zero attributed orders" in replatformed stores.
4. iOS link decoration stripping
Safari and in-app browsers strip known tracking parameters — fbclid among them — from links in private browsing and Mail/Messages contexts. There is no fix on your side; this traffic is simply unrecoverable at the click level, which is exactly why modeled and aggregated measurement exist alongside it.
5. Cross-device journeys
Click on phone, buy on laptop. No URL parameter survives that jump, ever. Recovery here comes only from identity (logged-in user, hashed email) rather than from the click ID — which is the entire argument for the server-side systems below.
The 40% direct-traffic mystery
Recovery system 1: store the click ID on the order
This is the cheapest attribution upgrade most stores never do. On landing, persist the click IDs to first-party storage. At checkout, write them onto the order record — a custom attribute, a metafield, a column, whatever your platform allows.
Show query
Capture first, ask permission questions about use. Storing a random platform receipt alongside an order is first-party data collection, but it is still tracking-adjacent. Get your privacy review to bless the storage step and the upload step separately — conflating them is how projects stall for six months.
Recovery system 2: server-side conversion APIs
Even a perfectly stored click ID only helps when the click and the purchase happen on the same journey. Server-side APIs — Meta's Conversions API, Google's Enhanced Conversions, TikTok's Events API — attack the remaining gap from the other side: instead of relying on the browser to report the purchase, your server tells the platform directly, with hashed customer information (email, phone) the platform can match to the ad viewer.
Browser Pixel vs Server-Side API
Reporting HierarchyBrowser pixel
Free and automatic, but lives exactly where ad blockers, ITP and consent refusal can kill it.
Server-side API
Your server reports the order with hashed identity. Immune to ad blockers and browser expiry.
Both, deduplicated
Send both with a shared event_id so the platform merges rather than double-counts. This is the documented best practice, not belt-and-braces.
The deduplication detail is the one teams get wrong: the same purchase sent via pixel and API without a shared event_id counts twice and inflates reported ROAS. With it, the platform merges the two signals into one conversion with a higher match confidence.
Reducing Unattributed Revenue, In Order
Process FlowForward click IDs across every domain hop
Shop to checkout to payment. Test with one live click per channel. Biggest recovery per hour of work.
Persist click IDs to first-party storage at landing
Before consent decisions, before redirects. First-party storage survives where third-party cookies do not.
Write the IDs onto the order at checkout
A column on the order row. This is the only attribution record nobody can take away from you.
Add the server-side API with shared event_ids
Covers ad blockers, ITP expiry and cross-device via hashed identity. Deduplicate against the pixel.
Frequently Asked Questions
Do I need developer help to capture click IDs?
About a day of it. Landing-page persistence is a few lines of script, and every major platform (Shopify, WooCommerce, custom checkouts) has a documented place for order attributes or metafields. The reporting join is standard SQL. The expensive part is never the code — it is discovering, a year later, that nobody stored them.
Does server-side tracking bypass consent requirements?
No — and vendors who imply otherwise are selling you liability. Server-side delivery changes the transport, not the permission. Consent Mode, limited-data-use flags and your regional consent posture still govern what may be sent. Treat CAPI as resilience for consented measurement, not as an alternative to consent.
If I do all of this, will platform numbers finally match my database?
Closer, never identical. Click IDs fix the identity gap (which click caused this order). The remaining gaps — attribution windows, view-through credit, modeled conversions, refunds — are definitional, not technical. Expect the gap ratio to shrink from 1.4x toward 1.1x, and report the rest as MER.
Summary & Next Steps
Click IDs are the cheapest durable attribution asset you own: a receipt stapled to each visitor, storable in first-party systems no platform change can revoke. Forward them across domains, persist them at landing, write them onto the order — then layer a deduplicated server-side API on top for the traffic no URL parameter can follow.
- Use click IDs for exact click-to-order joins in your own warehouse.
- Use offline conversion imports to push real revenue back into bidding.
- Use MER as the executive number while the plumbing improves.
Blended CAC Calculator
Total spend across every channel, divided by total new customers — the acquisition cost number that reconciles with what you actually spent.
Chinmay Raibagkar
About author →Founder of DataLens AI. He helps non-technical teams read their ad and database numbers with confidence — which number to trust, what to do next, and what to ignore.