Campaign tracking

gclid, fbclid and other click ids, explained

What gclid, gbraid, wbraid, fbclid, ttclid and msclkid are, what each one is for, how long they last, and why keeping them matters for ad tracking.

On this page

When someone clicks an ad, the ad platform adds a long random value to the link: gclid= for Google, fbclid= for Meta, ttclid= for TikTok. These are click ids. They let the platform match a later sale back to the exact click, which is how the platform learns which ads work.

UTM tags tell your analytics where a visit came from. Click ids tell the ad platform which of its clicks turned into a sale. You usually want both.

The click ids, by platform

ParameterPlatformAdded by
gclidGoogle AdsAuto-tagging, on by default in most accounts
gbraidGoogle AdsiOS traffic where gclid cannot be used, for app conversions
wbraidGoogle AdsiOS traffic where gclid cannot be used, for web conversions
fbclidMeta (Facebook, Instagram)Outbound links from Meta's apps and sites
ttclidTikTokTikTok ads, when click id tracking is on
msclkidMicrosoft AdvertisingAuto-tagging
li_fat_idLinkedInLinkedIn ads
ScCidSnapchatSnapchat ads
epikPinterestPinterest ads
twclidXX ads
rdt_cidRedditReddit ads

Google introduced gbraid and wbraid for iOS 14 and later, where Apple's rules limit the use of gclid without consent. They are aggregate identifiers, so they cannot tie a conversion to one person (Google).

What a click id is for

A click id does nothing on its own. It is a key. The ad platform keeps a record of the click under that key: the campaign, ad set, ad, time and placement. Later, when you report a conversion with the same key, the platform can say exactly which ad earned it.

There are three ways the key comes back to the platform:

  1. The platform's own tag on your site reads it from the address and stores it in a first-party cookie, then sends it with the conversion. Meta's pixel stores it as _fbc; Google's tag stores the gclid in its own cookies.
  2. Your server keeps it with the order and sends it through the platform's server API: the Meta Conversions API, or Google Ads offline conversion upload.
  3. A file upload of conversions with their click ids, for sales that happen offline, such as a phone order.

For Meta, the server form is called fbc, built as fb.1.<time in milliseconds>.<fbclid> when no cookie exists, with the fbclid copied exactly, since it is case sensitive (Meta).

Why click ids go missing

  • Redirects that drop the query string. A www to bare domain redirect, or a CMS that cleans URLs, can remove everything after the ?. Test each landing page with a fake ?gclid=test and see if it survives.
  • Safari's Link Tracking Protection removes known click ids from links opened from Mail, Messages and Safari Private Browsing (Apple). UTM tags are not removed.
  • Consent. In the EU and UK, storing a click id in a cookie for later use usually needs consent. Without it, the id can only be used during that visit.
  • Short cookie lifetimes. Safari caps cookies set by script at 7 days (WebKit). A click id stored that way is gone if the buyer returns later.
  • Forms and checkouts on other domains. The click id lives on your site's domain. A booking widget or checkout on another domain cannot read it unless you pass it along.

Click ids and UTM tags together

UTM tagsClick ids
Who reads themYour analyticsThe ad platform
Who writes themYouThe platform, automatically
Human readableYesNo
Stripped by Safari protectionsNoYes, in some contexts
Ties a sale to one ad clickNoYes

Use both. UTM tags give every tool a readable source. Click ids let the ad platform learn from your sales.

Practical rules

  1. Keep auto-tagging on in Google Ads and Microsoft Advertising.
  2. Never strip unknown query parameters on your landing pages.
  3. Save the click id with the lead or the order, in a hidden form field or an order attribute, so you can send it back later.
  4. Send conversions server-side with the click id and, where allowed, hashed email and phone. See the Conversions API guide.
  5. Do not put click ids in your own reports as a dimension. They are unique per click, so every row would have a count of one.

Common questions

What is fbclid?

A click id Meta adds to links people click on Facebook and Instagram. Meta's pixel reads it and stores it as the _fbc cookie, so a later purchase can be matched to the click.

What is gclid?

Google Ads' click id, added by auto-tagging. GA4 reads it to show Google Ads campaigns, and Google Ads uses it to match conversions to clicks.

Can I remove fbclid from my URLs?

You can, but you lose Meta's ability to match sales to clicks. If your concern is clean URLs in shared links or duplicate pages in search, use a canonical tag instead of removing the parameter.

Is a click id personal data?

It identifies a click, not a person by name, but under GDPR an identifier that can be linked to a person is generally treated as personal data. Treat it with the same care as a cookie id.

Sources

Spotted something wrong or out of date? Email hello@sporetag.com and we will fix it.