Skip to content
measure

How to track AI agent traffic on your website

Most AI crawlers don't run JavaScript, so your snippet misses them. How to find them in logs, capture them server-side, and count them apart from humans.

Guides8 min readBy Measure team

To track AI agent traffic on your website, capture requests on the server, not just in the browser, and sort them by the user agent each request presents. Most AI crawlers don’t run JavaScript, so a JS analytics snippet misses them; your server logs, your CDN, or a server-side call to your analytics tool will see them.

This guide covers where agent traffic hides, how to find it in your logs today, and how to get it into your analytics without it inflating your human numbers.

Why doesn’t my analytics show AI agent traffic?

Because most analytics runs in the browser. A tag loads, runs a script, and reports the page view. A crawler that fetches your HTML and never runs scripts never reports anything.

Most AI crawlers work that way. Googlebot and some assistants do render JavaScript, so a snippet catches a slice of automated traffic and misses the rest. You get a number, but not the whole picture.

Other analytics vendors say the same. PostHog’s docs put it plainly: “Most bots don’t run JavaScript, so the PostHog JavaScript SDK never fires a $pageview for them” (PostHog). Matomo says AI chatbots “don’t load your pages the same way human visitors do, so standard JavaScript tracking can’t capture that activity” (Matomo).

What kinds of AI agents visit a website?

Three kinds, and they mean different things for you.

AI agents by purpose, as Measure classifies them
PurposeExamplesWhat the visit means
TrainingGPTBot, ClaudeBot, Meta-ExternalAgentCollecting content that may train a model
SearchOAI-SearchBot, Claude-SearchBot, PerplexityBotIndexing your page so it can show up in AI answers
AssistantChatGPT-User, Claude-User, Perplexity-UserFetching your page because a person asked about it

What each operator says about its own agents, with user agent strings and robots.txt tokens, is in GPTBot vs OAI-SearchBot vs ChatGPT-User. Anthropic’s three are covered in ClaudeBot: what Anthropic’s crawler does.

Classic search crawlers like Googlebot and Bingbot are a separate group again. They’re bots, not AI agents, and you probably want them counted on their own.

How do you find AI agents in your server logs?

Search your access log for the agent names. Every request your server answered is in there, whether or not it ran JavaScript.

Count AI agent requests in an access log
grep -i -o -E 'GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot|Perplexity-User|meta-externalagent' access.log \
  | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -rn

That gives you a count per agent. Swap -o for a filter on your log’s path field and you can see which pages each one read.

Two limits. First, a user agent is a claim, not proof; anyone can send a request that says GPTBot. To check, match the IP against the operator’s published list. We walk through that in good bots vs bad bots. Second, grepping logs is a one-off. It doesn’t give you a trend, a page breakdown next to your human traffic, or an answer next week without running it again.

How do you get agent traffic into your analytics?

Send it from the server side. There are three common routes.

  • Forward requests from your app or edge. Your server, middleware or edge worker sees every request, so it can report the ones from crawlers to your analytics tool.
  • Connect your CDN’s logs. Some tools read request logs straight from your CDN, so there’s no code to write.
  • Import log files. Batch upload what your server already writes.

Whichever route you pick, the tool still has to sort the traffic. An AI agent shouldn’t count as a visitor, and an uptime check shouldn’t count as an AI agent.

How does Measure count humans, AI agents and bots?

Measure counts three groups separately:

  • Humans: “People with a browser. Pages, referrers, countries and devices, without cookies or fingerprinting.”
  • AI agents: assistants fetching a page for someone, like ChatGPT-User and Claude-User, and crawlers that train models, like GPTBot and ClaudeBot.
  • Bots: “Uptime checks, SEO tools and scrapers. Kept out of your human numbers, still there if you want them.”

Each AI agent is named with its operator and purpose (assistant, training or search), with its requests and its top page (for agents). Agent traffic is always broken out from human traffic, so a crawler reading your docs doesn’t inflate your visitor count.

