Back to browse
GitHub Repository

A lightweight script to detect AI traffic

2 starsJavaScript

AI Referral Detector – See which AI sent traffic to your site

by grandlaps·Mar 3, 2026·2 points·1 comment

AI Analysis

MidSolve My ProblemDark Horse

Spots AI referrals when Google Analytics shows 'Direct'—but referrer-based detection is trivial to spoof.

Strengths
  • Addresses a real gap: no existing analytics tool isolates AI traffic from mislabeled 'Direct' visits
  • Covers 8+ AI sources (ChatGPT, Perplexity, Claude, DeepSeek, Grok) with structured event payloads
  • Zero dependencies, no cookies—low-friction drop-in script with optional self-hosted backend
Weaknesses
  • Purely referrer-based: easily spoofed by redirects, proxy chains, or copy-paste URLs from AI sessions
  • No IP-based validation or behavioral clustering—high false-positives if someone bookmarks an AI link
  • Google Analytics 4 already has custom event tracking; this solves a 2–3 line implementation problem
Category
Target Audience

E-commerce and SaaS founders who want to measure and optimize for AI-driven traffic

Similar To

Google Analytics 4 · Amplitude · Mixpanel

Similar Projects

Infrastructure●●Solid

See when ChatGPT or Perplexity sends a visitor to your site

Real-time AI referral alerts at the edge, unlike Cloudflare Bot Fight Mode.

Solve My ProblemShip It
startages
1320d ago
Security●●Solid

An open source benchmark for prompt-injection detectors

Dual-axis measurement comparing detectors at same catch rate, not arbitrary thresholds.

Big Brain
gugit
201mo ago
SaaS●●Solid

Digital identity pages with traffic quality

This is a link-in-bio take with a useful twist: per-page 'human score' from request fingerprinting, first-click tracking and referrer breakdowns give you more actionable signal than raw view counts. The UI and a Figma-style canvas feel well thought-out, but the idea lives in a crowded market and the fingerprinting/heuristic rules need clearer documentation and opt-out/privacy options before the analytics can be trusted widely.

Niche GemSlickShip It
m6jo9
215mo ago