AI crawler tracking: see which AI bots read your site

Updated

To see GPTBot, ClaudeBot, PerplexityBot and ChatGPT-User on your site, report them from your server: they fetch HTML without running JavaScript, so script-based analytics, Google Analytics 4 included, never sees them. Add one non-blocking call per bot request (snippets below), and DataPocket sorts each visit into AI answers, search indexing or model training, with the pages each bot read.

It recognizes 53 user-agent tokens from 34 providers. DataPocket stores only the bot's user agent, the path and the status code. No IP addresses, cookies or headers.

Sign in and the snippets fill in your site ID. Until then, replace YOUR_SITE_ID with the one from your Install page.

Next.js

  1. 1

    Add this to middleware.ts (next to app/ or pages/):

    ts
    import { NextResponse, type NextFetchEvent, type NextRequest } from "next/server";
    
    const BOTS = /bot|crawl|spider|-user|google-|facebookexternalhit|cohere|diffbot/i;
    
    export function middleware(req: NextRequest, ev: NextFetchEvent) {
      const ua = req.headers.get("user-agent") ?? "";
      if (BOTS.test(ua)) {
        ev.waitUntil(fetch("https://datapocket.vo1d.studio/api/crawl", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ site_id: "YOUR_SITE_ID", user_agent: ua, path: req.nextUrl.pathname }),
        }).catch(() => {}));
      }
      return NextResponse.next();
    }
    
    export const config = { matcher: ["/((?!_next/|api/|favicon.ico).*)"] };

Express

  1. 1

    Add this to before your routes:

    js
    const BOTS = /bot|crawl|spider|-user|google-|facebookexternalhit|cohere|diffbot/i;
    
    app.use((req, res, next) => {
      const ua = req.get("user-agent") || "";
      if (BOTS.test(ua)) {
        res.on("finish", () => {
          fetch("https://datapocket.vo1d.studio/api/crawl", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ site_id: "YOUR_SITE_ID", user_agent: ua, path: req.originalUrl, status: res.statusCode }),
          }).catch(() => {});
        });
      }
      next();
    });

Astro

  1. 1

    Add this to src/middleware.ts (pages rendered on demand):

    ts
    import { defineMiddleware } from "astro:middleware";
    
    const BOTS = /bot|crawl|spider|-user|google-|facebookexternalhit|cohere|diffbot/i;
    
    export const onRequest = defineMiddleware(async (ctx, next) => {
      const res = await next();
      const ua = ctx.request.headers.get("user-agent") ?? "";
      if (BOTS.test(ua)) {
        fetch("https://datapocket.vo1d.studio/api/crawl", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ site_id: "YOUR_SITE_ID", user_agent: ua, path: ctx.url.pathname, status: res.status }),
        }).catch(() => {});
      }
      return res;
    });

Cloudflare Worker

  1. 1

    Add this to a Worker on your site's route (works for static sites too):

    js
    const BOTS = /bot|crawl|spider|-user|google-|facebookexternalhit|cohere|diffbot/i;
    
    export default {
      async fetch(request, env, ctx) {
        const res = await fetch(request);
        const ua = request.headers.get("user-agent") || "";
        if (BOTS.test(ua)) {
          ctx.waitUntil(fetch("https://datapocket.vo1d.studio/api/crawl", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ site_id: "YOUR_SITE_ID", user_agent: ua, path: new URL(request.url).pathname, status: res.status }),
          }));
        }
        return res;
      },
    };

Any server

  1. 1

    Add this to one request per bot visit, or up to 100 in "hits":

    bash
    curl -X POST https://datapocket.vo1d.studio/api/crawl \
      -H "Content-Type: application/json" \
      -d '{"site_id": "YOUR_SITE_ID", "user_agent": "Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)", "path": "/pricing", "status": 200}'

What are the ways to track AI crawlers?

Every method reads the request on the server side, because crawlers never run the JavaScript that browser analytics depends on. They differ in where the data comes from, how long it's kept and what else you get with it (checked December 4, 2026):

  • Your server or CDN logs. Free and complete: every request is there with its user agent and IP. You need access to the logs and something to parse them, and managed hosts often keep them only briefly or send them out through a paid log drain.
  • Cloudflare AI Crawl Control, if your site runs behind Cloudflare (docs). It's on every plan including Free, needs no code, and can also block or allow each crawler. On the Free plan detection uses the user agent and the metrics cover the past 24 hours; longer windows come with Enterprise Bot Management.
  • AI search visibility platforms such as Profound's Agent Analytics. They import logs from your CDN or host (CloudFront, Cloudflare Logpush, Fastly, Netlify and others), check crawlers against the vendors' published IP ranges, and tie crawling to how often you appear in AI answers. They're commercial products built for that wider job.
  • DataPocket. One non-blocking call from your server per bot request, on any host or framework. It's free, keeps bot hits for 2 years, sorts them into AI answers, indexing and training, and shows them next to your visitors, AI referral traffic and revenue in one dashboard. It matches by user agent only and doesn't block anything.