The script catches the agents that render pages. For the ones that don’t, your server sends POST https://lets.measure.events/api/collect with your site_id and the path, plus the crawler’s user agent or an explicit agent name. Measure classifies those requests the same way it classifies a script visit. The For agents page documents the endpoint.

Then ask. Measure’s MCP server has a get_agents tool that lists every AI agent that fetched your site, with operator, purpose, request count and top page. “Which pages did ClaudeBot read this week?” gets an answer from your own data. See ask your AI agent about your traffic and analytics your AI agents can actually use.

How do other analytics tools handle AI agent traffic?

Several tools now report it, in different ways. Here is what each says on its own pages, checked 2026-11-22.

PostHog “classifies traffic by user agent and source IP address”, checking IPs against crawler ranges published by Google, OpenAI, Microsoft, Apple, Perplexity and Ahrefs. It splits traffic into AI Agent, Bot, Automation (curl, headless browsers) and Regular. To see crawlers that never run its SDK, you “forward your HTTP access logs to PostHog as $http_log events” via a Vercel logs source, an edge worker or its capture API. PostHog calls the feature “brand new” and detection “best-effort” (PostHog).

Microsoft Clarity has a Bot Activity dashboard “based on real server-side logs collected through supported CDN and server integrations.” You connect a server or CDN under Settings, then AI Visibility, and it shows bot operators, AI request share, activity by purpose and the paths bots request. Clarity notes that connecting an integration “might result in additional costs depending on your provider,” and that a bot request “doesn’t indicate that content was retrieved, grounded, cited, or surfaced in AI generated responses” (Microsoft Learn).

Matomo tracks “three main types of AI traffic separately: AI referrals, chatbots, and agents.” Its chatbot reports “use server-side telemetry”, and it says crawlers “used purely for indexing or model training are excluded from Matomo’s AI Agent and AI Chatbot reports” (Matomo). Its AI Agent Overview, from Matomo 5.6.0, compares AI and human visits on visits, visit duration, actions and bounce rate (Matomo FAQ).

When is another tool the better pick?

Honestly, often.

  • Pick Clarity if your site sits behind a CDN it supports and you’d rather connect logs than write any forwarding code, or if you already run Clarity on the site.
  • Pick PostHog if you already use it for product analytics and want bot classification inside the same events, or you want an Automation bucket for curl and headless browsers.
  • Pick Matomo if you want analytics on your own server (it lists On-Premise as well as Cloud), and you don’t need training or indexing crawlers reported, since its AI Agent and AI Chatbot reports exclude them.
  • Pick Measure if you want training, search and assistant agents all counted, named by operator and purpose, apart from humans and bots, without cookies, and you want to ask an AI assistant about it over MCP.

What should you look at once you can see them?

Start with three questions.

  1. Which agents visit, and for what? Training crawlers and assistant fetches call for different decisions. Robots.txt choices per agent are in GPTBot vs OAI-SearchBot vs ChatGPT-User.
  2. Which pages do they read? If assistants keep fetching your pricing or docs, people are asking about them.
  3. Did a change work? After you edit robots.txt, check whether the blocked agent stopped coming.

FAQ

Can Google Analytics or another JS tag see AI crawlers?

Only the ones that run JavaScript. Most AI crawlers don’t, so a JS tag misses them. To see those, capture requests on the server.

Is server-side tracking hard to set up?

It’s one request per crawler hit, sent from wherever your server or edge already sees traffic. With Measure, that’s POST /api/collect with site_id, path and the agent’s user agent or name.

Do AI agents count as visitors?

Not in Measure. AI agents and bots are counted separately from humans, so they never inflate your visitor numbers.

Does an AI agent visit mean I’ll be cited?

No. A fetch shows an agent read your page. Clarity makes the same point about its own data: a bot request doesn’t mean content was cited or surfaced in an answer.

See the agents your snippet misses

Measure counts your humans, AI agents and bots separately, with no cookies and no consent banner. It’s $29 a month for up to 40 sites, then $0.50 per site, with a 14-day trial. Start your 14-day trial or see pricing.

Let your agent read the numbers.

$29 a month covers 40 sites, then $0.50 a site. 14-day trial.