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:

3. GA4 Configuration Strategies (Two Options)

Option A: Direct GA4 Configuration (Simple & Fast)

Step 1: Create a Custom Channel Group


- Go to: Admin → Data display → Channel groups.
- Duplicate the Default Channel Group.
- Rename it to "AI Traffic Enhanced".
- Add a new channel named "AI Traffic",Set the condition: Source matches regex:
- Important: Drag "AI Traffic" to position it above "Referral" so it matches first.
Step 2: Create a Segment
Create an event segment in Explorations:
^.*\.ai/.*|.*\.openai.*|.*copilot.*|.*chatgpt.*|.*gemini.*$
This allows you to apply this segment to any report to view AI traffic in isolation.
Option B: GTM Advanced Configuration (Precise Tracking)
For more granular control, use Google Tag Manager (GTM).
Step 1: Create a Detection Variable
- Path: GTM → Variables → Custom JavaScript
- Variable Name:
AI Platform Detector

Step 2: Push to dataLayer
- Path: GTM → Tags → Custom HTML
- Trigger: DOM Ready

Step 3: Create Data Layer Variables
Create the following three variables:
ai_platformai_categoryai_method
Step 4: Send GA4 Event
- Path: GTM → Tags → Google Analytics: GA4 Event
- Event Name:
ai_referral - Event Parameters:
platform:{{ai_platform}}category:{{ai_category}}method:{{ai_method}}
- Trigger: Custom Event =
ai_referral
Step 5: Register Custom Dimensions in GA4
- Path: Admin → Data display → Custom definitions
- AI Platform (Event-scoped) →
platform - AI Category (Event-scoped) →
category
- AI Platform (Event-scoped) →
4. Looker Studio Dashboard Structure

Once configured, you can build a dedicated AI Traffic Dashboard in Looker Studio:
- Tab 1 - Overview

- Time Series: AI Traffic Trend
- Pie Chart: Share by AI Platform
- Table: Platform, Sessions, Engagement Rate, Conversion Rate

- Tab 2 - Platform Comparison

- Bar Chart: Sessions by Platform
- Line Chart: Engagement Time Comparison
- Table: Detailed Metrics (Bounce Rate, Pages/Session, Conversions)
- Tab 3 - Landing Page Analysis
- Table: Top Pages visited by AI Traffic
- Heatmap: Page Interaction Distribution
- Tab 4 - Conversion Funnel
- Funnel Chart: AI Traffic Conversion Path
- Comparison: AI vs. Organic vs. Direct
- Tab 5 - Device & Geography
- Device Category Distribution
- Country/City Distribution
- Browser Analysis
5. UTM Parameter Naming Recommendations
If you are manually tagging links shared on AI platforms, use this standard UTM naming convention:
[https://yoursite.com/?utm_source=chatgpt&utm_medium=ai_chat&utm_campaign=blog_promo](https://yoursite.com/?utm_source=chatgpt&utm_medium=ai_chat&utm_campaign=blog_promo)
6. Important Notes
- Session-Level Analysis: It is recommended to analyze AI traffic by Session rather than User, as AI interactions are often stateless and anonymous.
- Bot Filtering: Distinguish between real users and bot crawlers. Bots often show:
- Engagement Time = 0 seconds
- Engagement Rate = 0%
- medium = (not set)
- Regular Updates: AI platforms change rapidly. Check and update your Regex list quarterly.
- Channel Order: Ensure the "AI Traffic" channel is ranked higher than "Referral" in your Channel Group settings to prevent misclassification.
7. Quick Checklist
Verify your setup with this list:
- [ ] "AI Traffic" channel appears in the Traffic acquisition report.
- [ ] Switching to the Custom Channel Group displays data correctly.
- [ ] The "AI Traffic" segment works in Explorations.
- [ ] The
ai_referralevent fires in GTM Preview mode. - [ ] Events are visible in GA4 DebugView.
- [ ] Looker Studio correctly pulls the new Custom Dimensions.
8. Future Optimization Directions
Once the basics are set, consider:
- Setting specific conversion goals for different AI platforms.
- Creating Audiences from AI traffic for retargeting.
- Analyzing which content is most frequently cited by AI platforms (Content Gap Analysis).
- Comparing the Lifetime Value (LTV) of AI traffic vs. Traditional Search traffic.
This is the complete AI traffic tracking configuration guide. Option A is great for getting started quickly, while Option B is ideal for scenarios requiring granular tracking.