How do you check that it works?

  1. Deploy, then request a page as a crawler: curl -A "GPTBot/1.2" https://yoursite.com/.
  2. Within a minute the bot traffic card on your dashboard shows the hit under Training. Until the first hit arrives it says "No bot traffic recorded yet".
  3. Nothing there? Check your server logs for the POST to /api/crawl. A recorded hit answers {"ok":true,"recorded":1}; a user agent that isn't a known crawler answers "recorded":0.

What does the dashboard show?

  • Hits per category: AI answers (fetched because someone asked an assistant just now), Indexing (search and answer engines refreshing their index), Training (pages collected for model training) and Other (link previews).
  • Within a category, the providers that visited most and the user agents they used, with a chart over time.
  • The pages each category read most, with the top providers per page. Pages that AI answers fetch are the ones assistants use to talk about you.
  • With the SEO audit, which pages Googlebot and AI crawlers fetched in the last 30 days and which missing pages crawlers keep asking for (send the status code to get these).

Can a bot fake its user agent?

Yes. Any client can send GPTBot as its user agent, and DataPocket matches by user agent only, so the counts are what bots reported, not verified. Some vendors publish the IP ranges their crawlers use: OpenAI lists them for GPTBot, OAI-SearchBot and ChatGPT-User (checked November 23, 2026). If you need certainty for one bot, check the request IP against its list in your server before reporting the hit.

To keep forged reports from filling a dashboard, each site records at most 1,000,000 bot hits a month, and one sender can use at most 100,000 of them.

How is this different from visitors sent by ChatGPT?

Crawler hits are the assistant's own servers reading your pages. Visitors who click a link in an AI answer are people, and the normal tracking script already counts them in the AI channel with their revenue. How to see traffic from ChatGPT and other AI assistants covers that side.

Which crawlers are recognized

Matched by user-agent token. A bot can claim any user agent, so treat counts as reported, not verified.

AI answers
Meta AI (meta-externalfetcher) · Gemini (Google-NotebookLM, Google-Read-Aloud, Google-Agent) · Perplexity (Perplexity-User) · Grok (Grok-DeepSearch) · Mistral (MistralAI-User) · DuckDuckGo (DuckAssistBot) · ChatGPT (ChatGPT-User) · Claude (Claude-User) · Amazon (Amzn-User) · Kimi (Kimi-User) · Qwen (Qwen-User)
Indexing
Google (Google-InspectionTool, Googlebot) · Anthropic (Claude-SearchBot) · Meta (meta-webindexer) · Amazon (Amzn-SearchBot) · OpenAI (OAI-SearchBot) · Perplexity (PerplexityBot) · TikTok (TikTokSpider) · DuckDuckGo (DuckDuckBot) · Baidu (Baiduspider) · Yandex (YandexBot) · Apple (Applebot) · Petal (PetalBot) · Bing (bingbot, msnbot) · You.com (YouBot)
Training
Cohere (cohere-training-data-crawler, cohere-ai) · Google (Google-CloudVertexBot, GoogleOther) · Meta (meta-externalagent) · Anthropic (anthropic-ai, ClaudeBot) · DeepSeek (DeepSeekBot) · ByteDance (Bytespider) · Amazon (Amazonbot) · OpenAI (GPTBot) · Allen AI (AI2Bot) · Common Crawl (CCBot)
Other
Facebook (facebookexternalhit, FacebookBot) · LinkedIn (LinkedInBot) · Telegram (TelegramBot) · X (Twitterbot) · Discord (Discordbot) · OpenAI (OAI-AdsBot) · Slack (Slackbot) · Grok (GrokBot, xAI-Bot) · Diffbot (Diffbot)

Questions

Does Google Analytics show GPTBot or ClaudeBot?
No. GA4 is a JavaScript tag, and crawlers fetch HTML without running scripts, so their visits never reach it. Server logs or a server-side report like this one are the only places they show up.
Will reporting bots slow my site down?
No. The snippets send the report in the background (waitUntil, or a request that isn't awaited) so the page is never delayed. Ordinary browser requests don't match the snippets' pre-filter, so they never trigger a call.
Does this block or allow AI crawlers?
Neither. It only counts them. Whether a crawler may fetch a page is still set in your robots.txt.
Which bots are tracked?
53 user-agent tokens from 34 providers, including GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-User, PerplexityBot, Perplexity-User, Googlebot, bingbot and Applebot. The full list is below.
Does it cost anything?
No. Bot reporting is part of DataPocket's free plan, like every other feature.

Related

AI crawler tracking: GPTBot, ClaudeBot, PerplexityBot visits