From 3d45d2da6394a86946f3ec3fe3db7ef5b3f67f56 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 21 Apr 2026 03:00:29 +0200 Subject: [PATCH 1/3] feat: add SEO, monitoring, social, and scraper bot patterns Reduces 'Other' bucket by recognizing: - SEO: Ahrefs, Semrush, Majestic, Moz, Screaming Frog, Sitebulb, DataForSEO, Serpstat - Monitoring: UptimeRobot, Pingdom, StatusCake, New Relic, Datadog - Social: Slack, Twitter, LinkedIn, Discord, Telegram, WhatsApp - Scrapers: Scrapy, Headless Chrome, PhantomJS, wget, HTTPie Note: Playwright-based agents (Aider, OpenCode) spoof full browser UAs and remain indistinguishable at the UA layer (bot_name: Browser). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/bots.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/bots.ts b/src/bots.ts index 1ff14d7..c629315 100644 --- a/src/bots.ts +++ b/src/bots.ts @@ -86,6 +86,38 @@ export function parseBotName(userAgent: string | null | undefined): string { if (s.includes('windsurf')) return 'Windsurf' if (s.includes('petalbot')) return 'PetalBot' + // SEO crawlers and monitoring bots. + if (s.includes('ahrefsbot')) return 'Ahrefs' + if (s.includes('semrushbot')) return 'Semrush' + if (s.includes('mj12bot')) return 'Majestic' + if (s.includes('dotbot')) return 'Moz' + if (s.includes('rogerbot')) return 'Moz' + if (s.includes('screaming frog')) return 'Screaming Frog' + if (s.includes('sitebulb')) return 'Sitebulb' + if (s.includes('linkfluence')) return 'Linkfluence' + if (s.includes('dataforseo')) return 'DataForSEO' + if (s.includes('serpstatbot')) return 'Serpstat' + + // Monitoring and feed bots. + if (s.includes('uptimerobot')) return 'UptimeRobot' + if (s.includes('pingdom')) return 'Pingdom' + if (s.includes('statuscake')) return 'StatusCake' + if (s.includes('newrelicpinger')) return 'New Relic' + if (s.includes('datadogagent') || s.includes('datadog')) return 'Datadog' + if (s.includes('slackbot')) return 'Slack' + if (s.includes('twitterbot')) return 'Twitter' + if (s.includes('linkedinbot')) return 'LinkedIn' + if (s.includes('discordbot')) return 'Discord' + if (s.includes('telegrambot')) return 'Telegram' + if (s.includes('whatsapp')) return 'WhatsApp' + + // Generic scrapers. + if (s.includes('scrapy')) return 'Scrapy' + if (s.includes('headlesschrome')) return 'Headless Chrome' + if (s.includes('phantomjs')) return 'PhantomJS' + if (s.includes('wget')) return 'wget' + if (s.includes('httpie')) return 'HTTPie' + // HTTP library / runtime signatures (loose — coding agent or automation). // Check Electron before Browser since Electron UAs contain Chrome/Safari. if (s.includes('electron/')) return 'Electron' From 14b755838fa8dab36e25f8bb2b6fa6eb1b4ff7f8 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 21 Apr 2026 03:03:28 +0200 Subject: [PATCH 2/3] Add bots from actual PostHog data: Linkup, OhDear, Sogou, Apple URL Preview, Guzzle, Yandex, Baidu, facebookexternalhit Co-Authored-By: Claude Opus 4.6 (1M context) --- src/bots.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bots.ts b/src/bots.ts index c629315..f343102 100644 --- a/src/bots.ts +++ b/src/bots.ts @@ -111,12 +111,26 @@ export function parseBotName(userAgent: string | null | undefined): string { if (s.includes('telegrambot')) return 'Telegram' if (s.includes('whatsapp')) return 'WhatsApp' + // AI search and indexing bots. + if (s.includes('linkupbot')) return 'Linkup' + if (s.includes('sogou')) return 'Sogou' + if (s.includes('yandexbot')) return 'Yandex' + if (s.includes('baiduspider')) return 'Baidu' + + // Link preview fetchers. + if (s.includes('facebookexternalhit')) return 'Facebook' + if (s.includes('com.apple.webkit')) return 'Apple URL Preview' + + // Uptime and monitoring. + if (s.includes('ohdear')) return 'Oh Dear' + // Generic scrapers. if (s.includes('scrapy')) return 'Scrapy' if (s.includes('headlesschrome')) return 'Headless Chrome' if (s.includes('phantomjs')) return 'PhantomJS' if (s.includes('wget')) return 'wget' if (s.includes('httpie')) return 'HTTPie' + if (s.includes('guzzlehttp')) return 'Guzzle' // HTTP library / runtime signatures (loose — coding agent or automation). // Check Electron before Browser since Electron UAs contain Chrome/Safari. From 54fb5a9e314f9954baa85b908e1e502e3bbb3337 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 21 Apr 2026 06:26:44 +0200 Subject: [PATCH 3/3] chore: bump to 0.6.0 Co-Authored-By: Claude Opus 4.6 (1M context) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5e1b9a..e9611f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apideck/agent-analytics", - "version": "0.5.0", + "version": "0.6.0", "description": "Track AI agent and bot traffic to your Next.js / Vercel app — PostHog, webhooks, or any custom analytics backend. Detects Claude, ChatGPT, Perplexity, Google-Extended, and more.", "keywords": [ "ai",