Skip to main content
Technology

WebMCP Analytics: How to Track AI Agent Visits to Your Site

SC
Sarah Chen8 min readMar 11, 2026

AI agents are visiting your website right now. And your analytics have no idea.

Open your Google Analytics dashboard. You'll see sessions and page views. What you won't see is the Claude agent that crawled your pricing page at 2 a.m., or the ChatGPT retrieval bot that pulled three paragraphs from your blog post to answer someone's question. That traffic is invisible in standard analytics setups.

Here's why that matters. AI agent traffic is growing fast, driven by protocols like WebMCP (defined in the W3C specification) that make websites machine-readable. If you can't see it, you can't optimize for it. You're flying blind on a channel that's sending real visitors โ€” just not human ones โ€” to your site every single day.

This guide walks you through how to identify and track AI agent visits. You'll learn which agents are hitting your site, how to spot them in your logs, how to set up GA4 for them, and what to actually do with that data once you have it.

Key takeaway: AI agents visit your site using identifiable user agent strings. With server log analysis and GA4 configuration, you can track every agent visit and see exactly which pages they access most.

Types of AI agents visiting your site

Before you can track them, you need to know what you're looking for. Not all AI agents are the same, and they show up in your logs with different signatures.

Search engine AI crawlers

These are the ones most similar to traditional search crawlers. Google, Bing, and others have deployed AI-specific bots alongside their existing crawlers.

Googlebot still does its usual crawling. But Google also runs Google-Extended, which specifically gathers content for AI training and Gemini features. Microsoft has similar agents feeding into Bing Chat and Copilot.

These crawlers behave a lot like the ones you already know. They respect robots.txt and follow links just like Googlebot always has. The difference is what happens with the data. Instead of just ranking your page, it feeds into AI model training and AI-generated answers.

LLM retrieval agents

This is the category most marketers haven't encountered yet. And it's the one growing fastest.

When someone asks ChatGPT a question and it browses the web to answer, that's ChatGPT-User visiting your site. When Perplexity generates a response with citations, PerplexityBot just crawled your page. ClaudeBot does the same thing for Anthropic's Claude.

Here are the user agent strings you need to watch for:

User AgentCompanyPurposeTrackable
ChatGPT-UserOpenAIReal-time browsing for ChatGPT answersYes
GPTBotOpenAIBroader crawling for model trainingYes
PerplexityBotPerplexity AIWeb crawling for AI search citationsYes
ClaudeBotAnthropicWeb crawling for Claude responsesYes
Applebot-ExtendedAppleAI feature content gatheringYes
Google-ExtendedGoogleAI/Gemini training and featuresYes
BytespiderByteDanceAI training data collectionYes

These agents visit more frequently than you'd expect. I started tracking them on a mid-size content site last year. Within a month, AI agent requests accounted for about 8% of all server-side traffic. Not huge, but definitely not negligible.

Browser-based AI agents

This third category is newer and harder to track. These are AI features built directly into browsers or browser extensions.

Chrome's built-in AI features and third-party agent tools both fall here. They often use standard browser user agent strings, which makes them tricky to distinguish from regular human traffic.

You won't catch all of these in your logs. But the first two categories โ€” search AI crawlers and LLM retrieval agents โ€” are identifiable and trackable starting today.

Identifying AI agent traffic in your analytics

Now let's get practical. Here's how to actually spot these agents in your data.

User agent string detection

Every HTTP request includes a user agent string. That's your primary identification tool.

The simplest approach is pattern matching. AI agents typically include identifiable strings in their user agent headers. Here's a regex pattern that catches the major ones:

(ChatGPT-User|GPTBot|PerplexityBot|ClaudeBot|Applebot-Extended|Google-Extended|Bytespider|anthropic-ai|CCBot)

Save that pattern. You'll use it for server log analysis and GA4 configuration alike.

One thing to watch out for: some AI agents rotate or modify their user agent strings. The ones I listed above are the well-behaved, identifiable agents. There are others that use generic browser strings and are essentially undetectable. Focus on what you can track โ€” it's still a meaningful data set.

Server log analysis

Your server access logs are the most reliable source of AI agent data. Every single request hits your server logs, regardless of whether JavaScript loads or analytics scripts fire.

