agent-tracking

Guides

How do I track the AI agents that visit my website?

An AI agent visits a website in one of three ways: it sends a person (a referral from ChatGPT or Perplexity), it fetches pages itself (a crawler or a live assistant), or it operates the site through MCP and WebMCP tools. Tracking agents means catching all three, each from its own source: the referrer, the user agent verified against vendor IP ranges, and the browser's tool API.

By · Updated 2026-09-08

Diesen Guide auf Deutsch lesen

The three ways an agent shows up

A referral looks like a normal visit with chatgpt.com or perplexity.ai as the referrer. A fetch is a request from GPTBot, ClaudeBot, PerplexityBot or a live assistant such as ChatGPT-User, most of which never run JavaScript. A tool call happens inside the visitor's browser when an assistant uses a WebMCP tool the page registered, and no server ever sees it.

Ordinary analytics catches part of the first, none of the second and none of the third. That is why an agent tracker is a separate thing rather than a report inside your existing analytics.

Ten minutes of setup

Sign in with an email address, add the domain, paste one script tag on every page, press verify. The snippet is 4.5 KB, sets no cookie and stores no address. From that moment referrals and tool calls are counted, attributed to the assistant or agent by a published list.

<script defer data-domain="example.com" src="https://agenttracking.co/agent.js"></script>

Add the server log for crawlers

Crawlers fetch HTML and leave. Upload your access log once on the settings page, or let a cron send it daily with the API token. Every line that claims a known crawler is checked against the address ranges the vendor publishes, so a fake GPTBot is shown as unverified rather than counted, and requests from one agent within seconds are grouped into a burst.

curl -sS -X POST https://agenttracking.co/api/logs/example.com \
  -H "Authorization: Bearer wmt_your_token" \
  -H "Content-Type: text/plain" --data-binary @/var/log/nginx/access.log

What you can see afterwards

Which assistants send visitors and where they land. Which crawlers read which pages, how often, verified or not. Which tools agents call, how long they take, whether they fail. Whether an agent reaches a goal you marked. All of it per day, with a trend against the previous period, and the same numbers as JSON and as an MCP tool for your own agents.

In short

Do I need to change my analytics setup?

No. Agent Tracking runs beside Google Analytics, Plausible or Matomo and counts a different thing. Nothing about your existing setup changes.

Will it slow the site or need a consent banner?

The snippet loads deferred and sends small batches with sendBeacon. It stores nothing on the device, so there is nothing to consent to.