Skip to content

AI referral traffic in GA4: Set up a custom channel group

Configure GA4 to isolate AI referral traffic from ChatGPT, Claude, Perplexity, and others. Step-by-step regex setup plus data limits explained.

A compact analytics flow begins with a ChatGPT mark in a small answer bubble at lower left, with a citation-link arrow leading to a central web-session card.How-to

GA4 can show ChatGPT, Perplexity, Gemini, Claude and Copilot visits as one channel of their own instead of scattering them across Referral, Unassigned and Direct. Google's native AI Assistant channel, added in May 2026, handles part of this. A ga4 ai channel group that you build yourself and place above Referral handles the rest, including Perplexity. Treat whatever number you get as a floor, because a large share of AI clicks arrive with no referrer, the signal that tells GA4 which website sent the visit. Most of the setup happens in Admin, so access comes first.

What you need before you start

You need Editor access to configure channel groups. Google's custom channel groups article requires Editor or above at the property level to create and edit them. Standard properties allow two custom groups in addition to the predefined one, and 360 properties allow five.

Have these in place before you begin:

  • GA4 Editor role: Needed to create the channel group.
  • Explorations access: Needed to build the landing page and comparison reports.
  • Search Console linked: Holds AI Overviews and AI Mode data.
  • Google Tag Manager (optional): Used to label AI referrers as a custom dimension.
  • BigQuery export (optional): Used for raw referrer analysis beyond the interface.

Why GA4 files AI traffic under Referral and Direct

GA4 sorts each session by the referrer and UTM data that arrive with it. AI assistants send that data inconsistently. Google announced a native AI Assistant channel on May 13, 2026. When the referrer matches a recognized assistant, GA4 assigns the medium "ai-assistant" and the campaign "(ai-assistant)", and the announcement names ChatGPT, Gemini and Claude as examples.

Google's default channel group page lists ChatGPT, Gemini, Deepseek, Copilot and Grok as AI Assistant sources and excludes AI Overviews and AI Mode. Google hasn't published the full list of supported referrers beyond ChatGPT, Gemini, and Claude, so coverage for platforms like Perplexity or Microsoft Copilot is uncertain. AI domains outside the recognized list can still appear under Referral.

The native channel also needs a referrer. Copied links, mobile apps and in-app browsers often strip it, so those visits land in Direct. A third failure appears when a link carries utm_source=chatgpt.com with no medium. Under Google's documented rules, the medium becomes (not set) for exactly that pattern. Those sessions miss the AI Assistant channel entirely.

How to track AI referral traffic in GA4 step by step

Test the source regex with a report filter, then use it in a permanent custom channel group above Referral and analyze landing pages and channel performance in Explorations. Tag links you control and build recurring reports in Looker Studio.

Filter Traffic acquisition by session source/medium

Open Reports, then Acquisition, then Traffic acquisition, and switch the primary dimension to Session source / medium. Click Add filter, choose Session source, set the match type to "matches regex", and paste the pattern from the next step.

Expect rows such as chatgpt.com / referral, chatgpt.com / (not set), perplexity.ai / referral, gemini.google.com / referral and, for traffic after May 13, 2026, chatgpt.com / ai-assistant. Every AI row you can see this way is one that passed a referrer or a UTM. If the table comes back empty, check the date range before you blame the regex.

Copy the AI referrer regex

GA4 regex is full match and case sensitive by default, so the pattern below lists exact hostnames and anchors them. Anchoring stops a short fragment like ai from matching mail hosts or unrelated domains.

^(www\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|claude\.ai|copilot\.microsoft\.com|copilot\.com|edgeservices\.bing\.com|deepseek\.com|chat\.deepseek\.com|grok\.com|meta\.ai|chat\.mistral\.ai)$

Keep bing.com out of the list. Copilot answers inside Bing send the same referrer as ordinary Bing search, so including it inflates the AI number with organic visits. Keep chat.openai.com in, since ChatGPT moved from that domain to chatgpt.com in 2024 and legacy referrers still appear.

Report filters have a tight character limit. Analytics Mania notes that, as of 2026, GA4 allows a maximum of two custom channel groups per property (one is reserved for the Default Channel Group), so be strategic about which groups you prioritize. Recheck the hostnames every quarter against the Session source values in your own property, and add any new assistant domain you find there.

Create a custom AI channel group in Admin

The current path is Admin, then Data display, then Channel groups. Click "Create new channel group", which starts from a copy of the default group. Name the group something like "Channels with AI", then add a new channel called "AI Assistants".

Set the channel condition to Source, choose "matches regex", and paste the pattern. Add a second OR condition, Medium exactly matches ai-assistant, so the channel still catches anything Google's native list recognizes if the list changes. Save the channel and the group.

