How to track traffic from ChatGPT, Perplexity and Gemini in Google Analytics 4
· 4 min read
If AI assistants send you visitors, Google Analytics 4 will not tell you unless you ask. By default those sessions land in the generic Referral channel, or in Direct when the assistant passes no referrer, which makes them invisible in the report most people check. The setup below takes about five minutes and gives you a clean AI assistants channel you can trend week by week.
What AI visits look like in GA4
A visit from an assistant shows up as a normal referral whose source is the assistant's domain. The values we see most often are chatgpt.com, perplexity.ai, gemini.google.com, copilot.microsoft.com and claude.ai, but check your own data first, because which ones you receive depends on your site. ChatGPT also has a second signal. According to OpenAI's publisher FAQ, it adds utm_source=chatgpt.com to links it cites, so those visits can be attributed even when the referrer is stripped. Do not rely on that alone: Search Engine Land has covered a period when the parameter dropped off ChatGPT links, which it later described as a bug, so tagging can disappear without warning.
Step 1: see the raw sources
- In GA4 open Reports, then Acquisition, then Traffic acquisition.
- Above the table, change the first column from Session primary channel group to Session source / medium.
- Search the table for chatgpt, perplexity, gemini, copilot and claude. Note exactly how each source is spelled.
Step 2: create an AI assistants channel
- Open Admin, then under Data display choose Channel groups.
- Select Create new channel group and name it, for example, Default plus AI.
- Choose Add new channel, name it AI assistants, and set the condition to Session source matches regex with the pattern below.
- Drag the new channel above Referral. Channels are evaluated from the top, so if Referral sits first it will claim the visit before your channel sees it.
- Save. Google documents that custom channel groups apply retroactively to reports, so your history is re-bucketed immediately.
(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai)The pattern allows an optional subdomain because GA4 regex conditions match the whole value, not part of it. Add or remove domains to suit what Step 1 showed you. Two limits from Google's documentation: custom channel groups cannot be used in the key events paths report, and deleting one is irreversible, so edit rather than delete.
Step 3: see which pages AI visitors land on
In Reports, open Engagement, then Landing page. Add a comparison or secondary dimension for your new channel group. The pages that appear here are the ones assistants are actually sending people to, which is a more honest list of your citable pages than any ranking tool. If a page you expected is missing, check whether it is being cited at all with the method in our guide to checking AI citations.
Step 4: tie it to outcomes
Visits are only useful if they do something. Mark your real goals as key events (sign-ups, purchases, contact form submissions), then compare engagement rate and key events per session for AI assistants against Organic Search. Expect small numbers on most sites today. A sample of 40 visits is a direction, not a conclusion.
Why the count is always a floor
- Missing referrers. Some assistant apps and in-app browsers pass no referrer, and those visits fall into Direct. With no UTM tag either, nothing marks them as AI.
- Answers without clicks. Many users read the answer and never visit. That value is real but cannot be seen in analytics. Measure it separately by asking the engines your target questions on a schedule.
- Crawlers are invisible. GA4 runs as JavaScript in a visitor's browser. AI crawlers do not execute your scripts (a Vercel and MERJ study found none of the major ones render JavaScript), so a crawl never shows up in GA4. That is normal.
Watching the crawlers in your server logs
To see whether AI crawlers are reaching you at all, read your web server or CDN logs. This command counts requests from the main AI user agents by address and path:
grep -E "OAI-SearchBot|GPTBot|ChatGPT-User|PerplexityBot|Perplexity-User|ClaudeBot|Claude-SearchBot|Claude-User" access.log \
| awk '{print $1, $7}' | sort | uniq -c | sort -rn | head -20A user agent string can be spoofed, so for anything that matters, check the source address against the vendor's published ranges. Anthropic, for example, lists its crawler addresses at claude.com/crawling/bots.json. If your logs show OAI-SearchBot or PerplexityBot fetching your key pages and getting 200 responses, the technical path is open. If they get 403 or never appear, see why AI crawlers can't see your site.
A five-minute weekly routine
- Open Traffic acquisition for the last 28 days with the AI assistants channel and note sessions and key events.
- Open Landing page filtered to that channel and note the top five pages.
- Run your fixed set of buyer questions in each assistant and record whether you are cited.
- Write down one change you made this week. Without that line, you cannot tell later what moved the numbers.
Frequently asked questions
Why is my ChatGPT traffic showing as Direct?
Some visits arrive without a referrer, and if the link also lacks a UTM parameter GA4 cannot tell where it came from, so it is counted as Direct. A custom channel group fixes the visits that do carry a source. The rest stay unattributed.
Does GA4 track AI crawlers like GPTBot?
No. GA4 only records visits where its JavaScript tag runs in a browser, and AI crawlers do not run it. Use server or CDN logs to see crawler activity.
Will a custom channel group change my old data?
Yes, in reports. Google says custom channel groups apply retroactively to reports, segments and explorations. They do not change how the data was originally collected.
Is AI traffic worth tracking if it is small?
Yes, because you are measuring a trend. Set up the channel now so you have a baseline before the numbers grow.
Sources
Check your own site
Run the free audit to see which of these signals your site already has.
Run the free audit