Tutorial · Practitioner
GA4 Custom Channel Group for AI Referrals
To separate AI referrals in GA4, create a custom channel group, add a channel called "AI assistants" whose Source matches a regex of AI assistant domains, and move it above Referral so those visits aren't absorbed first. Google documents this exact pattern (Google Analytics Help). It takes about 15 minutes and applies to historical data too.
Key takeaways
- Custom channel groups live in Admin → Data display → Channel groups.
- Standard properties get 2 custom groups, each with up to 50 channels.
- Channel order matters: put AI assistants above Referral.
- Tighten Google's example regex; it can match unrelated sources.
What do you need before you start?
| Requirement | Why |
|---|---|
| Editor (or higher) role on the GA4 property | Needed to create channel groups |
| A list of AI sources you see today | Check Traffic acquisition → Session source |
| A free custom group slot | Standard properties allow 2 groups in addition to the predefined one (Google) |
First, look at what's arriving. In Reports → Acquisition → Traffic acquisition, switch the primary dimension to Session source and search for chatgpt, perplexity, gemini, copilot and claude. Note the exact source values, for example chatgpt.com or perplexity.ai. Your list is the basis for your regex.
Step 1: How do you create the channel group?
- Go to Admin → Data display → Channel groups.
- Click Create new channel group.
- Name it, for example "Channels with AI".
- GA4 starts with a copy of the default channels. Keep them, so all other traffic stays classified as usual.
Step 2: How do you add the AI assistants channel?
- Click Add new channel and name it "AI assistants".
- Add a condition: Source → matches regex.
- Paste your regex (see below) and save the channel.
Google's example regex is:
^.*ai|.*\.openai.*|.*chatgpt.*|.*gemini.*|.*gpt.*|.*copilot.*|.*perplexity.*|.*google.*bard.*|.*bard.*google.*|.*bard.*|.*.*gemini.*google.*$Be careful: the first part, ^.*ai, matches any source containing "ai", such as mail.google.com or email. A tighter version based on explicit domains:
^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai)$Illustrative. Replace these with the exact source values you found before Step 1; sources appear differently depending on referrer and UTM tagging.
Step 3: Why does channel order matter?
GA4 evaluates channels top to bottom and assigns a session to the first match. Referral matches almost any linked visit, so if it comes first, AI visits are labelled Referral. Google's instructions say to move "AI assistants" above "Referrals", and optionally above other channels such as Organic Search (Google). Drag the channel up, then save the group.
Step 4: How do you read the report?
- Open Reports → Acquisition → Traffic acquisition.
- Change the primary dimension to your new channel group.
- Add Session source as a secondary dimension to see which assistants drive visits.
Useful columns: sessions, engaged sessions, engagement rate, key events and key event rate. Compare AI assistants against Organic Search and Referral.
How do you test your regex?
Before saving, test it against real values:
| Source value | Should match? | Matches tight regex? |
|---|---|---|
| chatgpt.com | Yes | Yes |
| perplexity.ai | Yes | Yes |
| mail.google.com | No | No |
| gemini.google.com | Yes | Yes |
| news.ycombinator.com | No | No |
You can paste your regex and these test strings into any regex tester using RE2-compatible syntax. GA4's regex matching uses RE2.
What will this not capture?
| Gap | Why | What to do |
|---|---|---|
| Users who read an AI answer, then search your brand | Arrives as Organic Search | Track branded search trends alongside |
| Users who type your URL | Arrives as Direct | Ask "How did you hear about us?" (self-reported attribution) |
| Apps that strip referrers | No source passed | Accept the gap; trend over time |
| New assistants | Not in your regex | Review sources monthly |
Google also notes you should update the regex when URLs or assistants change (Google).
How do you go deeper with explorations?
Standard reports show volume; explorations answer "which pages?" Create a free-form exploration with your custom channel group and Landing page + query string as rows, filtered to AI assistants. Add sessions and key events as values. This shows which pages AI users arrive on, often a short list, and tells you which pages to keep especially accurate and current. Google notes custom channel groups are also available in explorations and audience conditions (Google), so you can build an audience of AI-referred visitors for later analysis.
Should you make it the primary channel group?
You can set any custom group as your property's primary channel group in Admin → Channel groups (Google). That makes the AI channel visible in standard reports for everyone, but it changes the definition other teams rely on. Agree with stakeholders first; many teams keep it as a secondary custom group until the definition is stable.
Worked example
Illustrative, not real data. A B2B SaaS site creates the group and sees, over 90 days, 1,900 sessions in AI assistants versus 41,000 in Organic Search. AI sessions have a higher key event rate on demo requests. The team doesn't claim AI is "worth" a fixed amount; instead it adds AI assistants to its monthly dashboard and checks which landing pages receive these sessions, discovering most land on comparison pages.
Common mistakes
- Leaving AI assistants below Referral.
- Using an over-broad regex and inflating numbers.
- Editing the default channel group without telling other teams.
- Treating AI referral sessions as the total effect of AI search.
Checklist
- [ ] AI source values collected from Traffic acquisition
- [ ] Custom channel group created with default channels preserved
- [ ] AI assistants channel added with tested regex
- [ ] Channel moved above Referral
- [ ] Report saved and regex reviewed monthly
Where to go next
Sources
- Google Analytics Help, Custom channel groups
Questions
Does GA4 have an AI channel by default?
Not in the default channel group. Google documents how to add an "AI assistants" channel in a custom channel group.
Do custom channel groups apply to past data?
Yes. Google says custom channel groups can be applied to reports retroactively.
Will this capture all AI-influenced visits?
No. It only captures visits with a referrer or source matching your rules. Many AI-influenced visits arrive as direct or branded search.