Identifying and Measuring AI Referral Traffic in GA4
GA4 relies on the HTTP Referer header to populate the source dimension for referral traffic. When a user clicks a link from ChatGPT, the browser sends a...
- GA4 relies on the HTTP Referer header to populate the source dimension for referral traffic.
- Based on community testing and published analyses from early 2025, the following signatures have been observed for major AI platforms: ChatGPT web...
- To measure AI referral traffic accurately, you need to bypass GA4's default channel groupings.
- No detection layer is perfect.
- Extract your GA4 source / medium report for the past 90 days.
GA4 relies on the HTTP Referer header to populate the source dimension for referral traffic. When a user clicks a link from ChatGPT, the browser sends a Referer header with a value like https://chatgpt.com or https://chat.openai.com . GA4 captures this as source = chatgpt.com and typically...
The Referrer Detection Problem

GA4 relies on the HTTP Referer header to populate the source dimension for referral traffic. When a user clicks a link from ChatGPT, the browser sends a Referer header with a value like https://chatgpt.com or https://chat.openai.com. GA4 captures this as source = chatgpt.com and typically assigns medium = referral. In theory this works correctly. In practice, several factors break the chain.
First, link navigation from within AI chat interfaces often uses in-app browsers or embedded web views. These environments sometimes strip or modify the Referer header. A user clicking a link in the ChatGPT mobile app, for example, may navigate with no referrer at all, causing GA4 to register the visit as direct / (none). The same behavior has been documented on the Perplexity iOS app and the Claude desktop client.
Second, GA4's session unification logic can overwrite the referral source if the user arrived through a sequence of redirects. An AI platform that wraps outgoing links in a tracking redirector (some do, some do not) will shift the source value to the intermediate domain rather than the AI platform itself. This produces source = redirect.tracker.com instead of source = chatgpt.com.
Mapping Current AI Referrer Signatures

Based on community testing and published analyses from early 2025, the following signatures have been observed for major AI platforms:
- ChatGPT (web):
source = chatgpt.com,medium = referral(most common). Some cases showsource = chat.openai.com. - ChatGPT (mobile app): Frequently
source = (direct),medium = (none)due to missing referrer headers. - Perplexity (web):
source = perplexity.ai,medium = referral. Occasionallysource = lmsys.orgwhen links are generated through shared conversations. - Perplexity (mobile): Mixed. In-app browser referrals are inconsistent; some users report
source = perplexity.aiwithmedium = referral, others reportdirect. - Claude (web):
source = claude.ai,medium = referralwhen clicked from the web interface. - Gemini:
source = gemini.google.com,medium = referral. The source often gets grouped intogoogle / organicby GA4's default channel rules because the hostname matches*.google.com.
The Google channel grouping issue with Gemini is especially problematic. GA4's default rule source / medium contains google / organic matches gemini.google.com / referral because the rule inspects only the source substring and does not validate the medium. This inflates organic search numbers and deflates the true AI referral count.
Building a Detection Framework

To measure AI referral traffic accurately, you need to bypass GA4's default channel groupings. The recommended approach uses a three-layer detection framework:
Layer 1: Custom Channel Grouping. Create a new channel group in GA4 named "AI Referral Traffic." Add explicit rules for each known AI source. Use regex matching to cover subdomain variations. This gives you a clean channel-level view.
Layer 2: Custom Dimension via GTM. Deploy a Google Tag Manager variable that reads document.referrer on page load, maps recognized AI hostnames to a custom dimension called ai_referrer, and populates it server-side. This captures referrals that GA4's native source detection might miss due to redirect chains.
Layer 3: Server-Side Header Inspection. For teams with GTM server-side containers, inspect the Referer header directly in the server container before forwarding the event to GA4. This is the only method that reliably captures the original referrer when client-side JavaScript cannot access it (e.g., in strict privacy modes or in-app browsers).
Known Limitations
No detection layer is perfect. If a user copies a link from an AI chat and pastes it directly into their browser, no referrer data is transmitted regardless of server-side logic. Some AI platforms also implement Referrer-Policy: no-referrer headers on certain pages, blocking referrer transmission entirely. In these cases, UTM tagging is the only fallback.
Audit Actions
Extract your GA4 source / medium report for the past 90 days. Search for any source containing chatgpt, perplexity, claude, gemini, grok, or copilot. Count how many sessions are currently classified as direct or unassigned that originate from these sources. If the count exceeds 5 percent of your total AI platform traffic, implement at least Layer 1 and Layer 2 of the detection framework above before the next audit cycle.
References
- White, J. (2025). "How to Track AI Referral Traffic in GA4." Analytics Demystified.
- Google. (2025). "About traffic source dimensions." Google Analytics Help.
- Patel, N. (2025). "AI Platform Traffic: Measurement Challenges and Solutions." Search Engine Journal.