GA4 assigns each session to the first channel whose rule it matches, reading top to bottom. A new channel saves to the bottom of the list. Left there, it stays empty, because Referral claims perplexity.ai and chatgpt.com before GA4 ever reaches the AI rule.

In the group's row, click ">", then Reorder, and drag AI Assistants above Referral. Google's own AI assistants example tells you to place it above "Referrals" and, if needed, above Organic Search too. Moving it above Organic Search is optional. Click Apply, then save the group.

Check how the group applies to historical data

Custom channel groups apply retroactively in reports, so last year's Perplexity sessions move into AI Assistants as soon as you save. Google's native channel works differently. SEO Sherpa reports that historical data isn't reclassified, so May 13, 2026 is its baseline.

Edits behave differently depending on where the group is used:

  • Reports, Explorations and segments: The new definition applies to the underlying data immediately, which can make numbers differ from older exports.
  • Audiences: Changes affect eligibility going forward only, with no retroactive effect.
  • 360 expanded datasets: These keep the earlier definition after you edit the group.
  • Deletions: These are irreversible. Reports, audiences and expanded datasets that use the deleted group show the dimension as unavailable and need a manual update.

Build an Exploration for AI landing pages

Create a free-form Exploration. Import Session custom channel group, Landing page + query string, Session source and Date as dimensions, and Sessions, Engaged sessions and Key events as metrics. Filter on Session custom channel group exactly matches AI Assistants. Put Landing page + query string in rows and Session source in columns.

The result shows which pages assistants send people to, and from which assistant. Switch the visualization to a line chart by Date to see the trend. Explorations respect your data retention setting, while standard aggregated reports aren't affected by it. A date range longer than the property's retention period loses the older rows.

Duplicate the tab. Use Session custom channel group as the only row dimension, filter it to AI Assistants and Organic Search, and add Engagement rate, Key event rate and Total revenue as metrics.

Read the comparison per landing page, not only in aggregate, so one page's results don't get averaged away. Revenue and key events only mean something if your key events are configured, so confirm they fire before you present the comparison to anyone.

Organic citations inside an AI answer can't be tagged, because the assistant writes the link. Links you place yourself can be tagged. That covers content partnerships, experiments with AI platforms, and any URL you share in a public document or custom assistant. MarTech recommends unique UTMs for exactly those cases.

Always set both utm_source and utm_medium. GA4 reports (not set) for incomplete tags, and a source without a medium lands in Unassigned.

ChatGPT tags its own links with utm_source=chatgpt.com, a parameter OpenAI introduced in June. Search Engine Land reported the tag disappeared in a bug, with a fix rolling out October 15, and noted that most ChatGPT clicks still carry no referral information. The source value matches your regex either way.

Report AI referrals in Looker Studio

Connect the Google Analytics connector to your property, add a time series by Date, and add a table. In the GA4 interface the dimension is named Session custom channel group. In the connector, look for the matching custom channel group field in the data source's field list, and refresh the data source fields if the group doesn't appear.

A recurring view needs three charts:

  • Weekly trend: AI Assistants sessions over time.
  • Assistant breakdown: Sessions by Session source within the AI channel.
  • Top landing pages: AI sessions with engagement rate per page.

Track Google AI Overviews and AI Mode traffic

GA4 can't isolate clicks from AI Overviews or AI Mode. They arrive as google / organic or (direct) / (none) depending on how the user reached Google.

Search Console is the partial workaround.

  • Overall search traffic: Google states that appearances in AI features are counted in the Performance report's "Web" search type, mixed in with all other results.
  • AI impressions: The separate Generative AI performance report shows impressions for AI Overviews and AI Mode by Pages, Countries and Dates. Google says that report reached all websites worldwide as of August 31, 2026. The report contains impressions, not clicks.

Compare its page-level impressions with the same pages' organic sessions in GA4, but keep AI visibility separate from aggregate organic traffic. That comparison cannot isolate visits from AI features.

Visibility inside ChatGPT, Claude, Perplexity and Google AI Mode is a separate measurement from clicks. That gap is what the AI Engine Visibility report in the AI Visibility product in GrowthX covers. Clicks still come from GA4 and Search Console.

Troubleshoot AI traffic GA4 misses

Referrer loss, missing session data and crawler activity need separate checks before you classify visits as AI traffic. Use referrer labels to identify the source data that survives.

Recover dark AI traffic landing in Direct

Whether a referrer survives depends on the assistant surface. Native apps rarely pass one:

