GA4 regex for AI traffic: ChatGPT, Perplexity, Gemini and more
Pick the AI assistants to count and copy a ready regex for the Session source in Google Analytics 4. Add it to a custom channel group above Referral, or use it as an exploration filter, to see visits from ChatGPT, Perplexity, Gemini, Copilot and Claude in one line.
Optional. Other AI tools as GA4 shows them in Session source, one per line, for example poe.com. Subdomains are included.
Runs in your browser. Nothing you type is sent or stored.
Check that AI bots can reach your siteResult
ReadyYour GA4 regex is ready
319 characters, RE2 syntax accepted by GA4
Type a value from the Session source column, for example chatgpt.com.
Paste it into a channel group condition (Source matches regex) or an exploration filter. The steps are below.
Add the regex to GA4
Google renames and moves GA4 menus from time to time, so the labels in your property may differ slightly from the ones below. Look for the closest match; the settings themselves stay the same.
Option 1: a custom channel group
Recommended. AI visits get their own row in the standard acquisition reports, next to Organic Search and Referral.
Open channel groups
Click Admin (the gear icon at the bottom left). Under Data display, choose Channel groups. You need edit access to the property.
Create a new group
Click Create new channel group and give it a name, such as Channels with AI. A new group usually starts with a copy of the default channels; if yours starts empty, copy the default group instead.
Add an AI assistants channel
Click Add new channel and name it AI assistants. Add one condition: Source (in some properties, Session source), then matches regex, then paste the regex. Save the channel.
Move it above Referral
Choose Reorder and drag AI assistants above Referral. GA4 puts each visit in the first channel whose rules match, so a channel below Referral would never receive these visits. Save the group.
Use it in reports
Open Reports, then Acquisition, then Traffic acquisition. Click the drop-down on the first column header of the table, which shows the default channel group, and pick your new group. Custom channel groups also apply to past data.
Option 2: a quick exploration filter
No admin changes needed. Good for a one-off look or when you cannot edit channel groups.
Start a blank exploration
Open Explore, choose Blank and set the date range you want to look at.
Add dimensions and metrics
Import Session source and Landing page as dimensions, and Sessions, Engaged sessions and Key events as metrics. Drag them into Rows and Values.
Filter by the regex
Under Filters, choose Session source, then matches regex, paste the pattern and apply. Only AI assistant sources remain. Standard reports accept the same filter where the matches regex option is offered.
What the numbers mean
- It is a floor. Many AI assistant visits arrive without a referrer, for example links opened from a desktop or mobile app or copied into a new tab, and GA4 counts them as Direct.
- Some assistants add utm_source=chatgpt.com or a similar tag to their links. GA4 then records the tag as the source, which this pattern also matches.
- Sources are matched in lower case, the way GA4 records referring domains. If you tag your own links, use lower-case utm_source values.
- New assistants appear often. Add them under Extra sources until they are part of this list.
How it works
Choose the assistants
Every AI assistant we track is selected. Clear the ones you do not want, and add other AI tools by the domain GA4 shows in the Session source column.
Copy the regex
The pattern matches each assistant’s domain with or without www. or another subdomain, plus short source names GA4 sometimes records, such as chatgpt. Lookalike domains do not match.
Add it to GA4
Create a custom channel group with an AI assistants channel placed above Referral, or filter an exploration by Session source. Both are explained step by step below the tool.
Frequently asked questions
Measure AI traffic without the setup
Connect GA4 in Citeto to see visits from each AI assistant next to traffic of unknown source, for every site in your workspace.
Sign in to Citeto