How to Test Whether AI Assistants Cite Your Developer Docs
A practical way to check whether ChatGPT, Perplexity and Gemini cite your docs, and what to fix when they do not.
On this page 7 sections
To test whether AI assistants cite your developer docs, write 20 realistic questions your users ask, run each through ChatGPT, Perplexity and Gemini, and log every answer. Record whether your domain appears as a source, which page it names, and whether the answer is correct. Repeat monthly and compare the results.
Developers now ask assistants before they open a search tab. If your API reference never shows up in those answers, a competitor's blog post or a stale forum thread fills the gap. This guide is for engineers and docs owners who want evidence instead of guesses, and it covers crawler access, a repeatable prompt set, scoring, and fixes.
Backtrace covers the tools and habits that keep engineering teams shipping, and documentation that machines can read is now part of that work.
Why Should Developers Test AI Citations at All?
An assistant that skips your docs will recommend someone else's version of the truth. That means wrong parameter names, outdated install steps and a support queue that grows. Testing tells you where the gap is before your users find it.
The discipline has a name. Marketers call it answer engine optimizationSponsored, or AEO, and it overlaps heavily with technical documentation work. The shared goal is a page that answers one question cleanly enough for a machine to quote it.
Google states the same principle for its own systems. Its guidance says the systems prioritize helpful, people-first content over pages built only to rank. Docs written for a stressed engineer at 2 a.m. already fit that description.
Can AI Crawlers Reach Your Docs?
Not always, and this is the cheapest failure to fix. If your robots.txt or CDN rules block an assistant's crawler, that assistant cannot cite your pages in its search answers. Check access before you write a single test prompt.
OpenAI documents separate robots.txt tags for its crawlers. Its bot guide says sites that opt out of OAI-SearchBot will not be shown in ChatGPT search answers, though they can still appear as navigational links. Perplexity publishes its own list, and PerplexityBot is the agent that surfaces and links sites in its results.
Work through this quick audit before testing:
- Open your robots.txt and search for blanket Disallow rules on the docs path.
- Look for rules that name OAI-SearchBot, GPTBot or PerplexityBot individually.
- Check web application firewall and CDN bot rules that return 403 to unknown agents.
- Pull a week of server logs and confirm those user agents appear at all.
Treat each bot as a separate decision. Blocking a training crawler is a different choice from blocking a search crawler, and mixing them up is a common mistake. Backtrace's rule of thumb is to document the intent behind every robots.txt line in a comment, so the next engineer does not undo it.
Logs give you the clearest evidence. A user-agent string can be spoofed, so compare the requesting IP ranges against the ranges each vendor publishes. Perplexity, for example, lists the addresses for PerplexityBot in a public JSON file. If a bot shows up in your logs but never in your citations, the problem is probably content, not access.
How Do You Build a Prompt Set to Test AI Citations?
Write 20 questions in the words your users actually type. Pull them from support tickets, community threads and search console queries. Mix quick lookups, how-to tasks and troubleshooting errors so the set reflects real traffic.
Avoid prompts that name your product in the question. A user who already knows your tool will open your docs directly. The valuable test is the category question, such as "how do I rate limit an API in Node" or "what is the safest way to rotate a leaked token."
Group the prompts so results are easy to read later:
- Task prompts that ask how to complete a specific job.
- Concept prompts that ask what a term or feature means.
- Error prompts that paste a real message from your logs.
- Comparison prompts that ask you versus alternative tools.
Freeze the list once it is written. Changing prompts between runs makes every trend line meaningless. If you must add a question, add it to the end and track it as a new row.
How Do You Record and Score the Results?
Use a spreadsheet with one row per prompt per assistant. With 20 prompts and 3 assistants, that gives you 60 rows per run. Score each row on three fields: whether your domain was cited, whether the cited page is the right one, and whether the answer is accurate.
Keep the scoring blunt and binary so two people reach the same result. This table shows a workable layout:
| Field | What to record | Pass condition |
|---|---|---|
| Cited | Your domain appears in the sources | Yes or no |
| Right page | The URL named matches the best doc | Canonical page, not an old version |
| Accurate | Code and parameters match the current release | No outdated flags or removed methods |
| Position | Order among listed sources | Note first, middle or last |
The accuracy column matters most for developers. A citation that points to your docs but quotes a deprecated flag is worse than no citation, because it carries your name. Flag those rows for an immediate docs fix.
Run each prompt in a fresh session with no history. Assistants personalize answers and remember earlier turns, so a long chat will skew the result. Save the full answer text, since the same prompt can return different sources tomorrow.
Expect noise. An assistant may cite you on Tuesday and skip you on Wednesday, even for the same prompt. That variance is normal, so judge a prompt by its pattern across several runs rather than one answer. A single miss is a data point, and three misses in a row is a finding.
Consider a simple worked example. Suppose 12 of your 60 rows cite your domain on the first run. That is a 20 percent citation rate. If a docs rewrite lifts it to 21 of 60 a month later, you have a 35 percent rate and a number to show the team.
What Should You Fix When Your Docs Are Not Cited?
Fix the page the assistant should have used. Start with a direct answer in the first paragraph, then add the details. Assistants quote pages that state the answer plainly, and they skip pages that bury it under a long introduction.
Several patterns show up repeatedly when docs lose to third-party posts:
- The docs page is thin, and a blog post explains the same task better.
- The page lacks a clear heading that matches the question as users phrase it.
- Version numbers are missing, so the assistant cannot tell if the page is current.
- The content renders only in client-side JavaScript that crawlers never execute.
Structured question and answer markup can help machines read a page, and Google explains how it works in its FAQPage structured data guide. Use it only for real questions with real answers. Markup alone does not rescue a weak page.
Fixes also belong in your delivery process. Our guide on what developers control for page-level SEO covers the technical side, including rendering and metadata. A related checklist for SaaS teams reviewing page-level SEO works well as a pre-publish gate for docs.
Treat the docs build like any other release. After a change, run a quick check, in the spirit of how smoke tests catch broken deployments before users do. A script that fetches your key doc URLs and confirms a 200 status, a canonical tag and visible text catches many silent regressions.
Version changes deserve the same care that code changes get. When you ship a new major release, plan the docs update alongside it, as you would when you test a Node.js major version upgrade before production. Old pages should point clearly to the new ones.
There is a fair counterpoint here. Some teams decide a missing citation does not matter, because their users arrive through the product or a paid contract. That is a reasonable call for an internal API. For any public tool that competes for developer attention, the test is cheap and the downside of skipping it is a quiet loss of mindshare.
How Often Should You Rerun the Test?
Run the full prompt set once a month and after every major docs or product release. Assistants update their indexes and models on their own schedules, so a result that was true in October may not hold in November.
Compare runs on the same three fields. A rising citation rate with falling accuracy tells you the docs are visible but stale. A low citation rate with high accuracy tells you the content is good but hard to reach. Each pattern points to a different fix.
Keep the archive of answer text. When a stakeholder asks whether a docs rewrite helped, you can show the before and after answers side by side. That evidence also helps you decide which pages deserve the next investment.
Conclusion
Testing AI citations is ordinary engineering work. Confirm crawler access, write a frozen prompt set from real user questions, score every answer on citation, page and accuracy, then fix the weakest pages first. Repeat the cycle every month.
Your next step is small. Pick five questions from last month's support tickets, run them on three assistants today, and log what comes back. That one afternoon will show you exactly where your docs stand.