More columns
SurfaceWhat GA4 receivesWhere it lands
ChatGPT webchatgpt.com, often with utm_sourceReferral, AI Assistant or Unassigned
ChatGPT iOS and Android appsNo referrerDirect
ChatGPT AtlasReferrer often strippedDirect or (not set)
Perplexity web and Cometperplexity.ai / referralReferral without a custom group
Perplexity desktop appNo referrerDirect
Claude webclaude.ai, no UTMsReferral (desktop browser)
Claude desktop appNo referrerDirect
Copilot web and Edge sidebarcopilot.microsoft.com or edgeservices.bing.comReferral or AI Assistant
Gemini appMostly no referrer, some google.comDirect or google / organic

Those Direct sessions can't be reclassified. One unvalidated heuristic is to build a segment of Direct sessions that land on deep content pages, excluding the homepage and pages people type or bookmark, and watch its trend next to your AI Assistants trend. Matching movement on the same pages in the same weeks doesn't confirm AI traffic, so treat the comparison as a prompt for further checking, not as an estimate or a count.

Fix AI sessions showing as (not set)

AI sessions show (not set) for a handful of documented reasons. Most can be fixed for future data:

  • Source-only UTMs: ChatGPT's utm_source=chatgpt.com arrives without a medium. The Source condition in your channel group still catches these sessions.
  • Missing session_start: Google ties (not set) source/medium to a missing session_start, often because the Google tag isn't on the "Initialization - All pages" trigger.
  • Event tags firing early: GA4 event tags that fire before the Google tag inflate (not set). Fire event tags on later triggers.
  • Measurement Protocol events: Events sent without a valid session_id lose their session source.
  • Consent mode errors: The consent default call must run before Google tags fire.

Fixes apply going forward. Google's comparison of placeholder values marks (not set) as something you can usually correct, but Google usually doesn't update the Daily value later.

Label AI sources with Google Tag Manager

GTM can label AI referrers as a custom dimension. This illustrative configuration uses GTM's documented variable types rather than a documented Google solution for AI traffic.

  • Map referrers: Use the built-in Referrer variable as input to a RegEx Table variable. RegEx Table rows run top to bottom and return the first match, with a default value when nothing matches. Patterns are full match and case insensitive by default.
  • Set outputs: Add rows such as .*chatgpt\.com.* → chatgpt and .*perplexity\.ai.* → perplexity, and set the default to empty.
  • Send and register the parameter: Send the output as an ai_referrer parameter through a Google tag: Event Settings variable. Then register ai_referrer as an event-scoped custom dimension in Admin. The Event parameter field in the registration must match the parameter name exactly, including case, and values only appear for data collected after registration.

With BigQuery export, query the raw referrer and UTM source together:

SELECT
  REGEXP_EXTRACT(
    (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_referrer'),
    r'^https?://([^/]+)') AS referrer_host,
  collected_traffic_source.manual_source AS utm_source,
  COUNT(DISTINCT CONCAT(user_pseudo_id, CAST(
    (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS STRING))) AS sessions
FROM `project.analytics_123456.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20261101' AND '20261130'
  AND event_name = 'page_view'
  AND REGEXP_CONTAINS(
    COALESCE((SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_referrer'), '')
      || ' ' || COALESCE(collected_traffic_source.manual_source, ''),
    r'(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|claude\.ai|copilot\.microsoft\.com|copilot\.com|deepseek\.com|grok\.com)')
GROUP BY 1, 2
ORDER BY sessions DESC

Separate AI crawlers and agents from human visitors

Check crawler activity in server or CDN logs and filter it there by user agent, because AI crawlers rarely show up in GA4 at all. Vercel's analysis found that none of the major AI crawlers render JavaScript, including OpenAI's crawlers, ClaudeBot, PerplexityBot and Meta-ExternalAgent. It follows, as an inference rather than a tested result, that a bot that doesn't execute JavaScript won't fire a client-side GA4 tag.

The current user-agent tokens published by each provider:

More columns
ProviderTrainingSearch indexingUser-triggered fetch
OpenAIGPTBotOAI-SearchBotChatGPT-User
AnthropicClaudeBotClaude-SearchBotClaude-User
PerplexityNot used for trainingPerplexityBotPerplexity-User
GoogleGoogle-Extended (robots.txt token only)GooglebotGoogle-Agent
Microsoft__usage_ai-training robots.txt controlbingbotNot stated

Recheck these pages before you update log filters, because providers add new agents. Google added Google-Agent in March 2026. Perplexity-User generally ignores robots.txt because a user requested the fetch, so blocking it in robots.txt won't stop those visits.

Start with the filter this week

Paste the regex into a Session source filter in Traffic acquisition, note which AI hostnames appear in your property, and build the custom channel group from that list. Once AI sessions are visible, the next question is which pages earn them and which buyer questions they answer. Teams that want AI visibility, page performance and content production in one place can book a demo of the GrowthX platform.