X (Twitter) campaign tracking with UTM
X wraps outbound links in its t.co shortener, which commonly strips the web referrer — so without UTM tags, X clicks often land in direct. This page gives a recommended structure, explains why t.co makes tagging essential, and advises picking one utm_source convention (x or twitter) and never mixing them.
Pick one source convention
Decide once whether your utm_source is x or twitter, document it, and use it everywhere. Mixing the two splits the same channel across two rows in every report. There is no automatic mapping between them — pick one and enforce it.
- utm_source=x (or twitter — choose one and never mix)
- utm_medium=social for organic; paid/cpc for ads
- utm_campaign=<your-campaign-name>
- utm_content=<optional, to compare posts or creatives>
Why t.co makes UTM essential
X routes outbound links through its t.co shortener. That redirect commonly results in no usable web referrer reaching your site, so an untagged link is attributed to direct. A UTM-tagged destination URL is read on arrival regardless of the redirect, so the click is still credited to X.
Because the tags live on the destination URL you control, they survive the shortener — the shortener only changes the link people click, not the parameters that land in the browser.
How it appears in analytics and logs
A visit with utm_source=x (or twitter) confirms an X-driven click independent of referrer. Without tags, the t.co redirect usually sends the visit into direct, undercounting X.
Diagnostic use case
Tag the X links you post so clicks are attributed to your campaign even though t.co drops the referrer, and standardise on a single utm_source value.
What WebmasterID can help detect
WebmasterID attributes utm_source=x visits to your X campaign even when the t.co redirect removes the referrer, so X appears as a measured source rather than disappearing into direct traffic.
Common mistakes
- Using utm_source=x in some links and twitter in others, fragmenting one channel.
- Posting untagged links and then under-crediting X because t.co stripped the referrer.
- Treating a handle as if it were a UTM label and embedding personal data.
Privacy and accuracy notes
Keep X UTM values generic. Never encode a handle as personal data or put any account identifier in a UTM. The values are public in the URL and server logs.
Related pages
- UTM naming conventions that survive reporting
Most UTM data problems are naming problems. Because tools treat utm_source=Reddit and reddit as different values, inconsistent casing and spelling fragment one campaign across many rows. This page gives a convention — lowercase, hyphenated, documented allow-list — that keeps reports clean.
- UTM parameters explained: the five tags and how to use them
UTM parameters are query-string tags you add to a link so analytics can attribute the visit to a campaign even when the referrer is missing. This page explains the five tags, a consistent naming convention, and the hard rule that UTM values are public — so they must never contain personal data or secrets.
- Campaign links (docs)
Generate UTM-tagged URLs that survive link shorteners.
Sources and verification notes
- MDN — Referrer-PolicyBackground on referrer stripping through redirects.
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.