How to Track LLM & AI Traffic in Google Analytics 4 (Updated Regex for 2026)

Andrew Pfund | Scale and Prosper · 8 min read
Google Analytics GA4 Tracking

AI-powered platforms like ChatGPT, Perplexity, Claude, and Gemini are sending more traffic to websites than ever. But Google Analytics 4 doesn't separate it out for you. Without a custom setup, those visits get buried in your Referral channel or, worse, lumped into Direct traffic where you'll never see them.

This guide walks you through setting up a custom channel group in GA4 to track LLM referral traffic, gives you the most comprehensive and up-to-date regex filter available, and explains why some AI traffic will still show up as Direct no matter what you do.

Why You Need to Track AI Traffic Separately

AI chatbots are becoming a legitimate discovery channel. According to a 2025 Ahrefs study, 63% of websites already receive at least one visitor from an AI chatbot. ChatGPT alone accounts for roughly 50% of all AI-referred traffic, with Perplexity and Gemini making up most of the rest.

But here's the problem: GA4 doesn't have a default channel for AI traffic. That means visits from ChatGPT, Claude, and Perplexity get dumped into "Referral" alongside every other random website that links to you. Some AI traffic doesn't pass a referrer at all and ends up in "Direct," making it completely invisible.

Key benefit: By creating a custom channel group with a regex filter, you can pull AI traffic into its own category. GA4 will even apply it retroactively to your historical data.

The Updated Regex Filter (February 2026)

Here's a comprehensive regex that covers all major AI platforms currently sending referral traffic. This is designed for use in GA4's custom channel groups where you set Source → matches regex:

GA4 Source Regex
.*\.openai.*|.*copilot.*|.*chatgpt.*|.*chat\.com.*|.*gemini.*|.*neeva.*|.*writesonic.*|.*nimble.*|.*outrider.*|.*perplexity.*|.*google.*bard.*|.*bard.*google.*|.*bard.*|.*edgeservices.*|.*aitastic.*|.*copy\.ai.*|.*bnngpt.*|.*claude\.ai.*|.*anthropic.*|.*deepseek.*|.*meta\.ai.*|.*grok.*|.*x\.ai.*|.*mistral.*|.*you\.com.*|.*poe\.com.*|.*phind.*|.*character\.ai.*|.*iask\.ai.*|.*huggingface.*|.*blackbox\.ai.*|.*pi\.ai.*|.*komo\.ai.*|.*consensus\.app.*

What This Regex Covers

Here's every AI platform included and why it matters:

Tier 1: High Traffic Volume

You're almost certainly getting traffic from these.

PlatformRegex PatternNotes
ChatGPT.*chatgpt.*, .*\.openai.*, .*chat\.com.*Largest single AI referrer. chat.com now redirects to ChatGPT.
Perplexity.*perplexity.*Second-largest AI referrer. Always passes referral data.
Google Gemini.*gemini.*, .*google.*bard.*, .*bard.*Formerly Bard. Multiple patterns needed for legacy referrers.
Microsoft Copilot.*copilot.*, .*edgeservices.*Bing-integrated AI. Edge browser traffic shows as edgeservices.
Claude.*claude\.ai.*, .*anthropic.*Anthropic's Claude. Growing referral traffic with citations feature.
DeepSeek.*deepseek.*Chinese AI platform that surged in late 2024/early 2025.

Tier 2: Moderate Traffic

Worth tracking, growing fast.

PlatformRegex PatternNotes
Meta AI.*meta\.ai.*Meta's AI assistant across Facebook, Instagram, WhatsApp.
Grok.*grok.*, .*x\.ai.*xAI's chatbot integrated into X (Twitter).
Mistral.*mistral.*European AI company with growing user base.
You.com.*you\.com.*AI-powered search engine with source citations.
Poe.*poe\.com.*Quora's multi-model AI platform.

Tier 3: Niche / Emerging

Captures long-tail AI traffic.

PlatformRegex PatternNotes
Phind.*phind.*Developer-focused AI search.
Character.ai.*character\.ai.*Large user base, occasional referral traffic.
iAsk.ai.*iask\.ai.*AI-powered Q&A search engine.
HuggingFace.*huggingface.*AI model hub, sends some referral traffic.
Blackbox AI.*blackbox\.ai.*AI coding assistant.
Pi.ai.*pi\.ai.*Inflection AI's conversational assistant.
Komo.ai.*komo\.ai.*AI search engine.
Consensus.*consensus\.app.*AI-powered academic research search.
Copy.ai.*copy\.ai.*AI writing tool.
Writesonic.*writesonic.*AI content platform.
Aitastic.*aitastic.*AI search tool.
BnngGPT.*bnngpt.*Bing GPT variant.
Nimble.*nimble.*AI data platform.
Neeva.*neeva.*Legacy AI search (acquired by Snowflake).
Outrider.*outrider.*AI platform.

