While configuring GA4 recently, I noticed an interesting trend: an increasing amount of traffic is coming from AI platforms like ChatGPT, Perplexity, and Claude. However, GA4 lumps all of this into the generic 'referral' bucket, making it impossible to analyze separately.
To fix this, I spent some time putting together a complete AI traffic tracking solution (the foundation for tracking GEO - Generative Engine Optimization - performance today), and I'm sharing it with you.
1. Why Track AI Traffic Separately?
Let's look at the context. By 2026, there are already over 50 mainstream AI platforms influencing user behavior:
- Conversational AI: ChatGPT, Claude, Gemini, DeepSeek, Grok, Meta AI…

- AI Search Engines: Perplexity, You.com, Phind, Andi Search…

- Other Tools: Poe, Character.AI, BlackBox, Pi…

User behavior on these platforms is very different from traditional search engines. Mixing them together skews your data. Additionally, there are over 30 types of AI bots visiting websites (GPTBot, ClaudeBot, PerplexityBot, etc.), so you need to distinguish between real users and bot traffic.

2. Core Regex for Identification
Here is the master Regular Expression (Regex) I compiled to match referrers from 50+ mainstream AI platforms:













