If you’ve spent any time on AI search optimization lately, you’ve run into llms.txt — a proposed convention for a plain-text file at the root of your domain that hands large language models a clean, curated map of your site. It sits in the same conceptual family as robots.txt and sitemap.xml: a file at a well-known path that tells automated readers something useful about your content.
The interesting question for anyone who cares about attribution is whether llms.txt is a place to put UTMs. The answer is nuanced — it’s useful, but only for one specific job, and there’s a hard limit you can’t engineer your way past. Let’s separate the two.
What llms.txt actually is
llms.txt is a Markdown-formatted file you publish at /llms.txt. It gives an LLM a concise, human-curated index of your most important pages — typically a short description of your site followed by sections of links with brief notes. The pitch is that instead of an assistant guessing which of your thousand pages matter, you tell it directly: here are the canonical URLs for our docs, our pricing, our key guides.
Whether and how much any given assistant honors llms.txt varies, and the convention is young. Treat it as a low-cost signal you control, not a guarantee. But the part that matters here is concrete: llms.txt is a list of links you author. And links you author are links you can tag.
Where UTMs fit — and where they don’t
There are two very different surfaces in play, and conflating them is where people go wrong.
Surface one: links you publish in llms.txt. These are URLs you write into a file on your own server. You have complete control over the query string. You can append utm_source, utm_medium, and utm_campaign to every link in the file.
Surface two: the citation an assistant writes in its answer. When an LLM generates a response and links to your page, that link is constructed by the model from its own knowledge or from what it fetched. You did not author that URL, and you cannot reach into the model’s output to add parameters to it.
Those two surfaces have opposite properties. The first is fully yours to tag. The second is fully outside your control. llms.txt is firmly the first kind of surface — which is exactly why it’s worth tagging, and exactly why tagging it has limits.
How to tag the links in llms.txt
Treat llms.txt like any other place you expose links to a non-human reader: tag the canonical URLs with a consistent convention so that if an assistant follows one of those exact links, the visit arrives self-identified.
A sensible scheme uses a source that says the click came via your AI-facing surface and a medium consistent with the rest of your AI tagging:
utm_source = llms-txt
utm_medium = ai-assistant
utm_campaign = docs-index (or whatever section the link sits in)
So a link in your file becomes https://example.com/pricing?utm_source=llms-txt&utm_medium=ai-assistant&utm_campaign=site-index. Keep every value lowercase and hyphen-separated — utm_source=LLMs_TXT and utm_source=llms-txt are different rows in GA4, and casing drift here fragments the very data you’re trying to create. The full reasoning lives in a UTM convention for the AI search era.
Two caveats specific to this surface:
- Tag the canonical URL, not a redirect chain. If the tagged link bounces through a redirect that strips the query string, the UTMs never arrive. Point
llms.txtat the final destination with the parameters intact. - Don’t tag links to your own site that you also expose as canonical references elsewhere if it muddies canonicalization. UTMs create URL variants; for an AI index that’s usually fine because these are entry points, not internal navigation. But never carry these UTMs onto internal links once a visitor is on your site — that overwrites the original source. UTMs are for entry, not for moving around.
Use utm_medium=ai-assistant (not the bare ai): GA4’s native AI Assistants channel recognizes ai-assistant and files these sessions there automatically — no custom channel group required. The literal ai isn’t recognized and would still land in Unassigned, which is why the value to use is ai-assistant. See the GA4 channel guide for the full picture.
The limit you can’t engineer around
Here’s the part that keeps llms.txt honest. Most of the time, an assistant doesn’t follow the exact tagged URL from your file. It does one of two things instead:
- It cites your page in its own words, constructing a link to your bare canonical URL — no query string, no UTMs. The reader clicks that, and you get an untagged visit.
- It synthesizes an answer without linking at all, and the user never clicks through; they got what they needed inside the assistant.
You cannot tag a citation the model writes itself. There is no convention, no file, no header that lets you inject UTMs into a URL generated inside someone else’s product. This is the same wall that makes AI traffic show up as Direct / None: the assistant controls the link, the referrer, and whether a click happens at all.
So llms.txt UTMs capture a real but partial slice — the visits where an assistant followed your exact authored link. That’s genuinely worth having, because it’s attributable traffic you’d otherwise lose. But it is not a complete measurement of AI-driven traffic, and anyone selling it as one is overselling.
| What you’re tagging | Can you add UTMs? | Will the visit be attributable? |
|---|---|---|
Links in your llms.txt | Yes | Yes, if the assistant follows that exact link |
| A citation the model writes | No | No — you don’t author the URL |
| An answer with no link | N/A | No click happens at all |
How to think about it
llms.txt is a small, cheap, controllable surface — a file you write, full of links you can tag. Tag them with a consistent AI convention (utm_medium=ai-assistant) and you’ll catch the subset of assistant-driven visits that follow your exact links, cleanly attributed into GA4’s native AI Assistants channel instead of lost. Then capture visits server-side so the ones that arrive without a tag are at least recorded.
What llms.txt won’t do is let you tag the model’s own citations. That limit is structural, not a gap you’ll close with the right config. Build for the slice you control, measure it honestly, and don’t pretend the rest is something it isn’t.
For the bigger picture of where AI traffic comes from and how each assistant behaves as a source, the platform reference covers the major assistants one by one.
More in this series
- Track AI traffic from ChatGPT, Perplexity, and Gemini
- Why your AI traffic shows up as Direct / None — and how to fix it
- A UTM convention for the AI search era (GEO/AEO)
- Use AI to generate and govern your UTM taxonomy
- Agentic traffic: what AI shopping agents do to your attribution
- Tracking AI-generated ad campaigns without breaking your UTMs
- Should AI referral traffic get its own channel in GA4?