Search is changing. Instead of clicking through ten blue links, users now ask AI assistants like ChatGPT, Claude, and Gemini for direct answers. When these AI tools cite your website, the clicks you get are highly targeted—and they convert better than traditional search traffic.

The problem? GA4 often mislabels this traffic as "Direct" or "Unassigned." This guide shows you exactly how to fix that in under 5 minutes using GA4's May 2026 update, custom regex patterns, and Google Tag Manager tricks.

offline_bolt Quick Answer: How to track AI Referrals in GA4

Since May 2026, GA4 automatically groups ChatGPT, Gemini, and Claude traffic under the AI Assistant channel (medium: ai-assistant). For complete tracking, add these:

  • Custom Channel Groupings: Use regex patterns to capture 50+ AI engines and recover pre-May 2026 data.
  • GTM Fragment Detection: Track clicks from Google AI Overviews using #:~:text= URL parameters.
  • Client-Side Detectors: Capture referrer data before browsers strip it.

offline_bolt Quick Answer: How to track AI Referrals in GA4

Since May 2026, GA4 auto-groups ChatGPT, Gemini, and Claude under AI Assistant (medium: ai-assistant). For full tracking:

  • Custom Channel Groups: Use regex for 50+ AI engines + historical data.
  • GTM Fragment Detection: Track AI Overview clicks via #:~:text=.
  • Client-Side Detectors: Save referrer data before browsers strip it.
bolt TL;DR — Key Takeaways
  • GA4 May 2026 Update: ChatGPT, Gemini, Claude now show under AI Assistant (not retroactive).
  • Problem: 30% of AI traffic still shows as Direct or Unassigned.
  • Solution: Custom channel group with regex for 50+ AI platforms.
  • Pro Tip: Use GTM to capture URL fragments before browser security strips them.

