Sub topic 9
Finding Which Sources Assistants Cite
This chapter assumes you have a prompt set, a documented test protocol, and repeated runs saved in a structured record (CSV or JSON). It also assumes you can read short Python scripts. Earlier chapters covered how to record answers and conditions. Here you extend those records to capture the sources behind each answer and turn them into a ranked list of domains.
Why sources matter
A mention rate tells you whether an assistant names your brand. It doesn't tell you why. When an assistant uses a search or retrieval step, it builds its answer from pages it fetched, and those pages are often listed as citations. If the same three review sites appear behind most answers in your category, those sites shape what the assistant says. That is evidence you can act on, for example by correcting an outdated listing or checking whether your own pages are being found.
Source analysis has three goals:
- Find which domains and page types assistants cite for your prompts.
- Check whether your own pages and your competitors' pages appear.
- Check whether the cited page supports the claim the assistant made about your brand.
What counts as a source in an answer
Assistants present sources in different ways, and some present none. Record which form you saw so you don't compare unlike things.
| Form | What you see | How to record it |
|---|---|---|
| Inline citation | A numbered marker or link attached to a sentence | URL plus the sentence it supports |
| Source list | A list of links under or beside the answer | URLs in the order shown |
| Named source in text | "According to a G2 review..." with no link | Source name, no URL |
| No sources | Plain text answer | Empty list, and note the mode used |
An empty list is data, not a failure. Many assistants answer from what the model learned in training without searching the web. Others search only when the question seems to need current information. Your protocol records the mode (for example, web search on or off), so you can split results by it. A prompt that gets citations in one run and none in the next is common. Treat "answer had citations" as its own rate, calculated the same way as the mention rate.
Capturing citations during a test
Extend each run record with a citations field. Keep the URLs exactly as displayed, in order, and normalise them in a later step. Raw data stays useful if your cleaning rules change.
A useful record for one run:
{
"prompt_id": "disc-01",
"run": 1,
"mode": "web_search_on",
"mentions": ["Acme Analytics"],
"citations": [
"https://www.example-reviews.com/best-analytics?utm_source=chat",
"https://acme-analytics.example/pricing"
],
"named_sources": []
}For the first pass you only need the URL list. If you also want to check whether a source supports a claim, add a free-text note per citation, and fill it in only for the answers you review by hand.
Normalising URLs
Raw URLs from different runs often point to the same page but look different. Common causes:
- Tracking parameters such as
utm_source,gclidorfbclid. - A
www.prefix on some links and not others. - Uppercase letters in the host name.
- Fragments (the part after
#) and trailing slashes.
If you count raw strings, one page appears as several. Normalise first, then count at two levels: the page (normalised URL) and the domain (host name). Domain counts show which sites matter. Page counts show which specific articles matter.
Some assistants wrap links in a redirect URL on their own domain. If every citation resolves to the assistant's domain, the real destination is hidden. Click through, copy the destination, and note that in your protocol. Don't count the assistant's own redirect domain as a source.
Classifying sources by type
A list of domains is more useful when each one has a type. Start with a small set of types and extend it only when "other" grows too large.
| Type | Examples | What it tells you |
|---|---|---|
| Own site | Your product, docs, blog | Whether your pages are retrieved |
| Competitor site | A rival's pricing page | Who is being used as a reference |
| Review or comparison site | Software review directories | Third-party opinion shaping answers |
| Forum or community | Q&A sites, discussion boards | User-generated claims, possibly outdated |
| News or editorial | Trade press, blogs | Coverage and reputation |
| Reference | Encyclopedias, vendor-neutral docs | General background |
| Other | Anything unclassified | Needs a manual look |
Classification is a manual lookup table you maintain. Keep it in a file under version control so later runs use the same rules.
Counting: per-answer citation share
The unit to count is the answer, not the link. If one answer cites the same domain four times, count that domain once for that answer. Otherwise a single long answer can dominate the totals.
For each domain, compute:
- Answers citing it: the number of runs where it appeared at least once.
- Citation share: answers citing it divided by the number of answers that had any citations.
Use answers with citations as the denominator, so runs without sources don't push every share toward zero. Report the number of answers without citations separately.
Scripting the count
The script below normalises URLs, extracts domains, classifies them, and computes the per-answer share. It uses only the standard library.
from collections import Counter
from urllib.parse import urlparse
def domain_of(url: str) -> str:
"""Return the lowercase host name without a leading 'www.'."""
host = (urlparse(url.strip()).hostname or "").lower()
return host[4:] if host.startswith("www.") else host
def classify(domain: str, own: set, competitors: set, known: dict) -> str:
if domain in own:
return "own site"
if domain in competitors:
return "competitor site"
return known.get(domain, "other")
def citation_share(records, own, competitors, known):
answers_with_citations = 0
answers_without = 0
counts = Counter()
for r in records:
domains = {domain_of(u) for u in r["citations"]}
domains.discard("")
if not domains:
answers_without += 1
continue
answers_with_citations += 1
counts.update(domains) # a set, so each domain counts once per answer
rows = []
for domain, n in counts.most_common():
rows.append((domain, n, n / answers_with_citations,
classify(domain, own, competitors, known)))
return rows, answers_with_citations, answers_without
records = [
{"prompt_id": "disc-01", "run": 1, "citations": [
"https://www.example-reviews.com/best-analytics?utm_source=chat",
"https://acme-analytics.example/pricing"]},
{"prompt_id": "disc-01", "run": 2, "citations": [
"https://example-reviews.com/best-analytics",
"https://forum.example.org/t/123"]},
{"prompt_id": "disc-01", "run": 3, "citations": []},
{"prompt_id": "cmp-01", "run": 1, "citations": [
"https://examplebi.example/",
"https://example-reviews.com/compare"]},
]
rows, with_c, without_c = citation_share(
records,
own={"acme-analytics.example"},
competitors={"examplebi.example"},
known={"example-reviews.com": "review site", "forum.example.org": "forum"},
)
print(f"answers with citations: {with_c}, without: {without_c}")
for domain, n, share, kind in rows:
print(f"{domain} {n} {share:.2f} {kind}")
# answers with citations: 3, without: 1
# example-reviews.com 3 1.00 review site
# acme-analytics.example 1 0.33 own site
# forum.example.org 1 0.33 forum
# examplebi.example 1 0.33 competitor siteThe script keeps only the domain. If you also want page-level counts, normalise the full URL by lowercasing the host, dropping tracking parameters and fragments, and removing a trailing slash, then count those strings with the same per-answer rule. Domain extraction here is simple. It treats blog.example.com and example.com as different domains. That is often what you want, but decide on a rule and write it in your protocol.
The workflow at a glance
Reading the results
A few patterns are worth looking for:
- One domain dominates a prompt type. If a single review site appears in most discovery answers, your presence on that site matters more than a new blog post.
- Your own site is absent. The assistants may not be retrieving your pages for these questions. This can reflect many causes, from page content to access settings to the assistant's own retrieval choices. The test tells you the symptom, not the cause.
- Competitor pages appear in comparison answers. Check whether those pages say something inaccurate about you.
- A forum thread is cited for a claim about you. Read the thread. Old or wrong claims there can flow into answers.
Edge cases and gotchas
- A citation does not prove the page supports the sentence. Some assistants attach links to a paragraph loosely. Spot-check a sample by opening the page and looking for the claim. Record the result as supported, partly supported, or not supported.
- Pages change. The page you open today may differ from the page the assistant read. Save the date you checked, and keep a copy or screenshot of important pages.
- Links can be broken or invented. Some answers include URLs that return errors. Check with an HTTP request or by hand, and record dead links as their own category rather than dropping them.
- Source lists differ by interface. A web app, an API, and a mobile app may show different citations for the same prompt. Keep the interface in the test conditions.
- Order carries limited meaning. Don't assume the first link is the most influential. Report order only if the interface clearly ranks sources, and say so.
- Small samples mislead. A domain cited in 2 of 5 answers has a wide margin of uncertainty. Use the same repeat counts as for mention rates and avoid ranking domains that are separated by one answer.
- Correlation, not causation. If a site is cited often, that tells you the assistant used it in these runs. It does not tell you that changing the site will change future answers.
Turning sources into next steps
Sort your domain table by citation share and work from the top:
- For each own-site or competitor page, check that the content is accurate and current.
- For each third-party site with high share, check how your brand is described there, and note who controls the listing.
- For prompts where no sources appeared, decide whether to retest in a mode that uses web search.
- Record the findings with the date, so the re-test later in the series can show whether the picture changed.
Exercise
A test of 10 answers gives these results. Six answers have citations. Review site R appears in 4 of those six (one answer cites it three times). Your own site appears in 1 of the six. Four answers have no citations. What are the citation shares for R and your own site, and what should you report alongside them?
Show answer
R's share is 4/6 = 0.67, because each answer counts once no matter how many times it cites R. Your own site's share is 1/6 = 0.17. Report that 4 of the 10 answers had no citations, along with the mode, interface and date. Note that with only six answers with citations the figures are rough, so the difference between R and your own site is suggestive and needs more runs to confirm.
Exercise
Your script counts "www.example.com" and "example.com" as two different domains. Name the effect on your results and one way to fix it.
Show answer
The same site is split across two rows, so each row understates its share and rankings may be wrong. Fix it by stripping a leading "www." from the host name (as domain_of does) before counting, and write the rule in your protocol.