An open-source library to track AI coding agents on your site.
npm install 2027-track
// middleware.ts
import { withAIAnalytics } from "2027-track/next";
export default withAIAnalytics();
export const config = {
matcher: ["/((?!api|_next|admin).*)"],
};
Enter your email and we'll send you a magic link to view your analytics.
Open DashboardWe identify agents by their unique request signatures. Bots and crawlers (Googlebot, GPTBot, etc.) are automatically filtered.
| Agent | Signal |
|---|---|
| Claude Code | axios user-agent + text/markdown accept |
| OpenCode | text/markdown with q= quality weights |
| Codex | ChatGPT-User user-agent |
| Unknown AI | text/markdown in accept (fallback) |
Events sent from your edge/server — visitor IPs never reach us.
No cookies, no fingerprinting, no PII collected.
Only: host, path, user-agent, accept header, country.
Audit the code yourself. Self-host if you prefer.