Docsllms.txtSign inGo to your sites

Updated

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.

Keywords

  • Write the keywords as a comma-separated list, for example yourproduct, @yourhandle.
  • Each keyword has 3 to 40 characters. twelvebit keeps the first 10.
  • The domain is always part of the search. You do not need to add it.
  • The search looks for each keyword as an exact phrase and leaves out reposts.

To change the keywords or to turn the search off, you need edit access to the site.

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.
  • Overview chart: posts that name the site show as notes on the chart, so you can see which post caused a spike. An X post gets the visits from its own t.co links, from one hour before the post to 14 days after it.
  • Journey (People → a person): each visit from t.co shows the post under its source. When the person's first visit came from a known post, 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.

What each row means

RowMeaning
X post by @author, with an excerptThe X search found the post that holds this t.co code.
X link to example.com/pricingt.co says where the code leads, but the X search has not found the post.
X link t.co/…, "Not resolved yet"twelvebit has not asked t.co about this code yet.
X link t.co/…, "t.co did not say where it leads"t.co gave no redirect for the code, or the request failed.
X (no link code)The browser sent only https://t.co/.

The drill-down (the filter f_referrer=t.co) lists up to 50 rows, sorted by visitors. Bot visits do not count. The other filters on the page apply too.

How a code is matched

  1. Posts from the X search. twelvebit searches X for the newest 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.

The match is made when you open a report, not when the visit is stored. So when the X search finds a post later, the earlier visits from its code move to the post by themselves.

When no known post is older than the visit, the post closest in time gets the visit.

When the search runs

  • When someone opens the site's Overview, if the last search is more than 6 hours old.
  • Once a day for each site that has data.
  • When you click Check now in Settings → Integrations → Mentions. Each person can check one time per hour.

Worked example

  1. You post "We launched a new pricing page" on X with a link to https://example.com/pricing. X shows the link as https://t.co/AbC123xyz.
  2. A person clicks it. The script sends a page view with the referrer https://t.co/AbC123xyz. twelvebit stores the visit in the Organic Social channel, with the referrer t.co. (UTM tags come first: utm_medium=cpc makes it Paid, and the visit stays in the X drill-down.)
  3. After the visit is stored, the server asks t.co where AbC123xyz leads. The Referrer drill-down shows X link to example.com/pricing.
  4. The next X search finds your post. Now the row is X post by @yourhandle: "We launched a new pricing page".
  5. Two days later the person comes back from Google and pays. Revenue is last touch, so the payment counts for Google. A payment in the visit from X counts for the post.

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.
  • The excerpt is the post text without its t.co links, on one line, at most 200 characters.

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.
  • The hourly pass looks at t.co visits of the last 2 days, and only on sites that received data in the last day.
  • A code has 4 to 20 letters and digits. A referrer with another form shows as X (no link code).