Skip to content

feat: AI crawler detection middleware - #266

Open
jaylong255 wants to merge 1 commit into
mainfrom
feat/ai-crawler-logging
Open

feat: AI crawler detection middleware#266
jaylong255 wants to merge 1 commit into
mainfrom
feat/ai-crawler-logging

Conversation

@jaylong255

Copy link
Copy Markdown
Member

Summary

  • Detects 12 AI crawler user agents (GPTBot, PerplexityBot, ClaudeBot, etc.) in middleware
  • Logs visits to page_events table as ai_crawler_visit events via /api/track
  • Fire-and-forget — no blocking, no performance impact on regular visitors
  • Middleware matcher expanded to all content paths (excludes _next/static, images, favicon)
  • GusClaw reads this data via seo/ai_crawler_tracker.py for daily standup reports

Test plan

  • Vercel preview builds and deploys
  • Normal page loads are unaffected (no latency)
  • Check Supabase page_events for ai_crawler_visit entries after deploy
  • Verify admin auth still works (middleware matcher change)

🤖 Generated with Claude Code

Log visits from GPTBot, PerplexityBot, ClaudeBot, and 9 other AI crawlers
to page_events table as 'ai_crawler_visit' events. Fire-and-forget POST
to /api/track — no blocking, no performance impact on regular visitors.

Middleware matcher expanded from admin+tag paths to all content paths
(excludes static assets). Crawler detection runs before admin auth check.

GusClaw reads this data via seo/ai_crawler_tracker.py for daily standup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
legend Ready Ready Preview, Comment Apr 7, 2026 1:42am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant