Free Template
Track AI traffic in GA4.
A copy-paste regex, channel group and segment to isolate ChatGPT, Gemini, Claude, Perplexity, AI Overviews and 11 other AI engines inside Google Analytics 4. The same setup we run in our own GA4.
Catches 16 AI engines · 5-minute setup · No email gate
01 · Setup
8 steps inside GA4.
GA4 ships with default channel groups designed for the 2010s — ChatGPT and Perplexity referrals end up in Referral, Bing Copilot lands in Direct or Organic Search depending on the agent, and AI Overviews don't surface as a separate channel at all.
Five minutes inside a custom Exploration fixes it. Open GA4 → Explore → Blank exploration. Then the steps below.
Name the exploration
Set Exploration name to AI. Date range: Custom or rolling — last 90 days is a sensible default.
Set technique to Free form
In Settings, choose Technique: Free form — the table-style exploration GA4 uses for source × page breakdowns.
Add dimensions
In Variables → Dimensions, add Session source / medium and Page path and screen class.
Add metrics
In Variables → Metrics, add Views and Entrances. Entrances is the leading indicator that AI traffic is landing.
Drop dimensions into Rows
Drag Session source / medium into Rows first, then Page path below it. Source on top, page nested under.
Configure rows + nesting
Start row 1, Show rows 250, Nested rows: Yes. Nesting is what gives you source → top pages on one screen.
Add Views and Entrances to Values
Drag both into Values. Cell type: Bar chart so the magnitude is visual, not just numeric.
Apply the regex filter
In Filters → + → Session source / medium, set the operator to matches regex, paste the regex below. Save.
02 · The regex
16 patterns. One filter.
Paste this into the Filter field. It catches the major AI engines and assistants by source / medium pattern — current names plus the long tail of emerging ones.
.*chatgpt.*|.*openai.*|.*neeva.*|.*writesonic.*|.*nimble.*|.*outrider.*|.*perplexity.*|.*edgeservices.*|.*gemini.*google.*|.*copilot.*|.*claude.*|.*mistral.*|.*meta.*|.*jasper.*|.*deepmind.*|.*copy.*ai.*Engines caught by this pattern
03 · Output
What you'll see in the report.
Source / medium grouped at the top, top pages nested under each source, with Views as a bar-chart cell so the magnitude is immediately visible.
| Session source / medium | Page path | Views | Entrances |
|---|---|---|---|
| chatgpt.com / referral | /features/ai-seo-chat | 2,412 | 1,894 |
| chatgpt.com / referral | /blog/seo-for-chatgpt | 1,823 | 1,502 |
| chatgpt.com / referral | /pricing | 1,109 | 408 |
| perplexity.ai / referral | /blog/seo-vs-ux | 947 | 803 |
| perplexity.ai / referral | /features/ai-visibility-tracking | 631 | 482 |
| gemini.google.com / referral | /blog/seo-para-gemini | 522 | 401 |
| claude.ai / referral | /blog/whats-an-ai-seo-software | 318 | 254 |
| copilot.microsoft.com / referral | /features/schema-generator | 207 | 161 |
Bonus
Make AI Traffic a real channel.
If you want AI traffic visible in every standard report (not just inside the exploration), add a custom channel group in Admin.
01
Admin → Data display → Channel groups
Create a new custom channel group. The exploration filter only affects the exploration; the channel group affects every report.
02
Add channel: AI Traffic
Define the rule as Source / medium matches regex, then paste the same regex from above.
03
Save and re-pivot
Switch any standard Acquisition report to use the new channel group. AI Traffic now shows as a first-class channel.
FAQs
Does this catch AI Overviews?▾
Honestly: not cleanly. AI Overviews surface inside Google search itself, so the referrer is google / organic — indistinguishable from a regular Google organic click. The cleanest signal for AI Overviews lives in Google Search Console (Search type → AI Overview filter), not GA4. We track AI Overviews in GSC alongside this exploration. If you want a single dashboard for mentions across ChatGPT, Gemini, Claude, Perplexity AND AI Overviews, that's what SEOTopSecret's AI Visibility Tracker does — see the link below.
Why isn't this default in GA4?▾
GA4's default channel group was last updated before AI search engines became a meaningful traffic channel. Until Google updates the defaults, every team has to roll its own. This is the version we run.
Should I exclude bot traffic?▾
GA4 already excludes known bots in its standard reports. The regex above only matches known AI engine sources, so bot crawlers shouldn't appear here unless they're spoofing one of these sources. Cross-reference with engagement metrics if anything looks suspicious — real human AI-engine traffic has session times above zero.
Can I do this in Looker Studio?▾
Yes — and we recommend it once your setup is stable. Connect GA4 as a data source, replicate the same regex inside a Calculated Field or Filter, and build a dashboard with AI-source traffic over time. The GA4 exploration is the quickest place to validate the regex first.
How often should I update the regex?▾
Quarterly is enough for most teams. Add a pattern when you see a new source / medium combination appearing in Acquisition that you can't yet attribute. The regex above already covers the major engines and the long tail of emerging ones.
Beyond clicks
Track AI mentions, not just AI traffic.
This GA4 setup tells you when an AI engine sends a click. It doesn't tell you when an AI engine mentions your brand without a click — which is most of the time. SEOTopSecret tracks brand citations across ChatGPT, Gemini, Claude, Perplexity and AI Overviews directly inside the engines themselves.
See AI Visibility TrackingYour Growth Operating System Starts Here
Connect GSC + GA4. See your data in the OS. Your first content brief, technical audit, and rank baseline — ready within hours.