AI Search and GEO · How to

AI traffic in GA4: set up an AI assistants channel with regex

Part of the guide Generative engine optimization (GEO): a practical guide for 2026

To see AI traffic in GA4, create a custom channel group (Admin, Data display, Channel groups), add a channel called "AI assistants" whose Source matches a regex for chatgpt, perplexity, claude.ai, gemini.google, copilot.microsoft and similar, and move it above Referral. Because GA4 regex is full match by default, wrap the pattern in .* on both sides. It applies to past data too.

Why AI traffic hides in Referral and Direct

GA4's default channel group has no AI channel, so visits from ChatGPT, Perplexity or Claude land in Referral when the app passes a referrer, and in Direct when it does not. Spread across dozens of referral rows, they are easy to miss. A custom channel group pulls them into one line you can trend, compare and segment. Referral sessions are one of the four measurements described in the generative engine optimization guide.

This only counts clicks. Answers that mention you without a click never reach GA4. For the full picture, see the AI visibility tracking guide.

Step by step: create the AI assistants channel

These steps follow Google's Analytics Help page on custom channel groups, checked on 16 November 2026. You need editor access to the property.

  1. In GA4, open Admin. Under Data display, click Channel groups.
  2. Click Create new channel group. GA4 starts you with a copy of the default group, so all standard channels are already there.
  3. Name it, for example "Channels with AI", and optionally add a description.
  4. Click Add new channel. Name it "AI assistants".
  5. Add a condition: Source, matches regex, and paste the regex from the next section.
  6. Save the channel.
  7. Click Reorder and drag "AI assistants" above "Referral". Google's own instructions say to place it above Referral, and above Organic Search if needed.
  8. Click Save group.

Order matters because, in Google's words, "traffic is included in the first channel whose definition it matches". If Referral sits above your AI channel, Referral captures the visits first.

Limits worth knowing: a standard property can have 2 custom channel groups (5 on Analytics 360), each with up to 50 channels.

Which regex to use

Use this pattern:

.*(chatgpt|openai|perplexity|claude\.ai|gemini\.google|copilot\.microsoft|deepseek).*

Two GA4 rules explain the shape. Google's regex help says "By default, Google Analytics Regex is full regex and case sensitive", meaning "without adding metacharacters, the expression only returns exactly matching values". A bare chatgpt|perplexity would only match a source that is exactly "chatgpt", not "chatgpt.com". The .* on each side turns it into a "contains" match. And because matching is case sensitive, keep the terms lowercase, which is how referral domains are normally recorded.

How the common options compare:

Pattern Matches chatgpt.com? Risk
chatgpt\|openai\|perplexity\|... (no wrapping) Not under full match Misses most AI visits
Google's example in Analytics Help, starting ^.*ai\|.*\.openai.*\|.*chatgpt.*\|... Yes ^.*ai matches any source ending in "ai", so unrelated .ai domains are counted as AI assistants; DeepSeek is not listed
.*(chatgpt\|openai\|perplexity\|claude\.ai\|gemini\.google\|copilot\.microsoft\|deepseek).* Yes Narrow by design; add new assistants as they appear

(The backslashes before the pipes in the table only stop the table from breaking. Paste the pattern from the code block above.)

Review the channel once a quarter. Open Traffic acquisition, filter to Referral, and look for new AI domains that slipped through. Add them to the list.

Check that it works

Custom channel groups apply retroactively, so you can check immediately. Open Reports, Acquisition, Traffic acquisition, and switch the primary dimension to your new channel group. "AI assistants" should appear as its own row with past sessions in it.

If the row is empty:

  • Confirm the channel sits above Referral in the group order.
  • Confirm you used the wrapped regex, not the bare one.
  • Check the Session source dimension in the same report for how AI sources are actually recorded on your property, and adjust the terms.

Google's help page also suggests using the custom group as a secondary dimension in other reports and in explorations, for example to see which landing pages AI visitors arrive on and which key events they trigger.

What to look at each month

Three views tell you most of what GA4 can:

View How What it tells you
AI sessions trend Traffic acquisition, AI assistants row, month over month Whether AI referrals are growing
AI landing pages Landing page report or exploration, filtered to AI assistants Which of your pages engines cite and people click
AI conversions Key events by channel Whether AI visitors sign up or buy

The landing pages view is the most actionable. It tells you which pages are being cited in answers people act on. Compare that list with the URLs in your weekly citation log.

What GA4 cannot see

GA4 undercounts AI influence in four ways:

  1. No referrer, no credit. Some apps and in-app browsers send no referrer, so those visits land in Direct.
  2. Google AI Overviews and AI Mode clicks arrive as Google organic traffic, indistinguishable in GA4. Use Search Console, which counts AI feature traffic in the Performance report; see how to rank in Google AI Overviews.
  3. Mentions without clicks. A recommendation that leads to a branded Google search later shows up as organic or direct, not AI.
  4. Consent and blockers. Visitors who decline analytics cookies or block scripts may not be counted at all, as with any channel.

So treat the AI channel as a floor. Add a "How did you hear about us?" question at signup with ChatGPT, Perplexity and Google AI as options to catch the rest.

For scale: Ahrefs measured AI at 0.1% of total referral traffic across about 35,000 websites in March 2025. A small number in your AI row is normal. Watch the trend and the conversion rate rather than the absolute count.

If you publish with Postbing, you can connect Search Console in the app to see page and query metrics alongside your articles; GA4 setup stays in your own account. See Postbing integrations.

FAQ

What regex should I use for AI traffic in GA4?

Use .*(chatgpt|openai|perplexity|claude\.ai|gemini\.google|copilot\.microsoft|deepseek).* on the Source dimension. The .* wrapping matters because GA4 regex is full match by default.

Why does my AI channel show no data?

Usually because the channel sits below Referral, or the regex is not wrapped in .* and so only matches exact values. Reorder the channel above Referral and check the pattern.

Does the AI channel apply to old data?

Yes. Google says custom channel groups can be applied to your reports retroactively, so you can see past AI sessions as soon as you save.

Can GA4 track Google AI Overviews traffic?

Not separately. Clicks from AI Overviews and AI Mode arrive as Google organic. Search Console includes AI feature traffic in its Performance report.

How many custom channel groups can I create?

Two on a standard GA4 property and five on Analytics 360, each with up to 50 channels, per Google's help page.

Sources

Last updated: November 16, 2026. Spotted an error? Email support@postbing.com and we will fix it. Editorial policy.

Try Postbing free

Postbing reads your site, plans a month of topics from what your customers search for, writes in your voice and publishes to WordPress, Shopify, Webflow or Ghost. Your first article is free.

Try Postbing free

No card needed. No link exchanges, ever.