If you're on Apache, check your access.log file. On Nginx, it's typically in /var/log/nginx/access.log. Cloud hosting platforms like Vercel, Netlify, and AWS usually provide log access through their dashboards.

Here's a basic command to extract AI agent visits from an Apache access log:

grep -E "(ChatGPT-User|GPTBot|PerplexityBot|ClaudeBot|Google-Extended)" access.log | awk '{print $1, $4, $7, $9}'

That gives you the IP address, timestamp, requested URL, and HTTP status code for every AI agent visit. Simple, but powerful.

For ongoing monitoring, I'd recommend setting up a daily cron job that summarizes AI agent activity. Track total requests per agent and most-visited pages. Also flag any error responses โ€” 404s or 5xxs that indicate broken paths or server issues.

If manual log parsing sounds tedious, tools like GoAccess or ELK Stack can automate this. Filter by the AI user agent strings and you'll have a dedicated dashboard within an hour.

GA4 configuration for agent tracking

Google Analytics 4 doesn't track bot traffic by default. In fact, it actively filters it out. That's a problem if you want to see AI agent visits.

Here's the workaround. You can create a server-side tagging setup that fires GA4 events when AI agents are detected. This bypasses GA4's bot filtering because you're sending events from your server, not relying on the agent to execute JavaScript.

The approach works like this:

  1. Set up a middleware layer on your server that inspects incoming user agent strings
  2. When an AI agent is detected, fire a server-side GA4 Measurement Protocol hit
  3. Tag these events with custom parameters: agent_name, page_path, and response_code
  4. In GA4, create a custom report filtered to these server-side events

If server-side tagging feels like overkill, there's a simpler option. Create a lightweight endpoint on your server (something like /api/agent-log) that logs AI agent visits to a database or spreadsheet. Then build a simple dashboard to visualize the data.

The point isn't which tool you use. The point is capturing the data somewhere you can analyze it.

What to do with AI agent data

Tracking is only useful if you act on what you find. Here's how to turn raw AI agent data into optimization decisions.

Find your most-visited pages

Sort your AI agent traffic by page URL. You'll probably see patterns immediately.

In my experience, AI agents cluster on a few page types. Documentation and how-to content gets hit heavily because agents are looking for information to cite. FAQ pages are close behind, since the Q&A format is easy for agents to extract from.

Look at what's getting visited and ask yourself: are these the pages I want agents to see? If your best content is getting agent traffic, great. If agents are spending time on outdated landing pages or thin content, that's a signal to either improve those pages or redirect agent attention to better ones.

Your llms.txt file is one lever here. By explicitly listing your best pages in your llms.txt, you guide agents toward the content you actually want them to read and cite.

Spot where agents fail

This is where tracking pays for itself.

Filter your logs for AI agent requests that returned 404s or 500s. Every failed request is a missed opportunity for citation or recommendation.

