Docsllms.txtSign in
View as Markdown

X links

X (Twitter) puts every link in a post behind a short link: https://t.co/<code>. A person who clicks the link arrives with https://t.co/<code> as the referrer, so most analytics tools show only "t.co". twelvebit finds the post behind the code and shows X post by @author: "…", with the visitors and the revenue that the post brought.

What you need#

Nothing to install. The script and the SDKs already send the referrer. Keep Search X (Twitter) on in Settings → Integrations → Mentions (it is on by default). Add your X handle or product name as an extra keyword there to find posts that do not write the domain out.

Where it shows#

  • Overview → Referrer: click the t.co row ("X posts →"). The Referrer tab then lists each X post with its visitors and its revenue. Click a post to open it on X.
  • Journey (People → a person): each visit from t.co shows the post under its source, and the headline says "found you on X, through a post by @author".
  • Live: the "Came from" column shows the post for people on the site now. On a phone it shows under the name.
  • Public dashboards show the same drill-down (X posts are public).
  • The REST API (/api/v1/breakdown) shows the referrer t.co; the per-post list is in the dashboard only for now.

Revenue is last touch, the same as the referrer breakdown: a payment counts for the post when the visit that led to the payment came from that post.

How a code is matched#

  1. Posts from the X search. Every 6 hours (and when you click "Check now"), twelvebit searches X for posts that name your domain or your keywords. It keeps each post's t.co codes with the post id, the author, a short excerpt and the time. A visit whose referrer has one of these codes is credited to that post. When several posts share one code, the latest post before the visit gets it.
  2. Codes that no known post has. The server makes one HEAD request to https://t.co/<code>, reads only the first redirect (Location), and stops after 3 seconds. That gives the page the link leads to, and the dashboard shows X link to example.com/pricing. The post itself stays unknown until the X search finds it.
  3. No code. Some browsers and apps send only https://t.co/ (or no referrer at all, as in the X app on some phones). These visits show as X (no link code). Add ?utm_source=x to links that you post to make them visible in the Source and Campaign tabs.

Privacy#

  • The HEAD request goes only to t.co, only with the code. It carries no visitor data, no IP address of the visitor and no cookies.
  • Each code is asked one time; the answer (or the failure) is kept, and the same code is never asked again.
  • Requests run after the visit is stored (never in the tracking request), and an hourly pass picks up the rest. They stop when you turn off Search X for the site.
  • Post data is public X data: the post id, the author handle, an excerpt and the time.

Limits#

  • The X search finds recent posts that contain the domain or a keyword. A post that links only through a shortener, or a post in a private account, is not found: its visits show as X link to … when t.co redirects to your site.
  • A t.co code can stay the same for one author who posts the same link again. The latest post before the visit gets the visit.
  • Quote posts and replies count as their own posts when they contain the link.