# Client ID

> The 14-character first-party cookie ID that anonymously identifies a visitor — the "who" in AnyTrack's identity graph.

The Client ID (`cid`) is a 14-character alphanumeric string that anonymously identifies a visitor. It answers *who* — as opposed to the Click ID, which answers *which action*.

## Where the Client ID comes from

It is set as a first-party cookie by the Tracking Tag when a visitor lands, or minted server-side via the collect endpoint when the Tag can't run (Facebook Lead Ads, offline conversions, headless checkouts, or a contact created directly inside a CRM).

## How the Client ID is used

To raise Event Match Quality, AnyTrack sends the Client ID back to each ad platform as its matching identifier — `external_id` for Facebook Ads and TikTok, `user_id` for Google Ads. In server-side setups the Client ID also forms the second half of the Click ID: `{propertyid}{cid}`.

## Client ID vs External ID

When the Click ID can't reach a destination (such as a CRM), you alias the visitor with an External ID (`refId`) — an email, phone, or your own customer ID. The External ID is something *you* control; the Client ID is the anonymous cookie AnyTrack sets.
