Sub topic 11
Testing Whether Your Content Is Quoted
This chapter assumes you have read the earlier chapters on answer-first structure, self-contained passages, and crawler access. It also assumes you can read a server access log and edit a page's HTML. Here you will learn how to check whether AI answer systems retrieve, quote, or cite your pages, and how to turn the results into edits.
What you can and cannot measure
You can't see inside an AI answer system. No tool tells you why your passage was or was not chosen. What you can do is run the same questions repeatedly, record what comes back, and compare the results before and after a change.
Answers from these systems vary. The same question can return different text, different sources, or different citations from one run to the next. Results can also differ by product, by account settings, by location, and by date. Treat every single result as one sample, not as a fact about your page.
That shapes the whole method: use a fixed question set, repeat each question, record results in a consistent format, and look for patterns across many runs.
Three kinds of evidence
Different checks answer different questions. Keep them separate, because a success on one does not imply a success on another.
| Evidence | Question it answers | Where you get it |
|---|---|---|
| Crawler access | Can the system fetch the page at all? | Server logs, robots.txt checks |
| Retrieval and citation | Does the system show your URL as a source for a target question? | Manual or scripted question runs |
| Quotation quality | If cited, is the quoted or paraphrased text the passage you wrote, and is it accurate? | Reading the answer against your page |
A page can be fetched but never cited. It can be cited but misquoted. Only reading the actual answers tells you the third one.
Step 1: Build a target question set
Start from the questions your pages are meant to answer. Each answer-first section you wrote should map to one question, ideally the same wording as its heading.
Write questions the way real people ask them, and include variants. For a page about canonical URLs, a set might include:
- What is a canonical URL?
- How do I tell search engines which version of a page to index?
- Do I need a canonical tag on duplicate pages?
Keep the set small enough to rerun. Twenty to fifty questions is manageable by hand. Source the wording from places where real phrasing exists: your site search logs, support tickets, and the queries reported in your search console.
Include a few control questions, too. A control is a question where your page is not the obvious best source. If your page appears there anyway, or never appears, you learn something about how sensitive your results are to wording.
Step 2: Check crawler access first
If a crawler cannot reach the page, no edit to the writing will help. Check access before you judge content.
Look in your access logs for the user-agent tokens of the crawlers you decided to allow. The robots.txt file from the crawler-access chapter names them. Each vendor documents its own tokens and what each crawler is used for, and these change, so confirm them in the vendor's current documentation.
This script counts requests per crawler token in a standard combined-format access log:
import re
import sys
from collections import Counter
TOKENS = ["OAI-SearchBot", "GPTBot", "PerplexityBot", "ClaudeBot"]
def count_hits(log_path):
hits = Counter()
status = Counter()
pattern = re.compile(r'"(?:GET|HEAD) (\S+) [^"]*" (\d{3})')
with open(log_path, encoding="utf-8", errors="replace") as log:
for line in log:
for token in TOKENS:
if token in line:
hits[token] += 1
match = pattern.search(line)
if match:
status[(token, match.group(2))] += 1
return hits, status
if __name__ == "__main__":
hits, status = count_hits(sys.argv[1])
for token in TOKENS:
print(f"{token}: {hits[token]} requests")
for (token, code), n in sorted(status.items()):
print(f" {token} -> HTTP {code}: {n}")Run it as python crawler_hits.py access.log.
Read the status codes, not only the counts. A crawler that gets mostly 403 or 429 responses is being blocked by a firewall or rate limiter, even if robots.txt allows it. A crawler that gets 200 is reaching you.
A user-agent string is easy to fake. If the exact count matters, for example when you are deciding whether to block traffic, verify the requests against the IP ranges or reverse-DNS method the vendor publishes.
Also remember that some assistants fetch a page live when a user asks, while others rely on an index built earlier. A live fetch may show up in your logs within seconds of a test question. An index-based answer may reflect a crawl from days or weeks ago. This affects how long you should wait before judging an edit.
Step 3: Run the questions and record the results
Run each question in each product you care about. Do it in a clean session where possible, because earlier conversation can bias later answers. Run each question at least three times, and note the date.
For every run, record these fields:
- The question and the exact wording used
- The product and mode (for example, a search-enabled mode versus plain chat)
- The date
- Whether your domain appears among the cited sources
- Whether the answer's text matches your passage, either quoted or paraphrased
- Whether the answer is accurate against your page
- Which competing domains were cited instead
A spreadsheet or a CSV file is enough. Here is a minimal structure:
date,product,question,run,cited,cited_url,text_matches,accurate,competitors
2026-11-29,ProductA,What is a canonical URL?,1,yes,/guides/canonical-urls,paraphrase,yes,example.org
2026-11-29,ProductA,What is a canonical URL?,2,yes,/guides/canonical-urls,quote,yes,example.org;example.net
2026-11-29,ProductA,What is a canonical URL?,3,no,,,,example.orgDistinguish citation from use. Some products list sources that were consulted but not used in the answer text. A listed source without matching text is weaker evidence than a passage that visibly appears in the answer.
You can script runs through a product's API if it offers one with web search. Be aware that API behavior may differ from the consumer product, so the two are not interchangeable. If you automate, keep the same fixed question list and store the raw responses so you can re-read them later.
Step 4: Summarize across runs
Compute a simple rate for each question: the number of runs in which your domain was cited, divided by the total runs. A question cited in 2 of 3 runs is a different situation from one cited in 0 of 3.
This script reads the CSV above and prints a citation rate per question and product:
import csv
import sys
from collections import defaultdict
def citation_rates(csv_path):
runs = defaultdict(int)
cited = defaultdict(int)
with open(csv_path, newline="", encoding="utf-8") as f:
for row in csv.DictReader(f):
key = (row["product"], row["question"])
runs[key] += 1
if row["cited"].strip().lower() == "yes":
cited[key] += 1
return {key: cited[key] / runs[key] for key in runs}
if __name__ == "__main__":
rates = citation_rates(sys.argv[1])
for (product, question), rate in sorted(rates.items()):
print(f"{rate:4.0%} {product} {question}")With small samples, do not over-read differences. Going from 1 of 3 to 2 of 3 after an edit is not proof the edit worked. Collect more runs, or wait for a consistent pattern across several questions before drawing a conclusion.
Step 5: Diagnose what the results mean
Match the pattern you see to a likely cause, then fix the cause that matches. Test the hypotheses in this order, from cheapest to most expensive.
| Pattern | Likely cause | What to check or change |
|---|---|---|
| No crawler hits in logs | Blocked or never discovered | robots.txt, firewall, sitemap, internal links |
| Crawler hits with 4xx or 5xx | Server or firewall rejecting bots | Rate limits, bot protection rules, errors |
| Crawled, never cited | Content not matching the question, or not chosen over others | Heading wording, answer-first opening, specificity |
| Cited, text does not match your passage | Passage not self-contained, or the system summarized a different section | Rewrite so the target passage stands alone |
| Cited, but answer is wrong | Ambiguous or outdated wording | Add precise definitions, numbers, dates |
| Competitors cited with a clearer answer | Their passage is more direct or more specific | Compare their opening sentences to yours |
When a competitor is cited, read their passage. Look at how soon the answer appears, whether the passage names a source, and whether it defines its terms. Learn from the structure, and do not copy their wording.
If content renders only through JavaScript, check what a crawler sees without running scripts. Fetch the raw HTML and confirm your answer text is in it:
curl -s https://example.com/guides/canonical-urls | grep -i "preferred address"If the grep returns nothing, the passage may be injected by client-side scripts. Some crawlers do not execute scripts, so the text can be invisible to them.
Step 6: Change one thing, then retest
Make one kind of change at a time, for example rewriting the opening of a single section. Record the edit date and the page URL. Then rerun the same questions after enough time has passed for the system to see the change.
If you change the heading, the opening, the markup, and the robots rules all at once, you will not know which change mattered. Small isolated edits give you clearer information, though the noise in the results means you will rarely get certainty.
Keep a change log next to your results file:
2026-11-29 /guides/canonical-urls Rewrote first two sentences of "What is a canonical URL?" to define the term directly.
2026-12-13 /guides/canonical-urls Reran 3 questions x 3 runs x 2 products.Common mistakes when testing
- Testing once. One run says little because answers vary. Repeat each question.
- Testing only your brand name. Asking "what does Example Co say about canonicals" tests whether the system can find you when named. Real users ask without your name.
- Leading questions. Wording that borrows phrases from your page makes retrieval easier than it will be in practice. Use natural phrasing.
- Ignoring personalization. Logged-in sessions, location, and history can change results. Use a consistent, clean setup.
- Treating a citation as a win. A citation with a wrong paraphrase can hurt. Read the answer.
- Treating a miss as a failure of the page. The system may have chosen another good source. Your page can be correct and still not be picked.
Putting it together
A practical routine looks like this:
- Maintain a fixed list of target questions tied to your page headings.
- Check logs for crawler hits and status codes before judging content.
- Run each question several times in each product and record the results in a CSV.
- Compute citation rates and read the answers for accuracy.
- Diagnose by the pattern, fix one thing, and retest after a delay.
- Repeat on a schedule, such as monthly, and after major edits.
Exercise
Your logs show OAI-SearchBot receiving HTTP 200 for your canonical URL guide. When you ask three target questions three times each, your domain is never cited, and a competitor is cited in most runs. Name the first two things you check, and explain why changing robots.txt is not one of them.
Show answer
First, read the competitor's passage and compare it to yours: how soon it states the answer, whether it defines terms, and whether your heading matches the question wording. Second, check that your answer text is in the raw HTML (for example with curl and grep) and that the passage makes sense on its own. Changing robots.txt is not the fix because the 200 responses show the crawler already reaches the page, so access is not the problem.
Exercise
A CSV of results shows a question cited in 1 of 3 runs before an edit and 2 of 3 runs after. A colleague says the edit worked. What is a sound response?
Show answer
The sample is too small to support that conclusion, because answers vary between runs. Collect more runs per question, check whether the change appears across several related questions and products, and keep the date and change log. Treat the result as a weak signal until a consistent pattern appears.
Exercise
Why should you record whether the answer text matches your passage, and not only whether your domain was cited?
Show answer
Some products list sources that were consulted but not used in the answer text, and a cited page can be paraphrased inaccurately. Matching text shows your passage was actually used, and checking accuracy shows whether the quoted or paraphrased content is correct.