d8a .tech

Resources / Blog

Every Click ID, Explained: gclid, fbclid, msclkid and the Rest

data tech team • #click-ids#gclid#fbclid#attribution#ecommerce#first-party-data
Feature image

Every paid click arrives with a receipt. When someone clicks your ad, the platform appends a parameter to your landing page URL, like ?gclid=Cj0KCQ... or ?fbclid=IwAR.... That string is the only thing that ties this visit to that click.

Keep it, and you can send conversions back to the ad platform, check whether paid traffic is real, and attribute revenue without guessing. Lose it, and you’re optimizing ad spend on modeled numbers.

Most analytics setups lose most of them.

What a Click ID Actually Is

A click ID is a unique identifier an ad platform generates for one ad click and adds to the destination URL. It’s different from UTM parameters:

That uniqueness is what makes click IDs valuable. It’s also why they’re personal data under GDPR in most readings: they can single out a visit. Collect and use them under your own legal basis and your consent setup.

The Click IDs You’ll See Most

ParameterPlatformWhat it identifies
gclidGoogle AdsA click on a Google Ads ad (auto-tagging)
gbraidGoogle AdsPrivacy-preserving click ID for iOS app-to-web journeys
wbraidGoogle AdsPrivacy-preserving click ID for iOS web-to-app journeys
dclidGoogle Display & Video 360, Campaign Manager 360A click on a display or video ad
srsltidGoogle Merchant CenterA click from a Google Shopping or product result
fbclidMeta (Facebook, Instagram)A click from Meta’s apps and ads
msclkidMicrosoft AdvertisingA click on a Microsoft (Bing) ad
ttclidTikTokA click on a TikTok ad
li_fat_idLinkedInA click on a LinkedIn ad
twclidX (Twitter)A click on an X ad
ScCidSnapchatA click on a Snapchat ad

There are more. Pinterest, Reddit, Yandex and most affiliate networks have their own. The pattern is always the same: a query parameter on the landing URL, unique per click.

Why They Matter

Sending Conversions Back to the Ad Platform

Ad platforms bid better when they know which clicks turned into revenue. Google Ads’ offline conversion import, Meta’s Conversions API and Microsoft Advertising’s offline conversions all match conversions to clicks using these identifiers. No click ID, no match.

This matters most when the conversion happens somewhere the browser pixel can’t see: a signed contract in your CRM, an approved loan, a phone order, a subscription that renews in month three.

Checking Whether Paid Traffic Is Real

A click ID tells you the platform claims this visit came from a paid click. Put that next to the visit’s behavior, IP signals and device data in your warehouse, and you can spot paid traffic that never scrolls, never converts and comes from the same network over and over.

Attribution You Can Audit

Channel reports in analytics tools are calculated for you. With click IDs on every session in your warehouse, you can check exactly which sessions came from which platform, join them with orders, and build the attribution model your business needs.

Why GA4 Gives You So Few

GA4 uses click IDs internally to classify traffic, but its BigQuery export only gives you three of them as fields, inside the collected_traffic_source record: gclid, dclid and srsltid.

Everything else, including fbclid, msclkid and ttclid, is left for you to dig out of the page_location string, which sits inside the nested event_params array. Every query becomes UNNEST, then string parsing, then rebuilding which session the landing page belongs to.

And if a visitor declined consent and you run GA4 with consent mode, the export may not contain that visit at all. That’s how consent should work. It’s also why you want everything you are allowed to collect in a structure you can actually use.

How d8a.tech Handles Click IDs

d8a.tech keeps every click ID that reaches your landing page, and writes it to your warehouse the moment the session closes.

Dedicated columns. The most common ones get their own columns, both on each event and on the session:

Attribution. Paid click IDs drive session source and medium, before UTM parameters and referrers are considered. A session landing with gclid, gbraid or wbraid is classified as google / cpc. The same goes for fbclid (Facebook), msclkid (Bing), ttclid (TikTok), li_fat_id (LinkedIn), twclid (Twitter) and ScCid (Snapchat). See traffic attribution in the docs.

Everything else. The full landing URL is stored on every event (page_location) and on the session (session_entry_page_location), so any other click ID is one function away.

Finding TikTok clicks per day in BigQuery:

SELECT
  date_utc,
  COUNT(DISTINCT session_id) AS tiktok_sessions
FROM events
WHERE REGEXP_EXTRACT(session_entry_page_location, r'[?&]ttclid=([^&#]+)') IS NOT NULL
GROUP BY 1
ORDER BY 1

The same in ClickHouse:

SELECT
  date_utc,
  uniqExact(session_id) AS tiktok_sessions
FROM events
WHERE extractURLParameter(session_entry_page_location, 'ttclid') != ''
GROUP BY date_utc
ORDER BY date_utc

Keep Your Tags, Get the IDs

You don’t need to re-tag your site to get this. d8a.tech speaks the GA4 protocol, so you can:

Whichever you pick, collection follows your consent setup. When analytics_storage is denied, the d8a.tech web tracker sets no analytics cookies. And you decide whether IP addresses are stored in full, truncated, hashed or not at all.

A Short Checklist


Click IDs are the most direct line between ad spend and revenue you’ll ever get. If you want all of them in your own BigQuery or ClickHouse, start with free Cloud or talk to us about your setup. More on the ecommerce side: analytics for ecommerce.

← Back to Blog

See d8a.tech on your own stack.

Talk to us about your architecture, terms, a partnership or sponsored development. Or start with free Cloud and evaluate it yourself.