Tutorial · Practitioner
How to Track AI Traffic in GA4
To track AI traffic in GA4, create a custom channel group with an "AI assistants" channel that matches session sources like chatgpt.com, perplexity.ai, gemini.google.com, claude.ai and copilot.microsoft.com using a regex, and place it above Referral. Then report sessions, engagement and conversions for that channel. It takes about 20 minutes. Expect it to undercount, because some AI visits arrive without a referrer.
What you need: GA4 Editor access and at least a few weeks of data.
On this page
- Step 1: Which AI referrers are already in your data?
- Step 2: What regex should you use?
- From MentionX data: what AI citation links carry
- Step 3: How do you create the custom channel group?
- How do you test the regex before saving?
- Step 4: How do you build the report?
- Step 5: What caveats belong in the report?
- Worked example: Ledgerline's first AI traffic report
- How can you see AI traffic in a funnel?
- How do you compare AI visitors with organic visitors fairly?
- How do you add AI traffic to Looker Studio?
- How do you share it with the team?
- What should you do with the numbers?
- How do you estimate what GA4 misses?
- Common questions
- Troubleshooting
- Sources
GA4 and OpenAI documentation checked on 31 October 2026. "Our view" marks MentionX opinion. Ledgerline is fictional.
Step 1: Which AI referrers are already in your data?
- Go to Reports > Acquisition > Traffic acquisition.
- Change the primary dimension to Session source / medium.
- Search the table for
chatgpt,perplexity,gemini,claude,copilot,openai. - Note the exact source values you see. Common ones include
chatgpt.com,perplexity.ai,gemini.google.com,claude.aiandcopilot.microsoft.com, but use what's actually in your property.
ChatGPT automatically adds utm_source=chatgpt.com to referral URLs (OpenAI), so those sessions may appear with that source even when no referrer is passed. Apps built on OpenAI's API can send utm_source=openai instead; look for both.
Step 2: What regex should you use?
A starting pattern for the session source condition:
.*(chatgpt\.com|chat\.openai\.com|openai\.com|openai|perplexity\.ai|gemini\.google\.com|bard\.google\.com|claude\.ai|copilot\.microsoft\.com|deepseek\.com|meta\.ai|you\.com|phind\.com).*Tips:
- GA4 regex matching for channel conditions is full-match in many places, hence the
.*at both ends. - Escape dots (
\.) soperplexity.aidoesn't match unrelated strings. - Don't add
google.comorbing.com; that would capture normal search. - Review the list quarterly and add new sources you find in step 1.
From MentionX data: what AI citation links carry
Method. Read-only aggregate query over 9,750 citation URLs returned by six engines' APIs in MentionX scans from 22 August to 29 October 2026 (UTC), across 18 anonymised projects. We checked each URL for tracking parameters and redirect hosts. Perplexity, Copilot and DeepSeek data come from a single day (26 October).
| Engine | What the cited links looked like | GA4 consequence |
|---|---|---|
| OpenAI (API) | 95.8% carried utm_source=openai | Clicks from apps built on the API can show source openai |
| ChatGPT (consumer) | Not in our API data; OpenAI documents utm_source=chatgpt.com (OpenAI) | Source chatgpt.com |
| Gemini (API) | 69% were redirect links rather than the final page | Source depends on how the redirect passes the referrer; check your own data |
What it means. The source value in GA4 depends on the product the visitor clicked in, not just the company behind it. A regex that only matches domains such as chatgpt.com misses sessions tagged openai. That's why Step 1, looking at the actual source values in your property, matters more than any published regex.
Limits. These are links returned to MentionX, not clicks by real users, so they show what links look like, not how much traffic each engine sends. We have no GA4 data from customers in this sample.
Our view: treat any AI-traffic regex as a living list. Review the sources in Step 1 every quarter and note each change on the chart.
Step 3: How do you create the custom channel group?
Google's own help article on custom channel groups uses an "AI assistants" channel with a "matches regex" condition as its worked example, naming ChatGPT, Gemini, Microsoft Copilot, Claude and Perplexity (GA4 help). The steps:
- Admin > Data display > Channel groups.
- Click Create new channel group. Name it "Default + AI".
- GA4 copies the default channels. Click Add new channel.
- Name it AI assistants.
- Condition: Source > matches regex > paste your pattern.
- Save, then Reorder so AI assistants sits above Referral. Channels are evaluated in order; if Referral comes first, it captures these sessions.
- Save the group.
Google notes custom channel groups can be applied to your reports retroactively (GA4 help).
How do you test the regex before saving?
A wrong pattern fails quietly: the channel just looks small. Test it before you rely on it:
- Export the source list from Step 1 for the last 90 days.
- Test the pattern against it in a regex tester or in a sheet with
REGEXMATCH(Google Sheets functions). Each AI source should match;google,bingand your own domain should not. - Check for over-matching. Bare words like
openaiormetacan match unrelated sources. Look at every source the pattern catches, not just the ones you expected. - Compare totals after saving. Sessions in the new AI channel plus the new Referral total should equal the old Referral total for the same period, give or take sources you moved on purpose.
Keep the tested pattern, the date and the list of matched sources in a shared doc. When someone asks why the number changed in March, that doc is the answer.
Step 4: How do you build the report?
Quick view: in Traffic acquisition, switch the primary dimension to your new channel group (it appears under the dimension picker as "Session Default + AI").
Better view, an exploration:
- Explore > Free form.
- Dimensions: Session Default + AI, Session source, Landing page + query string, Month.
- Metrics: Sessions, Engaged sessions, Engagement rate, Key events, Total revenue (if ecommerce).
- Rows: Session source; Columns: Month; Filter: channel = AI assistants.
- Add a second tab with Landing page as rows to see which pages AI engines send people to.
| What to look at | Why |
|---|---|
| Sessions by source over time | Which engines send traffic, and the trend |
| Landing pages | Which pages get cited and clicked |
| Engagement rate vs organic | Whether AI visitors behave differently |
| Key events by source | Whether AI traffic converts |
Step 5: What caveats belong in the report?
Put these under every AI traffic chart:
- Undercounting. Missing referrers push some AI traffic into Direct.
- Google AI features aren't here. AI Overviews and AI Mode clicks come from Google and are counted in Search Console's Web search type (Google).
- Clicks aren't influence. Many AI answers are read without a click; pair this report with a prompt-based visibility scan (how).
- Small numbers swing. Report monthly and show absolute counts beside percentages.
Worked example: Ledgerline's first AI traffic report
Ledgerline is a fictional accounts-payable tool. Figures are illustrative. Ledgerline sets up the "Default + AI" channel group and applies it to the last 90 days.
| Source | Sessions | Engaged rate | Demo requests |
|---|---|---|---|
| chatgpt.com | 412 | 68% | 14 |
| perplexity.ai | 96 | 71% | 5 |
| copilot.microsoft.com | 38 | 55% | 1 |
| gemini.google.com | 27 | 63% | 1 |
| openai | 19 | 58% | 0 |
| AI assistants total | 592 | 67% | 21 |
For comparison, Organic Search brought 18,300 sessions and 240 demo requests in the same period. AI assistants are 3% of organic sessions but 9% of organic demo requests: a small channel that converts well.
The landing-page tab shows that 41% of AI sessions land on one comparison page. The team checks it: the pricing table is a year old. They update it and note the date on the chart.
Before the first report, the analyst spots 19 sessions with source openai sitting in Referral. The original regex matched openai\.com only. Adding bare openai moves them into the channel, and a note on the chart explains the jump.
How can you see AI traffic in a funnel?
Use a funnel exploration (GA4 help) with the first step "session_start where channel = AI assistants", then your key steps (pricing view, sign-up start, sign-up complete). Compare with the same funnel for Organic Search. If AI visitors convert at a different rate, you'll see where the difference appears.
How do you compare AI visitors with organic visitors fairly?
AI visitors often land deep in the site, on a comparison or pricing page, while organic visitors arrive across many pages. Comparing channel-wide conversion rates mixes those differences. Compare like with like instead: pick the five landing pages with the most AI sessions and compare engagement and key events for AI and Organic Search on those same pages. If AI visitors still convert better, the difference is more likely real. With small monthly counts, look at a quarter at a time.
How do you add AI traffic to Looker Studio?
Connect GA4 as a data source and use the custom channel group dimension. Build three charts: sessions by AI source (time series), top landing pages from AI (table), key events by AI source (bar). The monthly report template shows a full layout.
How do you share it with the team?
Save the exploration and share it with the property, or pin the Looker Studio report in your team's weekly dashboard. Write the regex, the date it was last updated, and the caveats into the report description so anyone reading it knows what is and isn't counted. When you add a new AI source to the regex, add a note on the chart for that month; a sudden jump may just mean better tracking, not more traffic.
What should you do with the numbers?
Use landing-page data as a content signal. Pages that AI engines send visitors to are pages they cite; check that those pages convert well, have a clear next step and current facts. Pages with high AI traffic and low engagement are often outdated or answer a different question from the one the visitor asked.
How do you estimate what GA4 misses?
You can't measure the missing traffic directly, but you can bound it:
- Watch Direct on AI-cited pages. If Direct sessions to a page rise after it starts appearing in AI answers, some of that is likely AI traffic without a referrer.
- Ask on forms. A "How did you hear about us?" field with an "AI assistant (ChatGPT, Perplexity…)" option captures influence that never shows up as a referral.
- Compare with Search Console. Clicks from Google's AI features are part of Search Console's web search data (Search Console performance report), not a separate AI line.
- Compare with your visibility scans. If you're cited often but get little AI traffic, the answers may satisfy readers without a click.
Our view: report identified AI sessions as a floor, and form responses as a separate signal. Don't add them together.
Common questions
Does GA4 have a built-in AI channel? Not in the default channel group as of this check; you create it as a custom channel group (GA4 help).
Why use `matches regex` and not `contains`? One condition can cover many sources, and it's easier to update in one place.
Will the channel group change historical data? Google says custom channel groups can be applied to reports retroactively.
Do AI agents that browse for users show up? Some do, some don't. Agents that run JavaScript in a browser may record sessions; many fetchers don't run GA4 at all. Check server logs if this matters to you.
Should Google AI Overviews be in the channel? No. Those clicks come from Google Search and belong in Organic Search.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| AI channel is empty | Channel below Referral | Reorder |
| Only ChatGPT appears | Regex typos | Test each domain separately |
| Big jump in Direct | Referrer loss from apps | Note it; can't be fixed in GA4 |
| Numbers differ from a vendor's | Different definitions | Document your regex in the report |
Sources
- Google Analytics Help, Custom channel groups; URL builders and UTM parameters
- OpenAI Help, Publishers and developers FAQ, on
utm_source=chatgpt.com - Google Search Console Help, Performance report
- Google Analytics Help, Funnel exploration
- Google Search Central, AI features and your website
Questions
Does GA4 have a built-in AI channel?
Check your property's default channel group; definitions change. Most teams create a custom channel group with an AI assistants channel based on a source regex, which they control and can update.
Why is some AI traffic showing as Direct?
Some apps and in-app browsers don't pass a referrer, and copied links lose it. That traffic can't be attributed reliably, so your AI channel is a lower bound.
Do custom channel groups apply to past data?
Google says custom channel groups apply retroactively, so you can analyse historical traffic with the new definitions.
Are Google AI Overviews clicks in this channel?
No. Clicks from AI Overviews and AI Mode come from google.com and are counted as organic search. Use Search Console for those.