AI referral traffic in GA4
Track AI referral traffic with a GA4 source filter. Choose assistants, test the regex against your source list and copy it into your report.
GA4 source regex
^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)$253 characters. Limit: 1,024.
Use Source in the channel condition and Session source in reports or explorations. Full URLs must be normalized before applying this source pattern.
Test your own sources
Pasted sources stay in this browser. No upload.
To track AI referral traffic in GA4, create a custom channel group with a source regex for the assistants you select. Place the channel above Referral and inspect it in Traffic acquisition. This tool builds the pattern and tests source rows locally. Missing referrers cannot be recovered from Direct traffic.
Set up your GA4 channel
GA4 now documents an AI Assistant default channel. Check Traffic acquisition with Session default channel group first. Use a custom group when you want to choose the sources included. Google default channel documentation
- In GA4, open Admin. Under Data display, choose Channel groups. You need the Editor role or higher.
- Choose Create new channel group to copy the default group. Give your copy a name.
- Add a new channel named AI assistants. Add a condition group, choose Source, then matches regex. Paste the source regex from this tool and save the channel.
- Choose Reorder. Place AI assistants above Referral, the default AI Assistant channel and any other channel that could match these sources. Apply the order and save the group.
- Open Reports, Acquisition, Traffic acquisition. Choose the session version of your custom channel group as the dimension and read the Sessions column.
GA4 setup steps
1. In GA4, open Admin. Under Data display, choose Channel groups. You need the Editor role or higher.
2. Choose Create new channel group to copy the default group. Give your copy a name.
3. Add a new channel named AI assistants. Add a condition group, choose Source, then matches regex. Paste the source regex from this tool and save the channel.
4. Choose Reorder. Place AI assistants above Referral, the default AI Assistant channel and any other channel that could match these sources. Apply the order and save the group.
5. Open Reports, Acquisition, Traffic acquisition. Choose the session version of your custom channel group as the dimension and read the Sessions column.
Source regex: ^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)$Custom channel groups apply retroactively to GA4 reports and explorations. They cannot recover a missing source. Changing the primary channel group affects future data; audience changes are also forward-looking. Google channel group documentation
Use an Exploration for historical sources
Exploration filter and steps
In Explore, create a Free form exploration. Import Session source and Sessions. Add Session source to Rows and Sessions to Values. Add a filter: Session source matches regex. Paste this case-insensitive pattern and choose your date range.
(?i)^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)$Explorations can show only the historical data GA4 has retained. Source rows are not a way to reconstruct untracked visits.
Landing pages and key events
In Explore, create a Free form exploration. Under Segments, create a session segment named AI assistants with one condition: Session source matches regex. Paste this case-insensitive pattern.
(?i)^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)$
Import Landing page + query string, Session source, Sessions and Key events. Apply the segment. Add Landing page + query string and Session source to Rows, and Sessions and Key events to Values. Mark the events that matter as key events in Admin first.The segment keeps whole sessions from these sources, so the table shows where AI visitors start and which of those sessions reach a key event.
Use the sources in other reports
Looker Studio: split traffic by assistant
Add a calculated field to your GA4 data source. Use the Session source field, not Session source / medium. The formula uses raw strings to preserve escaped dots.
Looker Studio formula
CASE
WHEN REGEXP_MATCH(LOWER(Session source), R"^(chatgpt\.com|chat\.openai\.com)$") THEN "ChatGPT"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(perplexity\.ai|www\.perplexity\.ai)$") THEN "Perplexity"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(gemini\.google\.com)$") THEN "Gemini"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(copilot\.microsoft\.com|copilot\.com)$") THEN "Microsoft Copilot"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(claude\.ai)$") THEN "Claude"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(chat\.deepseek\.com)$") THEN "DeepSeek"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(grok\.com)$") THEN "Grok"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(meta\.ai|www\.meta\.ai)$") THEN "Meta AI"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(chat\.mistral\.ai)$") THEN "Mistral Le Chat (now Vibe)"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(you\.com)$") THEN "You.com"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(phind\.com|www\.phind\.com)$") THEN "Phind"
WHEN REGEXP_MATCH(LOWER(Session source), R"^(poe\.com)$") THEN "Poe"
ELSE "Other"
ENDBigQuery: sessions and users from the GA4 export
For a property linked to BigQuery. The query reads the referrer and address of each page view, counts sessions and users per assistant and divides by all sessions with a page view. Replace the table name and the dates.
BigQuery query
WITH views AS (
SELECT
user_pseudo_id,
(SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS session_id,
LOWER((SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_referrer')) AS referrer,
LOWER((SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location')) AS location
FROM `your-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260901' AND '20260930'
AND event_name = 'page_view'
),
tagged AS (
SELECT
user_pseudo_id,
CONCAT(user_pseudo_id, '.', CAST(session_id AS STRING)) AS session_key,
CASE
WHEN NET.HOST(referrer) IN ('chatgpt.com', 'chat.openai.com') THEN 'ChatGPT'
WHEN NET.HOST(referrer) IN ('perplexity.ai', 'www.perplexity.ai') THEN 'Perplexity'
WHEN NET.HOST(referrer) IN ('gemini.google.com') THEN 'Gemini'
WHEN NET.HOST(referrer) IN ('copilot.microsoft.com', 'copilot.com') THEN 'Microsoft Copilot'
WHEN NET.HOST(referrer) IN ('claude.ai') THEN 'Claude'
WHEN NET.HOST(referrer) IN ('chat.deepseek.com') THEN 'DeepSeek'
WHEN NET.HOST(referrer) IN ('grok.com') THEN 'Grok'
WHEN NET.HOST(referrer) IN ('meta.ai', 'www.meta.ai') THEN 'Meta AI'
WHEN NET.HOST(referrer) IN ('chat.mistral.ai') THEN 'Mistral Le Chat (now Vibe)'
WHEN NET.HOST(referrer) IN ('you.com') THEN 'You.com'
WHEN NET.HOST(referrer) IN ('phind.com', 'www.phind.com') THEN 'Phind'
WHEN NET.HOST(referrer) IN ('poe.com') THEN 'Poe'
WHEN REGEXP_CONTAINS(location, r'[?&]utm_source=(chatgpt\.com)(&|#|$)') THEN 'ChatGPT'
END AS assistant
FROM views
),
everyone AS (
SELECT COUNT(DISTINCT session_key) AS sessions FROM tagged
)
SELECT
assistant,
COUNT(DISTINCT session_key) AS sessions,
COUNT(DISTINCT user_pseudo_id) AS users,
ROUND(COUNT(DISTINCT session_key) / ANY_VALUE(everyone.sessions), 4) AS share_of_sessions
FROM tagged CROSS JOIN everyone
WHERE assistant IS NOT NULL
GROUP BY assistant
ORDER BY sessions DESCServer logs: count AI visits with grep and awk
For the combined log format, the default in Nginx and Apache. Logs also show visits that analytics misses, such as visitors who block scripts. Replace access.log with your file; for rotated files, pipe zcat -f access.log* into the same command instead.
Log commands
# Visits whose referrer is one of the selected assistants
grep -ciE '"https?://(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)([/?#][^"]*)?"' access.log
# Visits per assistant hostname, and per documented UTM source
awk -F'"' '{ ref = tolower($4) } ref ~ /^https?:\/\/(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)([\/?#]|$)/ { split(ref, u, "/"); print u[3]; next } tolower($2) ~ /[?&]utm_source=(chatgpt\.com)([& ]|$)/ { print "utm_source" }' access.log | sort | uniq -c | sort -rn
# Pages those visits landed on
awk -F'"' '{ ref = tolower($4) } ref ~ /^https?:\/\/(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)([\/?#]|$)/ || tolower($2) ~ /[?&]utm_source=(chatgpt\.com)([& ]|$)/ { split($2, r, " "); print r[2] }' access.log | sort | uniq -c | sort -rn | head -20Visits without a referrer, such as pages an assistant fetches while it answers, do not show here. The AI crawler log analyzer counts requests by AI user agent instead. Open the AI crawler log analyzer
Plausible: filter Sources
Plausible Sources uses an is filter with multiple selected values. It does not accept a GA4 regex. Select the names or domains that appear in your Sources report from this candidate list. Plausible also has an AI Assistants channel.
Plausible source candidates
ChatGPT
chatgpt.com
chat.openai.com
Perplexity
perplexity.ai
www.perplexity.ai
Gemini
gemini.google.com
Microsoft Copilot
copilot.microsoft.com
copilot.com
Claude
claude.ai
DeepSeek
chat.deepseek.com
Grok
grok.com
Meta AI
meta.ai
www.meta.ai
Mistral Le Chat (now Vibe)
chat.mistral.ai
You.com
you.com
Phind
phind.com
www.phind.com
Poe
poe.comMatomo: segment by referrer URL
Matomo standard segments use equals and starts with conditions, joined with OR. This segment covers HTTP and HTTPS URLs on the selected hosts. It does not include visits identified only by a campaign tag. Copy the string as the segment parameter value in a Reporting API request; let your HTTP client encode that parameter once more.
Matomo referrer URL segment
referrerUrl==https%3A%2F%2Fchatgpt.com,referrerUrl=^https%3A%2F%2Fchatgpt.com%2F,referrerUrl=^https%3A%2F%2Fchatgpt.com%3F,referrerUrl==http%3A%2F%2Fchatgpt.com,referrerUrl=^http%3A%2F%2Fchatgpt.com%2F,referrerUrl=^http%3A%2F%2Fchatgpt.com%3F,referrerUrl==https%3A%2F%2Fchat.openai.com,referrerUrl=^https%3A%2F%2Fchat.openai.com%2F,referrerUrl=^https%3A%2F%2Fchat.openai.com%3F,referrerUrl==http%3A%2F%2Fchat.openai.com,referrerUrl=^http%3A%2F%2Fchat.openai.com%2F,referrerUrl=^http%3A%2F%2Fchat.openai.com%3F,referrerUrl==https%3A%2F%2Fperplexity.ai,referrerUrl=^https%3A%2F%2Fperplexity.ai%2F,referrerUrl=^https%3A%2F%2Fperplexity.ai%3F,referrerUrl==http%3A%2F%2Fperplexity.ai,referrerUrl=^http%3A%2F%2Fperplexity.ai%2F,referrerUrl=^http%3A%2F%2Fperplexity.ai%3F,referrerUrl==https%3A%2F%2Fwww.perplexity.ai,referrerUrl=^https%3A%2F%2Fwww.perplexity.ai%2F,referrerUrl=^https%3A%2F%2Fwww.perplexity.ai%3F,referrerUrl==http%3A%2F%2Fwww.perplexity.ai,referrerUrl=^http%3A%2F%2Fwww.perplexity.ai%2F,referrerUrl=^http%3A%2F%2Fwww.perplexity.ai%3F,referrerUrl==https%3A%2F%2Fgemini.google.com,referrerUrl=^https%3A%2F%2Fgemini.google.com%2F,referrerUrl=^https%3A%2F%2Fgemini.google.com%3F,referrerUrl==http%3A%2F%2Fgemini.google.com,referrerUrl=^http%3A%2F%2Fgemini.google.com%2F,referrerUrl=^http%3A%2F%2Fgemini.google.com%3F,referrerUrl==https%3A%2F%2Fcopilot.microsoft.com,referrerUrl=^https%3A%2F%2Fcopilot.microsoft.com%2F,referrerUrl=^https%3A%2F%2Fcopilot.microsoft.com%3F,referrerUrl==http%3A%2F%2Fcopilot.microsoft.com,referrerUrl=^http%3A%2F%2Fcopilot.microsoft.com%2F,referrerUrl=^http%3A%2F%2Fcopilot.microsoft.com%3F,referrerUrl==https%3A%2F%2Fcopilot.com,referrerUrl=^https%3A%2F%2Fcopilot.com%2F,referrerUrl=^https%3A%2F%2Fcopilot.com%3F,referrerUrl==http%3A%2F%2Fcopilot.com,referrerUrl=^http%3A%2F%2Fcopilot.com%2F,referrerUrl=^http%3A%2F%2Fcopilot.com%3F,referrerUrl==https%3A%2F%2Fclaude.ai,referrerUrl=^https%3A%2F%2Fclaude.ai%2F,referrerUrl=^https%3A%2F%2Fclaude.ai%3F,referrerUrl==http%3A%2F%2Fclaude.ai,referrerUrl=^http%3A%2F%2Fclaude.ai%2F,referrerUrl=^http%3A%2F%2Fclaude.ai%3F,referrerUrl==https%3A%2F%2Fchat.deepseek.com,referrerUrl=^https%3A%2F%2Fchat.deepseek.com%2F,referrerUrl=^https%3A%2F%2Fchat.deepseek.com%3F,referrerUrl==http%3A%2F%2Fchat.deepseek.com,referrerUrl=^http%3A%2F%2Fchat.deepseek.com%2F,referrerUrl=^http%3A%2F%2Fchat.deepseek.com%3F,referrerUrl==https%3A%2F%2Fgrok.com,referrerUrl=^https%3A%2F%2Fgrok.com%2F,referrerUrl=^https%3A%2F%2Fgrok.com%3F,referrerUrl==http%3A%2F%2Fgrok.com,referrerUrl=^http%3A%2F%2Fgrok.com%2F,referrerUrl=^http%3A%2F%2Fgrok.com%3F,referrerUrl==https%3A%2F%2Fmeta.ai,referrerUrl=^https%3A%2F%2Fmeta.ai%2F,referrerUrl=^https%3A%2F%2Fmeta.ai%3F,referrerUrl==http%3A%2F%2Fmeta.ai,referrerUrl=^http%3A%2F%2Fmeta.ai%2F,referrerUrl=^http%3A%2F%2Fmeta.ai%3F,referrerUrl==https%3A%2F%2Fwww.meta.ai,referrerUrl=^https%3A%2F%2Fwww.meta.ai%2F,referrerUrl=^https%3A%2F%2Fwww.meta.ai%3F,referrerUrl==http%3A%2F%2Fwww.meta.ai,referrerUrl=^http%3A%2F%2Fwww.meta.ai%2F,referrerUrl=^http%3A%2F%2Fwww.meta.ai%3F,referrerUrl==https%3A%2F%2Fchat.mistral.ai,referrerUrl=^https%3A%2F%2Fchat.mistral.ai%2F,referrerUrl=^https%3A%2F%2Fchat.mistral.ai%3F,referrerUrl==http%3A%2F%2Fchat.mistral.ai,referrerUrl=^http%3A%2F%2Fchat.mistral.ai%2F,referrerUrl=^http%3A%2F%2Fchat.mistral.ai%3F,referrerUrl==https%3A%2F%2Fyou.com,referrerUrl=^https%3A%2F%2Fyou.com%2F,referrerUrl=^https%3A%2F%2Fyou.com%3F,referrerUrl==http%3A%2F%2Fyou.com,referrerUrl=^http%3A%2F%2Fyou.com%2F,referrerUrl=^http%3A%2F%2Fyou.com%3F,referrerUrl==https%3A%2F%2Fphind.com,referrerUrl=^https%3A%2F%2Fphind.com%2F,referrerUrl=^https%3A%2F%2Fphind.com%3F,referrerUrl==http%3A%2F%2Fphind.com,referrerUrl=^http%3A%2F%2Fphind.com%2F,referrerUrl=^http%3A%2F%2Fphind.com%3F,referrerUrl==https%3A%2F%2Fwww.phind.com,referrerUrl=^https%3A%2F%2Fwww.phind.com%2F,referrerUrl=^https%3A%2F%2Fwww.phind.com%3F,referrerUrl==http%3A%2F%2Fwww.phind.com,referrerUrl=^http%3A%2F%2Fwww.phind.com%2F,referrerUrl=^http%3A%2F%2Fwww.phind.com%3F,referrerUrl==https%3A%2F%2Fpoe.com,referrerUrl=^https%3A%2F%2Fpoe.com%2F,referrerUrl=^https%3A%2F%2Fpoe.com%3F,referrerUrl==http%3A%2F%2Fpoe.com,referrerUrl=^http%3A%2F%2Fpoe.com%2F,referrerUrl=^http%3A%2F%2Fpoe.com%3FFor a report system that supports URL regex, use this separate URL pattern. It is not a Matomo segment operator.
Referrer URL regex
^https?://(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|copilot\.com|claude\.ai|chat\.deepseek\.com|grok\.com|meta\.ai|www\.meta\.ai|chat\.mistral\.ai|you\.com|phind\.com|www\.phind\.com|poe\.com)([/?#].*)?$What AI referral numbers can show
- Why AI visits can appear as Direct
- Apps and copied links can lose the referrer. Without a referrer or a campaign tag, analytics may classify the visit as Direct. This pattern cannot tell which assistant sent a visit once that information is missing.
- What the matches tell you
- A match identifies a source value from the selected list. The tester counts source rows, not visits or sessions. Use the Sessions metric in GA4 for traffic totals. A source does not prove a recommendation, and campaign tags can be copied or set by anyone.
- What the list covers
- The list uses product domains and documented UTM source values. Product domains show possible sources; they do not guarantee that every app sends a referrer. Shared domains such as google.com, bing.com and x.com are excluded because they also carry other traffic.
- Check what happens after the visit
- Compare AI sources with engaged sessions and key events in GA4. Referral traffic shows recorded clicks. To check whether assistants name your business, use the free AI visibility checker or compare the monitoring plans below.
Source list and evidence
Source list reviewed: 2026-10-10. Only ChatGPT has a documented UTM source in this list. Other UTM aliases are omitted.
- ChatGPT
- chatgpt.com (product domain)
- chat.openai.com (product domain)
- chatgpt.com (documented UTM source)
- Perplexity
- perplexity.ai (product domain)
- www.perplexity.ai (product domain)
- Gemini
- gemini.google.com (product domain)
- Microsoft Copilot
- copilot.microsoft.com (product domain)
- copilot.com (product domain)
- Claude
- claude.ai (product domain)
- DeepSeek
- chat.deepseek.com (product domain)
- Grok
- grok.com (product domain)
- Meta AI
- meta.ai (product domain)
- www.meta.ai (product domain)
- Mistral Le Chat (now Vibe)
- chat.mistral.ai (product domain)
- You.com
- you.com (product domain)
- Phind
- phind.com (product domain)
- www.phind.com (product domain)
- Poe
- poe.com (product domain)
Questions about AI referral traffic
See whether assistants name your business
Referral reports show clicks with a recorded source. The free visibility check examines the businesses assistants name in their answers.