← Blog

August 22, 2026 · 7 min read

How to track what AI agents ask about your website

TL;DR: Traditional web analytics is invisible to AI agent traffic. To track agent queries, log query text, answer confidence, source citations, and agent client at the MCP server layer or RAG endpoint. Sort the resulting data by no-answer rate to find documentation gaps, by volume to check citation freshness on your most-queried questions, and track helpful/unhelpful ratios over time as your agent quality score.

Your analytics dashboard shows browser sessions, page views, and bounce rates. But it shows you nothing about the AI agents querying your content every day — Claude, Cursor, Copilot, and dozens of others hitting your docs, support pages, and product content through MCP or direct web fetch.

That traffic is invisible in traditional analytics. And it matters more than you might think: when an AI agent can't answer a question about your product, that's a lost sale or a support ticket that never gets resolved. When the answer is wrong, it's your brand on the line.

This is a guide to making agent traffic visible — what to track, how to collect it, and what to do with it.

Why agent traffic is different from web traffic

Human visitors browse. They land on a page, scan it, maybe click to another. Agents query. They send a specific question against your content and expect a specific answer with citations. The query is structured. The failure mode is precise.

This means agent analytics surfaces things web analytics can't:

— Which questions are being asked (not just which pages are visited)

— Which questions have no good answer in your content

— Whether your answers are cited correctly or hallucinated

— Whether the answer to a question has drifted since you last updated the page

Traditional web analytics gives you a map of where people went. Agent analytics gives you a map of what they needed and whether they got it.

What to track

The minimum useful dataset for agent analytics is:

Query text — the exact question the agent sent. This is the primary signal. Cluster these and you have a feature request backlog, a docs gap report, and a support ticket predictor all in one.

Answer confidence — did your index return a high-confidence cited answer, a low-confidence hedge, or no answer at all? Low confidence and no-answer queries are your highest-priority documentation gaps.

Source citations — which pages were cited in the answer? This tells you which pages are doing the heavy lifting for agent traffic, independent of which pages get the most human visits.

Agent client — Claude Desktop, Cursor, Copilot, a custom agent? Different clients have different audiences. If Cursor is asking mostly about your API reference and Claude Desktop is asking about pricing, those are different users with different needs.

Rating/feedback — did the user signal the answer was helpful? A 1–5 rating on tool responses is the closest thing to a conversion signal for agent traffic.

Option 1: Log at the MCP server layer

If you run your own MCP server, you control the tool handlers. Log every tool call before you return the result:

// In your ask_site tool handler
server.setRequestHandler(CallToolRequestSchema, async (req) => {
  const { domain, query } = req.params.arguments

  // Log before calling your RAG pipeline
  await db.agentEvents.insert({
    tool: 'ask_site',
    domain,
    query,
    clientId: req.params._meta?.clientId,
    timestamp: new Date(),
  })

  const result = await ragQuery(domain, query)

  // Log outcome
  await db.agentEvents.update({
    answeredAt: new Date(),
    confidence: result.confidence,
    citedPages: result.sources.map(s => s.url),
    hadAnswer: result.confidence > 0.5,
  })

  return { content: [{ type: 'text', text: result.answer }] }
})

This gives you a full event log keyed by query. From here you can build a simple dashboard: query volume by day, top questions, low-confidence rate, and most-cited pages.

Option 2: Instrument your RAG endpoint directly

If your docs are served via a RAG API (not MCP), the same pattern applies at the HTTP layer. Log the incoming query, the retrieval results, and the final answer before returning the response:

// Next.js route handler
export async function POST(req: Request) {
  const { query, domain } = await req.json()

  const retrieved = await vectorSearch(domain, query)
  const answer = await generateAnswer(query, retrieved)

  // Fire-and-forget logging
  logAgentQuery({
    domain,
    query,
    topChunkIds: retrieved.map(c => c.id),
    answerLength: answer.length,
    hadSources: retrieved.length > 0,
    userAgent: req.headers.get('user-agent'),
  })

  return Response.json({ answer, sources: retrieved })
}

Option 3: Use AgentReady's built-in analytics

If you're using AgentReady to index and serve your site, agent events are already being logged. The analytics page shows platform-wide query volume, top sites, and feedback. Site-specific analytics — your queries, your answer quality, your gaps — are part of the Pro plan.

The advantage of purpose-built agent analytics over DIY logging: you get structured events without instrumenting your own pipeline, and the query clustering happens automatically.

Turning query data into action

Once you have query logs, the most valuable analysis is simple: sort by no-answer rate.

Queries that returned low confidence or no sources are direct documentation gaps. Every one of them represents a question a real user's AI agent asked, couldn't answer, and either failed silently or fell back to a hallucinated response. Write a page, update an existing one, or add an FAQ entry for each cluster.

The second most valuable analysis: sort by volume and check citation drift. Your top-10 most-queried questions should have clean, current, cited answers. If a high-volume query cites a page that hasn't been updated in six months, that's a freshness risk.

Finally, track the ratio of rated-helpful to rated-unhelpful answers over time. This is your agent answer quality score. If it drops after a deploy, something in your docs changed in a way that broke agent answers — even if the page still reads fine to humans.

The bigger picture

Agent traffic will grow faster than human traffic for documentation-heavy products. The companies that build observability into their agent layer now will have a structural advantage: they'll know which docs to prioritize, which questions their support team is about to get, and which features are being asked about before the roadmap reflects them.

Web analytics tells you where people went. Agent analytics tells you what they needed. That's a different and more actionable signal.

Frequently asked questions

What data should I track in agent analytics?

The minimum useful dataset includes: query text (the exact question sent), answer confidence (high/low/none — low and no-answer queries are your highest-priority docs gaps), source citations (which pages were cited), agent client (Claude Desktop, Cursor, Copilot, etc.), and user ratings/feedback. Together these tell you what was asked, whether it was answered, which pages are doing the heavy lifting, and what the agent's audience looks like.

How do I add query logging to my own MCP server?

In your tool handler, log to a database before calling your RAG pipeline (capturing domain, query, clientId, timestamp) and log again after (capturing confidence, cited pages, hadAnswer). This gives you a full event log keyed by query. From there you can build a dashboard showing query volume by day, top questions, low-confidence rate, and most-cited pages.

How should I act on agent query data to improve my documentation?

Sort queries by no-answer rate first — each cluster represents a documentation gap where a real user's agent asked something and got no answer. Write a page, update an existing one, or add an FAQ entry for each cluster. Then sort by volume and check citation drift on your top-10 most-queried questions. Finally, track the ratio of helpful to unhelpful ratings over time — a drop after a deploy signals a docs regression.