You’re optimizing for AI search. You’ve deployed your llms.txt, implemented schema markup, and created citation-worthy content. But how do you know if it’s working? If you can’t measure AI search traffic separately from your other channels, you’re flying blind.
In this tutorial, we’ll walk through the complete GA4 setup for tracking AI search traffic. You’ll learn how to create custom dimensions, build dedicated reports, configure UTM parameters, and set up 5 pre-built dashboards for monitoring AI referral performance. This is a live walkthrough — follow along in your GA4 account as you read.
Why Standard GA4 Tracking Misses AI Traffic
Out of the box, GA4 categorizes most AI search traffic as either “Direct” or “Referral” — lumped together with everything else. This means:
- ChatGPT traffic might show up as
referralfromchatgpt.com— or asdirectif the user copied a URL from the response - Perplexity traffic appears as
referralfromperplexity.aibut gets mixed with other referral sources - Claude traffic may show as
referralfromclaude.aior not be attributed at all - AI-influenced organic traffic (where the user saw your brand in an AI response and then Googled you) shows up as regular organic traffic
Without dedicated tracking, you can’t answer basic questions like:
- How much traffic comes from AI search agents?
- Which AI platforms send the most valuable traffic?
- What’s the conversion rate of AI-referred visitors versus other channels?
- Which pages are AI agents driving traffic to?
Let’s fix that.
Step 1: Identify AI Traffic Sources
First, you need to know exactly which referral domains and user agents to track. Here’s a comprehensive list of AI traffic sources as of 2026:
AI Search Platforms (Referral Traffic)
| Platform | Referral Domain(s) | Traffic Type |
|---|---|---|
| ChatGPT | chatgpt.com, chat.openai.com | Referral |
| Perplexity | perplexity.ai | Referral |
| Google Gemini | gemini.google.com | Referral |
| Claude | claude.ai | Referral |
| Microsoft Copilot | copilot.microsoft.com, bing.com/chat | Referral |
| You.com | you.com | Referral |
| Phind | phind.com | Referral |
| Meta AI | meta.ai | Referral |
AI User Agents (Crawler Traffic)
These crawlers visit your site on behalf of AI platforms. Track their access in your server logs:
| User Agent | Platform |
|---|---|
| GPTBot | OpenAI/ChatGPT |
| Claude-Web | Anthropic/Claude |
| PerplexityBot | Perplexity |
| Google-Extended | Google AI/Gemini |
| Bytespider | ByteDance AI |
| CCBot | Common Crawl (used by many AI systems) |
| Amazonbot | Amazon AI |
Step 2: Create Custom Channel Groups
GA4’s default channel grouping doesn’t have an “AI Search” category. You need to create one.
In GA4 Admin:
- Navigate to Admin > Data display > Channel groups
- Click Create new channel group
- Name it: “Custom Channels with AI Search”
- Click Add new channel
Channel Configuration:
Channel Name: AI Search
Conditions (use OR logic between conditions):
Source matches regex: chatgpt\.com|chat\.openai\.com
OR
Source matches regex: perplexity\.ai
OR
Source matches regex: claude\.ai
OR
Source matches regex: gemini\.google\.com
OR
Source matches regex: copilot\.microsoft\.com
OR
Source matches regex: you\.com
OR
Source matches regex: phind\.com
OR
Source matches regex: meta\.ai
OR
Medium exactly matches: ai
OR
Campaign contains: ai-search
- Save the channel group
- Set this as your default channel group for reporting
Now all traffic from AI platforms will be grouped into a single “AI Search” channel, making it easy to analyze.
Step 3: Set Up Custom Dimensions
Custom dimensions give you deeper segmentation of AI traffic.
Create These Custom Dimensions:
Navigate to Admin > Data display > Custom definitions > Create custom dimension
Dimension 1: AI Platform
- Dimension name:
ai_platform - Scope: Event
- Description: “Identifies which AI platform referred the traffic”
- Event parameter:
ai_platform
Dimension 2: AI Content Type
- Dimension name:
ai_content_type - Scope: Event
- Description: “Type of content the AI referenced”
- Event parameter:
ai_content_type
Dimension 3: AI Query Category
- Dimension name:
ai_query_category - Scope: Event
- Description: “Category of AI query that drove the visit”
- Event parameter:
ai_query_category
Populate Dimensions with GTM
In Google Tag Manager, create a custom JavaScript variable to detect AI traffic and populate these dimensions:
// GTM Custom JavaScript Variable: Detect AI Platform
function() {
var referrer = document.referrer.toLowerCase();
if (referrer.indexOf('chatgpt.com') > -1 || referrer.indexOf('chat.openai.com') > -1) {
return 'ChatGPT';
} else if (referrer.indexOf('perplexity.ai') > -1) {
return 'Perplexity';
} else if (referrer.indexOf('claude.ai') > -1) {
return 'Claude';
} else if (referrer.indexOf('gemini.google.com') > -1) {
return 'Gemini';
} else if (referrer.indexOf('copilot.microsoft.com') > -1) {
return 'Copilot';
} else if (referrer.indexOf('you.com') > -1) {
return 'You.com';
} else if (referrer.indexOf('phind.com') > -1) {
return 'Phind';
} else if (referrer.indexOf('meta.ai') > -1) {
return 'Meta AI';
}
// Check URL parameters for AI attribution
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('utm_source') && urlParams.get('utm_medium') === 'ai') {
return urlParams.get('utm_source');
}
return 'Not AI';
}
Then add this variable as an event parameter in your GA4 Configuration tag:
- Parameter name:
ai_platform - Value:
{{AI Platform Detection}}
Step 4: Configure UTM Parameters for AI Sources
Some AI traffic won’t carry a clear referrer. When you share links that you know will be picked up by AI agents, use UTM parameters for better attribution.
UTM Naming Convention for AI Traffic
Use this consistent naming convention:
?utm_source=[ai_platform]&utm_medium=ai&utm_campaign=[content_type]&utm_content=[specific_piece]
Examples:
# For links in your llms.txt file
https://yoursite.com/docs?utm_source=llms-txt&utm_medium=ai&utm_campaign=documentation
# For links you expect AI agents to cite
https://yoursite.com/pricing?utm_source=ai-citation&utm_medium=ai&utm_campaign=pricing-page
# For specific content you've optimized for AI
https://yoursite.com/blog/guide?utm_source=ai-organic&utm_medium=ai&utm_campaign=blog&utm_content=complete-guide
Important Caveat About UTM and AI
AI agents may or may not preserve UTM parameters when they cite your URLs. Many strip parameters. This means UTM tracking captures only a fraction of AI traffic. That’s why the referrer-based detection in Step 3 is essential as your primary tracking method, with UTM as supplementary data.
Step 5: Build Your AI Traffic Dashboard
Create a dedicated Looker Studio dashboard (or GA4 Explore report) for monitoring AI search performance.
Dashboard Layout
Section 1: Overview Metrics (Top Row)
| Metric | Purpose |
|---|---|
| AI Search Sessions | Total sessions from AI sources |
| AI Share of Total Traffic | AI sessions as % of all sessions |
| AI Traffic Trend | Week-over-week change |
| AI Conversion Rate | Conversions from AI traffic |
Section 2: Platform Breakdown (Second Row)
A bar chart showing sessions by AI platform:
- ChatGPT
- Perplexity
- Gemini
- Claude
- Copilot
- Other AI
Section 3: Landing Page Analysis (Third Row)
Table showing:
- Top landing pages from AI traffic
- Sessions per page
- Bounce rate per page
- Conversion rate per page
- Average engagement time
Section 4: Conversion Funnel (Fourth Row)
Funnel visualization:
AI Traffic Landing → 2. Product Page View → 3. Signup/Demo Request → 4. Conversion
Section 5: Trends (Bottom Row)
Time-series chart showing:
- Daily AI sessions over 90 days
- Overlaid with key optimization milestones (llms.txt deployment, schema updates, content publication)
5 Pre-Built Reports for AI Analytics
Report 1: AI Traffic Overview
Purpose: Weekly executive snapshot of AI search performance.
Setup in GA4 Explore:
- Create a new Exploration
- Select “Free Form” template
- Set date range: Last 28 days, compared to previous period
- Dimensions: Session source/medium, Custom dimension: ai_platform
- Metrics: Sessions, Engaged sessions, Engagement rate, Conversions, Revenue
- Filter: Custom channel group = “AI Search”
Key insights this reveals:
- Total AI traffic volume and growth trend
- Which AI platforms send the most engaged traffic
- Revenue attribution to AI search
Report 2: AI vs. Organic Performance Comparison
Purpose: Compare AI search traffic quality against traditional organic.
Setup:
- Free Form exploration
- Dimensions: Default channel group
- Metrics: Sessions, Engagement rate, Average engagement time, Conversions, Conversion rate
- Filter: Default channel group in (“AI Search”, “Organic Search”)
- Visualization: Comparison table
What to look for:
- Typically, AI-referred visitors have higher engagement rates and longer session durations because they arrive with more context about your product
- If AI traffic converts lower than organic, your landing pages may not be optimized for AI-referred visitors
Report 3: AI Landing Page Performance
Purpose: Identify which pages AI agents are driving traffic to and how well they convert.
Setup:
- Free Form exploration
- Dimensions: Landing page, Session source
- Metrics: Sessions, Engagement rate, Conversions
- Filter: Custom channel group = “AI Search”
- Sort: Sessions (descending)
Action items from this report:
- Pages with high AI traffic but low conversion need CRO optimization
- Pages with zero AI traffic but high potential need better AI optimization (schema, structure, llms.txt links)
Report 4: AI Platform Deep Dive
Purpose: Understand behavior differences between visitors from different AI platforms.
Setup:
- Free Form exploration
- Dimensions: Landing page, Session source
- Metrics: Sessions, Engagement rate, Conversions
- Filter: Custom channel group = “AI Search”
- Sort: Sessions (descending)
Typical patterns:
- Perplexity visitors tend to be more research-oriented with longer session durations
- ChatGPT visitors often arrive on specific product pages with higher purchase intent
- Gemini visitors may show behavior patterns similar to Google organic visitors
Report 5: AI Traffic Conversion Path
Purpose: Understand how AI-referred visitors navigate your site before converting.
Setup:
- Path Exploration
- Starting point: Session start with channel group = “AI Search”
- Steps: Page path
- End point: Conversion event (signup, demo request, purchase)
Insights:
- Map the typical journey from AI referral to conversion
- Identify drop-off points where AI-referred visitors leave
- Discover which content sequences lead to the highest conversion rates
Understanding Each Metric
AI Sessions
The number of sessions where the user arrived from an AI search platform. This is your top-line AI traffic metric. Track it weekly and look for growth trends.
AI Engagement Rate
The percentage of AI-referred sessions that were “engaged” (lasted more than 10 seconds, had a conversion event, or had 2+ page views). A healthy AI engagement rate is typically 60-80%.
AI Conversion Rate
The percentage of AI-referred sessions that resulted in a key conversion (signup, demo request, purchase). Compare this against your overall site conversion rate. AI traffic often converts 30-50% higher than cold organic traffic because visitors arrive pre-educated.
AI Share of Traffic
AI sessions as a percentage of total sessions. In early 2026, most SaaS companies see 3-8% of total traffic from AI sources. This number is growing rapidly.
AI-Assisted Conversions
Conversions where AI search was part of the path but not the last touchpoint. A user might discover you through Perplexity, leave, Google your brand name, and then convert. The AI-assisted conversion metric captures this influence.
Brand Search Lift
The increase in branded search queries correlated with AI citation activity. If your brand name searches spike after you start appearing in AI responses, that’s AI-driven brand awareness showing up in your organic channel.
Real Analytics Examples
Example 1: SaaS Tool After llms.txt Implementation
Before implementation (baseline month):
- Total AI sessions: 142
- AI share of traffic: 0.8%
- AI conversion rate: 1.2%
- Primary AI source: Perplexity (68%)
Three months after implementation:
- Total AI sessions: 1,890
- AI share of traffic: 8.3%
- AI conversion rate: 3.8%
- Primary AI source: ChatGPT (45%), Perplexity (32%), Gemini (15%)
Key observation: AI traffic didn’t just grow in volume — the conversion rate tripled because the llms.txt file helped AI agents send more qualified visitors who already understood the product.
Example 2: E-commerce Platform After Schema Markup
Before schema optimization:
- AI sessions concentrated on homepage (78%)
- Average pages per AI session: 1.3
- AI bounce rate: 72%
After schema optimization:
- AI traffic distributed across product pages (45%), comparison pages (25%), and blog (20%)
- Average pages per AI session: 3.1
- AI bounce rate: 38%
Key observation: Schema markup helped AI agents send visitors to the most relevant page rather than just the homepage, dramatically improving engagement.
Troubleshooting Common Tracking Issues
“I see zero AI traffic in my reports”
Check these in order:
- Is your custom channel group correctly configured? Test by manually visiting your site from ChatGPT and checking real-time reports.
- Is the referrer being passed? Some AI platforms open links in new tabs that strip referrer data. Check your GA4 real-time report while clicking through from an AI response.
- Is your site blocking referrer headers? Check for overly restrictive
Referrer-Policyheaders.
“AI traffic appears as Direct”
This happens when AI platforms open URLs without passing a referrer. Solutions:
- Use UTM parameters in your llms.txt links
- Accept that some AI traffic will always show as Direct. Track brand search lift as a proxy metric.
- Implement server-side logging to capture user agent data that GA4 doesn’t track.
“Numbers seem too low”
AI traffic measurement is inherently incomplete. Consider:
- Users who see your brand in an AI response but Google it instead of clicking through (shows as organic)
- Users who copy-paste your URL (shows as direct)
- Users who remember your brand and visit later (shows as direct)
A reasonable rule of thumb: your actual AI-influenced traffic is 3-5x what your analytics directly measure.
“I can’t tell which content AI agents are citing”
Track this by:
- Running manual AI queries weekly and documenting which pages are cited
- Monitoring GA4 landing page reports filtered to AI traffic
- Checking server logs for AI bot crawl patterns — frequently crawled pages are likely being cited
FAQ
1. How do I track ChatGPT traffic in Google Analytics 4?
ChatGPT traffic appears in GA4 as referral traffic from chatgpt.com or chat.openai.com. Create a custom channel group that includes these domains to separate ChatGPT traffic from other referrals. Additionally, set up custom dimensions using GTM to automatically tag ChatGPT sessions for deeper analysis.
2. What percentage of my traffic should come from AI search?
In early 2026, SaaS companies with optimized AI visibility typically see 5-15% of total traffic from AI sources. This percentage is growing month over month. Companies that haven’t optimized for AI search typically see under 2%. The important metric isn’t just volume but quality — AI traffic often converts significantly better than cold organic traffic.
3. Can I track which AI queries lead to my website?
Not directly. Unlike Google Search Console which shows search queries, AI platforms don’t provide query data to website owners. You can infer query patterns by analyzing landing page distributions and by periodically querying AI platforms manually to see when and how your site is cited.
4. Should I use UTM parameters for AI traffic tracking?
Yes, but as a supplementary method. Add UTM parameters to links in your llms.txt file and any content you specifically optimize for AI citation. However, AI agents may strip UTM parameters, so referrer-based detection should be your primary tracking method with UTMs providing additional attribution data.
5. How accurate is AI traffic tracking?
Direct AI traffic tracking in GA4 captures roughly 20-30% of actual AI-influenced visits. The gap comes from users who discover your brand through AI but visit through other channels (organic search, direct URL entry), privacy settings that strip referrer data, and AI platforms that don’t pass referrer information. Use brand search lift and total traffic trends alongside direct AI traffic measurement for a more complete picture.