Note: Baseline = May 13, 2026 (Google's native AI classification rollout).

1. What Changed in GA4 (May 2026 Update)

On May 13, 2026, Google updated GA4 to automatically recognize and group traffic from AI assistants like ChatGPT, Gemini, and Claude. Before this, AI traffic was scattered across "Referral," "Direct," or "Unassigned"—making it impossible to measure AI's real impact.

Here's why this matters: Instead of browsing multiple search results, users now ask AI to summarize and recommend. When they click an AI citation, they're already pre-qualified—they know what they want. That's why AI referral traffic converts 4.5x better than organic search.

30%+
AI Traffic Still Lost to Direct
4.5x
Higher Conversion Rates
180s+
Avg Session Duration
50+
AI Referrers to Track

*Q2 2026 cross-industry data

2. Why AI Traffic Shows as "Direct" or "Unassigned"

On May 13, 2026, Google added native AI Assistant tracking to GA4's default reports. This automatically classifies traffic from ChatGPT, Gemini, and Claude—but it's not retroactive (data before May 13 still shows as Direct/Unassigned).

Before this update, AI traffic was lumped into "Referral," "Direct," or "Unassigned." Now GA4 tracks three key dimensions:

Dimension Value What It Does
Medium ai-assistant Auto-assigned when referrer matches a known AI assistant.
Channel Group AI Assistant New native channel alongside Organic Search and Direct.
Campaign (ai-assistant) System-reserved ID to group all chatbot sessions.

Source: Google Analytics 4, May 2026

The Retroactivity Problem

Google's update only covers ChatGPT, Gemini, and Claude. Emerging AI tools (DeepSeek, Grok, Perplexity) aren't included. Plus, the rollout is gradual—some accounts still see AI traffic as "Referral."

Critical: Not Retroactive
Data before May 13, 2026 stays as Direct/Referral. Use May 13 as your baseline for trend analysis. Export historical data manually if you need before/after comparisons.

3. Why 30% of AI Traffic Is Still "Dark"

Despite the introduction of native classification, a significant portion of traffic driven by conversational AI remains unmeasured. This "Dark AI" traffic occurs when generative assistant visits arrive at a website without the necessary metadata for GA4 to classify them. The table below outlines the differences in how ChatGPT and Gemini handle outbound links, which directly affects how they are attributed in GA4:

Technical Attribute ChatGPT Outbound Links Google Gemini Outbound Links
Default Referrer Domain chatgpt.com or chat.openai.com gemini.google.com or bard.google.com
Auto-Appended Parameters Automatically appends utm_source=chatgpt.com to conversational search citations. Does not automatically append UTM parameters to outgoing citations.
Primary Tracking Dependency Relies on a combination of URL parameters and the referrer header. Relies entirely on the presence of the referrer header.
Primary GA4 Attribution Risk High risk of landing in the Unassigned bucket if UTM source exists without a matching UTM medium. High risk of falling into Direct or Unassigned if the referrer header is stripped.

Attribution profiles based on client-side header audits conducted in May 2026.

Core Root Causes of Referrer Loss

The loss of referral data from these platforms is driven by four primary technical factors:

  1. In-App Mobile Browsers and Sandbox Environments: Both ChatGPT and Gemini mobile applications utilize native in-app web views to open outbound links. These mobile application sandboxes regularly strip the referrer header before the request reaches the target server, turning what should be classified as an AI-assistant referral into a Direct session.
  2. User Copy-and-Paste Behavior: Conversational interfaces encourage users to copy-paste URLs or citations to read later. When a link is copied directly from an active chat pane and pasted into a new browser tab, no document referrer is created. GA4 evaluates this as a fresh session without attribution metadata, categorizing it as Direct.
  3. Advanced Agentic Web Browsing (Screen-Level Automation): With the release of agentic tools such as Gemini Agent, Gemini Browser Agent, Gemini 2.5/3.0 Computer Use, and ChatGPT Agent, AI assistants are performing browser actions on behalf of the user. These tools often browse headless or utilize browser-base visual loops (analyzing screenshots and executing clicks via tools like Playwright). Because these automated flows interact with visual elements directly rather than using standard HTTP navigation, referrer headers are regularly stripped. The eventual user "takeover" or subsequent redirection session frequently registers as a direct visit, masking the true agentic origin.
  4. Strict Referral Policies and Security Headers: Standard security headers, such as Referrer-Policy: no-referrer or specific link elements decorated with rel="noreferrer", strip origin data on cross-site clicks. Additionally, privacy features like Safari’s Intelligent Tracking Prevention (ITP) and various ad-blocking browser extensions truncate or remove referral metadata.
The Unassigned Traffic Attribution Cascade
In GA4, the Unassigned channel acts as a system fallback when session data exists but fails to match any criteria of the Default Channel Group. ChatGPT Search's auto-tagging introduces a specific technical issue here: because ChatGPT appends utm_source=chatgpt.com but omits utm_medium, the session parameters violate the strict matching rules of default GA4 channels. If the referrer header is simultaneously missing, GA4 cannot associate the session with the Referral channel or the new native AI Assistant channel, dumping the visit directly into the Unassigned bucket.

4. Custom Channel Grouping: Architecture and Execution

Because Google's native AI Assistant default channel is limited to an unpublished, select group of referrers and does not backfill historical data, implementing a Custom Channel Group is highly recommended. This parallel setup ensures that all historical data is unified and that emerging platforms are immediately classified.

A custom channel group also helps bypass the strict 250-character limit applied to standard manual report filters. This limit prevents analysts from inputting comprehensive regex patterns directly into Traffic Acquisition reports, making system-level channel groups the only scalable option for enterprise tracking.

Step-by-Step Configuration for GA4 Custom Channel Grouping

To configure a custom channel group, follow these steps:

  1. Navigate to Settings:

    Log in to the GA4 Admin console, go to the Property-level column, expand the Data Display menu, and select Channel Groups.

  2. Initiate New Group:

    Click the Create new channel group button. It is recommended to copy the existing Default Channel Group to maintain standard tracking configurations.

  3. Name and Describe:

    Label the new channel group Default + AI Traffic and add a clear description indicating it separates AI assistant traffic from referrals.

  4. Add Custom Channel:

    Click the Add new channel button. Name this specific channel Artificial Intelligence (using the full name avoids naming conflicts during future reporting adjustments).

  5. Configure Conditions:

    Set the condition criteria to Source matches regex. Paste the comprehensive regex pattern to match recognized AI referrer domains.

  6. Enforce Rule Evaluation Order:

    Click the Reorder button. Drag the newly created Artificial Intelligence channel to a position directly above the generic Referral and Organic Search channels.

  7. Save Configuration:

    Click Apply on the reordering panel, then click Save Group in the top-right corner. Apply this group to standard reports and explorations.

Regular Expression Strategies for Custom Channels

Analysts can choose between two regex strategies depending on their analytical requirements:

A. Comprehensive Enterprise Regular Expression

Designed for Custom Channel Groups. Targets a wide range of international chatbots, developer APIs, custom wrappers, and LLM search agents.

chatgpt\.com|chat\.openai\.com|gemini\.google\.com|deepseek\.com|perplexity(?:\.ai)?|claude\.ai|copilot\.microsoft\.com|deepl\.com|character\.ai|(?:\w+\.)?meta\.ai|grok\.x\.com|grok\.com|x\.ai|bard\.google\.com|(?:\w+\.)?mistral\.ai|writesonic\.com|quillbot\.com|chat\.suno\.com|turing\.microsoft\.com|cosmos\.microsoft\.com|orca\.microsoft\.com|phi\.microsoft\.com|megatron\.microsoft\.com|jarvis\.microsoft\.com|maia\.microsoft\.com|aitastic\.app|bnngpt\.com|chat-gpt\.org|(?:\w+\.)?edgepilot|firefly\.adobe\.com|edgeservices|iask\.ai|(?:\w+\.)?neeva|nimble\.ai|open-assistant\.io|(?:\w+\.)?copy\.ai|openchat\.so|blackbox\.ai|ex\.ai|cohere\.ai|anthropic\.com|(?:\w+\.)?palm-ai\.google\.com|chatglm\.cn|gemini-api\.google\.com|palm\.google\.com|deeplearning\.google\.com|vertexai\.google\.com|ai\.google\.com|deepmind\.google\.com|ml\.googleapis\.com|tensor\.google\.com|t5\.google\.com|my-ai\.snapchat\.com|ai\.baidu\.com|xiaoice\.com|anthropic-api\.com|huggingchat\.com|deepmind\.com|alphacode\.google\.com|copilot\.azure\.com|felo\.ai|chat\.qwen\.ai|(?:\w+\.)?qwenlm\.ai|(?:\w+\.)?outlier\.ai|chat\.hotmart\.ai|customgpt\.ai|venice\.ai|bot\.ivy\.ai|chat\.chatbotapp\.ai|lmarena\.ai|wrtn\.ai|chat\.chaton\.ai|app\.chatboxapp\.ai|duck\.ai|sider\.ai|webpilot\.ai|ai21\.com|pi\.ai|zhipu\.ai|huggingface\.co|wordtune\.com|reka\.ai|syntesia\.io|jasper\.ai|uminal\.org|ai-coustics\.com|magical\.team|vicuna\.ai|floydhub\.com|forefront\.ai|komo\.ai|wav\.ai|d-id\.com|sap\.ai|useblackbox\.io|you\.com|chinchilla\.ai|openrouter\.ai|waldo|coze\.com|exa\.ai|spellbook\.rossintelligence\.com|yiyan\.baidu\.com|lighton\.ai|baichuan-ai\.com|hyperwriteai\.com|phind\.com|app\.loora\.ai

B. Shorter Filter-Friendly Regular Expression

Designed for ad-hoc filters in standard GA4 reports. Fits within the system's strict 250-character limit.

chatgpt\.com|chat\.openai\.com|gemini\.google\.com|deepseek\.com|perplexity(?:\.ai)?|claude\.ai|copilot\.microsoft\.com|deepl\.com|character\.ai|(?:\w+\.)?meta\.ai|grok\.x\.com|grok\.com|x\.ai|bard\.google\.com|(?:\w+\.)?mistral\.ai|writesonic\.com

Frequently Asked Questions