Tracking Traffic From ChatGPT, Perplexity and Gemini in GA4 and BigQuery A developer published a method for isolating traffic from AI assistants such as ChatGPT, Perplexity, Gemini, Copilot, Claude and DeepSeek in Google Analytics 4 and BigQuery. The approach adds a custom "AI assistants" channel group in GA4 that matches referrer hosts and utm_source values, and provides a BigQuery query that identifies the first page_view of each session attributed to an AI assistant. The writeup notes that AI Overviews and AI Mode clicks arrive as ordinary Google organic traffic and that mobile apps, privacy settings and copy-pasted URLs often strip the referrer, leaving much AI-influenced traffic unattributed. AI visibility metrics tell you how often assistants mention and cite you. Sooner or later someone asks the follow-up: does any of that turn into traffic? Part of the answer is already in your analytics, mixed into "Referral" alongside every other website. This post separates it out: It also covers the large share of AI-influenced traffic you can't see this way, because that limitation should shape how you report the numbers. When a user clicks a source link inside an AI answer, the visit arrives in one of three ways: | Signal | Example | Notes | |---|---|---| | Referrer header | https://chatgpt.com/ , https://www.perplexity.ai/ | Most common for web clients. | | UTM parameter | ?utm source=chatgpt.com | ChatGPT adds this to many outbound links. | | Nothing | direct | Mobile apps, privacy settings and copy-pasted URLs often strip the referrer. | Referrer hosts to match keep this list in one place, it changes : chatgpt.com, chat.openai.com perplexity.ai, www.perplexity.ai gemini.google.com copilot.microsoft.com claude.ai chat.deepseek.com Google's AI Overviews and AI Mode clicks generally come through as ordinary Google organic traffic, so they won't appear here. In Admin → Data display → Channel groups , copy the default group and add a channel called AI assistants with this condition: ^ chatgpt\.com|chat\.openai\.com| www\. ?perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|chat\.deepseek\.com $ Then drag the new channel above "Referral" . Channels are evaluated in order, and the first match wins, so if Referral sits above it, AI traffic is still caught by Referral. Because the rule matches source , it catches both referrer-based and utm source=chatgpt.com visits. Custom channel groups also apply retroactively in GA4 reports, so you get history from day one. The UI is fine for trends. For landing pages, joins and custom logic, use the BigQuery export. This query finds the first page view of each session that came from an AI assistant, using either the referrer or the UTM source: DECLARE ai re STRING DEFAULT r' chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|chat\.deepseek\.com '; WITH pv AS SELECT PARSE DATE '%Y%m%d', event date AS day, user pseudo id, SELECT value.int value FROM UNNEST event params WHERE key = 'ga session id' AS session id, SELECT value.string value FROM UNNEST event params WHERE key = 'page location' AS page location, SELECT value.string value FROM UNNEST event params WHERE key = 'page referrer' AS page referrer, collected traffic source.manual source AS utm source, event timestamp FROM my-project.analytics 123456789.events WHERE TABLE SUFFIX BETWEEN FORMAT DATE '%Y%m%d', DATE SUB CURRENT DATE , INTERVAL 28 DAY AND FORMAT DATE '%Y%m%d', CURRENT DATE AND event name = 'page view' , landing AS SELECT , ROW NUMBER OVER PARTITION BY user pseudo id, session id ORDER BY event timestamp AS rn FROM pv SELECT day, COALESCE REGEXP EXTRACT page referrer, ai re , REGEXP EXTRACT utm source, ai re AS assistant, REGEXP REPLACE REGEXP EXTRACT page location, r'^https?:// ^/ + ^? ' , r'/$', '' AS landing path, COUNT AS sessions FROM landing WHERE rn = 1 AND REGEXP CONTAINS IFNULL page referrer, '' , ai re OR REGEXP CONTAINS IFNULL utm source, '' , ai re GROUP BY day, assistant, landing path ORDER BY sessions DESC; Notes: collected traffic source exists in exports from mid-2023 onward. For older data, rely on the referrer only. REGEXP EXTRACT returns the matched host, so www.perplexity.ai and perplexity.ai both come out as TABLE SUFFIX keeps the scan, and the bill, to the date range you need. events matches events intraday tables as well, so the most recent day can be double-counted. Use events 2 to match only the daily tables. If you're collecting citations see the earlier posts in this series , you have, per page, how often AI answers cited it. Now you have, per page, how many sessions AI assistants sent. Put them side by side: WITH cited AS SELECT landing path, SUM citations AS citations FROM my-project.ai visibility.page citations 28d -- your citation data, by path GROUP BY landing path , clicked AS SELECT landing path, SUM sessions AS ai sessions FROM my-project.ai visibility.ai sessions 28d -- the Step 2 result, saved GROUP BY landing path SELECT COALESCE c.landing path, k.landing path AS landing path, IFNULL c.citations, 0 AS citations, IFNULL k.ai sessions, 0 AS ai sessions, SAFE DIVIDE k.ai sessions, c.citations AS sessions per citation FROM cited c FULL OUTER JOIN clicked k USING landing path ORDER BY citations DESC; The four quadrants are the actionable part: Be upfront with stakeholders about three blind spots: This is why referral traffic alone underrates AI search, and why it needs to sit next to visibility metrics rather than replace them. The useful report puts visibility mentions, citations, share of voice and outcome AI sessions, conversions in front of the same people, at the same cadence. Vista AI's Brand Visibility Dashboard https://www.vistaai.io/features/brand-visibility-dashboard covers the visibility side: visibility by engine and region, share of voice against competitors, sentiment, per-query rankings and 30/90/365-day trends, with weekly email reports. It also supports multiple brands with separate query sets, which helps agencies report per client. Pair it with the GA4 channel above and you have both halves: how often AI recommends you, and how often that recommendation becomes a visit.