Step-by-Step: Setting Up the Custom Channel Group in GA4

1

Navigate to Channel Groups

Log into your GA4 property. Click the Admin gear icon (bottom left). Under Data Display, click Channel Groups.

2

Create a New Channel Group

Click Copy to create new to duplicate the default channel grouping. Name it something clear like "Default + AI Traffic" so you know what it is.

3

Add the AI Traffic Channel

Click Add new channel. Name it "LLM Traffic" or "AI Traffic."

Set the channel condition:

  • Dimension: Source
  • Match type: matches regex
  • Value: Paste the regex from above

Click Apply, then Save channel.

4

Reorder the Channel (Critical Step)

This is the step most people miss. Click Reorder and drag your new AI Traffic channel above the Referral channel.

GA4 processes channel rules top to bottom. If Referral is above your AI channel, AI traffic gets caught by the Referral rule first and never reaches your custom channel.

Click Apply, then Save group.

5

View Your AI / LLM Traffic in 24 Hours

It takes about a day for the new results to show up. After roughly 24 hours, go to Reports → Acquisition → Traffic Acquisition. Use the dimension dropdown in the table and select Session custom channel group. You'll now see AI Traffic as its own as "LLM Traffic" like the below screenshot row alongside Organic Search, Direct, Referral, and your other channels.

Google Analytics GA4 Tracking

The best part: GA4 applies custom channel groups retroactively, so you'll immediately see historical AI traffic data.

Common Regex Mistakes to Avoid

Mistake: Using ^.*ai as a catch-all.

This is a mistake we see in a lot of regex filters floating around online. The pattern .*ai matches any source containing the letters "ai," which includes "mail," "contain," "gmail," "domain," and hundreds of other non-AI sources. This will massively inflate your AI traffic numbers. Always use specific domain patterns instead.

Mistake: Forgetting .* wildcards around domain names.

In GA4's source dimension, the value might be chatgpt.com, chatgpt.com / referral, or just chatgpt. Wrapping patterns with .* on both sides (like .*chatgpt.*) ensures you catch all variations.

Mistake: Not escaping dots in domain names.

In regex, a dot (.) matches any character. While .*chatgpt.* works fine as a broad match, if you want precision, use .*chatgpt\.com.* with the escaped dot.

Mistake: Missing the channel reorder step.

If your AI channel sits below Referral in the channel group order, AI traffic gets classified as Referral first. Always drag AI above Referral.

Why Some AI Traffic Still Shows as "Direct"

Even with a perfect regex, you'll never capture 100% of AI-referred traffic. Here's why:

  • ChatGPT's free tier strips referrer data. When free ChatGPT users click a link, many browsers and app configurations don't pass the referrer header. The visit shows up as Direct in GA4.
  • Mobile apps don't pass referrers. When someone uses the ChatGPT, Claude, or Perplexity mobile app and taps a link, the in-app browser often strips the referrer entirely. This is a platform-level limitation, not something you can fix with analytics configuration.
  • Users copy-paste URLs. When a chatbot provides a URL and the user copies it into their browser rather than clicking it, there's no referrer data at all. It's Direct traffic by definition.
  • AI Overviews and AI Mode in Google Search. Google's AI-generated answers in search results don't send separate referrer data. Those clicks are counted as regular Google organic traffic in both GA4 and Search Console.

The bottom line: Your GA4 AI traffic numbers represent a floor, not a ceiling. The actual amount of AI-influenced traffic to your site is likely higher than what you can track.

Keep Your Regex Updated

The AI landscape changes fast. New platforms launch, existing ones rebrand (remember when Gemini was Bard?), and referrer patterns shift. We recommend reviewing and updating your regex quarterly or whenever a major new AI platform launches.

Check your unfiltered Referral traffic periodically for new sources that contain "ai," "chat," or "assistant" in the domain name. Those are likely new AI tools you should add to your filter.

Last updated: February 2026

Need help with your analytics setup?

We help established businesses fix their tracking, find revenue leaks, and build systems that actually work.

Book a Free Consultation