Common failure points I've seen:

  • Pages that rely entirely on JavaScript rendering (agents often can't execute JS)
  • Dynamically generated content behind authentication walls
  • Broken internal links that humans rarely notice but agents follow
  • Rate limiting that blocks agents before they finish crawling (see our WebMCP security best practices for balanced access controls)

Fix these and you immediately improve your AI visibility. An agent that hits a 404 on your pricing page won't recommend your product. An agent that gets a clean, fast response will.

Manage crawl budget for AI agents

Just like Google's crawl budget, AI agents allocate limited resources to each site they visit. If they waste time on low-value pages, they may never reach your best content.

Use your robots.txt to shape AI agent behavior. Allow access to your high-value pages and block sections that don't contribute to your AI visibility, like admin paths and parameter-heavy URLs.

Here's an example robots.txt configuration that welcomes AI agents while keeping them focused:

User-agent: GPTBot
Allow: /blog/
Allow: /docs/
Allow: /pricing/
Allow: /llms.txt
Disallow: /admin/
Disallow: /api/internal/
Disallow: /*?sort=
Disallow: /*?filter=

User-agent: ClaudeBot
Allow: /
Disallow: /admin/
Disallow: /api/internal/

User-agent: PerplexityBot
Allow: /
Disallow: /admin/

Monitor your server logs after making these changes. You should see agents spending more of their crawl budget on the pages that actually matter.

Track trends over time

Don't just look at snapshots. Track AI agent traffic weekly or monthly to spot trends.

Questions worth answering: Is agent traffic growing or flat? Are new agents appearing that you haven't seen before? Did a content update change which pages agents visit? Is there a correlation between agent visits and referral traffic from AI search engines?

That last question is the big one. If you see PerplexityBot visiting a page and then notice referral traffic from Perplexity increasing for that topic, you've found a direct link between agent crawling and business results.

Setting up your first tracking dashboard

You don't need fancy tools to get started. Here's a minimal setup that works.

Option 1: spreadsheet-based tracking

Create a simple script that runs daily, parses your server logs for AI agent user strings, and appends the results to a CSV or Google Sheet. Track date, agent name, pages visited, total requests, and error count.

After two weeks, you'll have enough data to spot patterns. Which agents visit most frequently? Which pages do they prefer? Are there pages getting zero agent traffic that should be getting more?

Option 2: dedicated log analysis tool

If your site gets significant traffic, a spreadsheet won't scale. Set up GoAccess or a similar tool with a filter for AI agent user strings. You'll get real-time dashboards showing agent activity alongside error rates.

Option 3: custom analytics endpoint

For the technically inclined, build a lightweight analytics endpoint that specifically tracks AI agent behavior. Our MCP server setup guide covers the infrastructure side of this. Log every request with the user agent, path, response time, and response code. Add a simple dashboard on top.

The advantage of a custom solution is flexibility. You can track metrics that generic tools miss โ€” like which specific content sections agents request most, or whether agents complete full page loads or bail after partial content.

Whichever option you pick, start this week. The data compounds in value over time. Two months of tracking reveals patterns you'll never spot in a single day's logs.

Frequently asked questions

Should I block AI agents from my website?

Generally, no. AI agents represent a growing distribution channel for your content. When an agent crawls your page and cites it in an AI-generated answer, that's free visibility to a user who might never have found you through traditional search. Block agents only for specific sections with sensitive data or content you explicitly don't want cited. Use robots.txt to allow access to public content while restricting private areas.

How much of my website traffic comes from AI agents?

It varies widely by site type and industry. Content-heavy sites like blogs and documentation portals typically see 5-15% of their server-side requests from AI agents as of early 2026. E-commerce sites tend to be lower at 2-5%. These numbers are growing steadily. Note that standard analytics tools undercount AI traffic because many agents don't execute JavaScript, meaning they never trigger your analytics snippet.

Can AI agent crawling increase my hosting costs?

Yes, in extreme cases. If AI agents are aggressively crawling large sections of your site, the additional server load can show up on your hosting bill. This is more common for sites with dynamic content that requires server-side processing for each request. Use crawl rate controls in your robots.txt (the Crawl-delay directive) and monitor your server resource usage. For most sites under a million pages, AI agent crawling costs are negligible.

What's the difference between GPTBot and ChatGPT-User?

GPTBot is OpenAI's general crawler that collects data for model training and improvement. ChatGPT-User is the agent that browses the web in real-time when a ChatGPT user asks a question requiring current information. GPTBot visits are about training data collection. ChatGPT-User visits are about answering a specific user query right now. Both are worth tracking, but ChatGPT-User visits more directly correlate with potential citations and referral traffic.

How do I tell if an AI agent is citing my content?

Check your referral traffic in GA4 for sources like chat.openai.com, perplexity.ai, and similar AI platforms. Also search for your brand or key content phrases directly in ChatGPT, Perplexity, and Google's AI Overviews. If your content appears as a cited source, it's being referenced. Cross-reference those citations with your server logs to see which pages the AI agents crawled before generating those citations.

AI AnalyticsAI AgentsServer LogsWeb Analytics
Nikhil Kumar - Growth Engineer and Full-stack Creator
Nikhil Kumar(@nikhonit)

Growth Engineer & Full-stack Creator

I bridge the gap between engineering logic and marketing psychology. Currently leading Product Growth at Operabase. Builder of LandKit (AI Co-founder). Previously at Seedstars & GrowthSchool.