GA4 Custom Channel Grouping Regex — Conditions, Order & 8 Patterns
A custom channel group is the only place in GA4 where you decide what a channel means — and its conditions are written in regex. This guide shows where the regex condition lives in the UI, why the order of channels decides your numbers more than the pattern does, and gives you 8 patterns you can paste today, each testable before you save it.
TL;DR: Admin → Data display → Channel groups → copy the default group → edit a channel → Add condition group → dimension + matches regex (or partially matches regex, which is offered here). The first matching channel wins, so put narrow rules above broad ones. GA4 regex is full-match and case sensitive by default — wrap with .* or use (?i) when needed.
What custom channel groups are (and why regex is involved)
GA4 ships a default channel group — the predefined buckets (Organic Search, Paid Search, Referral, Direct…) that classify every session from its source, medium and campaign values. That list is Google's definition and you cannot edit it. When your reporting needs buckets it doesn't have — brand vs non-brand search, AI assistants, partner links, internal traffic — you build a custom channel group instead: a copy of any existing group where you add, edit, reorder and delete channels.
Each channel is a rule, and each rule is one or more conditions combined with AND/OR. The dimensions you can test are:
| Condition dimension | Typical use |
|---|---|
| Source | Hostnames and platforms: facebook, chatgpt.com, your own domains |
| Medium | How the visit was tagged: cpc, organic, email, referral |
| Campaign name | Brand vs non-brand, seasonal and promo splits |
| Campaign ID | Exact campaign matching from your ad platform |
| Source platform | Distinguishing Google Ads from Google Ads / other buying platforms |
| Manual ad content | Creative-level splits carried in utm_content |
| Default channel group | Re-bucket traffic Google already classified (e.g. everything that landed in Referral) |
When the dimension's operator list includes a regex option, you are writing a regular expression — same engine semantics as the rest of GA4: RE2 syntax, full match by default, case sensitive.
Where to add the regex condition
- Admin → Data display → Channel groups (in older UI: Admin → Data Settings → Channel groups).
- Find the Default channel group row → Copy to create new. You must copy; the default group itself is read-only. Starting from a copy also keeps Google's definitions as your fallback.
- Name the group (e.g. Channels — 2026) and open a channel row → › → edit it, or click + Add channel for a new one.
- Inside the channel: + Add condition group → pick the dimension (Source, Medium, …) → in the match-type dropdown choose matches regex — and note that this surface also offers partially matches regex, which behaves like a contains test (see GA4 regex match types for how that differs from other screens).
- Combine multiple conditions with AND / OR, click Save channel, then Save group.
- To use it: open Traffic acquisition (or any compatible report) → dimension dropdown → Session custom channel group.
Limits on a standard property: 2 custom groups (360: 5) in addition to the default, up to 50 channels per group. Custom groups apply to your reports retroactively, so a group you create today also reclassifies historical sessions — check your baseline before comparing periods.
Regex syntax in channel-group conditions
Two operators can appear, and the difference matters more here than anywhere else in GA4, because a channel group is evaluated once per session, top to bottom:
| Match type | Behaviour | Pattern for “source contains facebook” |
|---|---|---|
| matches regex | Full match — the pattern must cover the whole value | .*facebook.* |
| partially matches regex | Substring match — pattern may occur anywhere | facebook |
| does not match regex / does not partially match regex | The inverse of each — for exclusion channels | .*(localhost|staging).* |
If your build only shows matches regex, assume full match and add the wildcards — they are harmless where partial is also available. Three more rules that bite in channel groups specifically:
- Case sensitivity —
Emailnever matchesemail. Either enumerate variants or use the inline flag:(?i)^(email|e-mail|newsletter)$. - Escape your dots —
x.comalso matchesx-comandxacom. Writex\.com. - RE2 only — no lookahead, lookbehind or backreferences in any GA4 regex surface. Exclusions are a separate channel with a negative pattern, not a negative lookahead. Full list with replacements: RE2 vs PCRE.
8 ready-made channel group patterns
Each row is one channel: the name GA4 will show, the dimension and operator to pick, and the pattern. The sample link loads the pattern into the on-site tester with a realistic source/medium value so you can see exactly what it catches — check it there before you paste it into the group.
1. Paid Search (medium + source)
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Medium | matches regex | ^(.*cp.*|ppc|paid.*)$ |
Try → |
| AND Source | matches regex | .*(google|bing|duckduckgo|yahoo|ecosia|yandex|baidu).* |
Try → |
The medium half mirrors Google's own default rule ^(.*cp.*|ppc|paid.*)$, so your custom Paid Search bucket agrees with the default one — important when you compare the two groupings side by side.
2. Paid Social
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Source | matches regex | .*(facebook|instagram|linkedin|twitter|pinterest|tiktok|reddit).* |
Try → |
| AND Medium | matches regex | ^(.*cp.*|ppc|paid.*)$ |
Try → |
3. Organic Social
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Source | matches regex | .*(facebook|instagram|linkedin|twitter|t\.co|reddit|pinterest|tiktok|quora).* |
Try → |
| OR Medium | matches regex | ^(social|social-network|social-media|sm)$ |
Try → |
Source values arrive fully qualified (l.facebook.com, t.co), which is why the source half is written in the partial-safe .*….* form even though GA4 full-matches.
4. Email
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Medium | matches regex | (?i)^(email|e-mail|e_mail|newsletter|crm)$ |
Try → |
The (?i) flag neutralises the single most common cause of Email falling into Unassigned: utm_medium=Email typed with a capital E.
5. AI assistants
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Source | matches regex | .*(chatgpt|openai|perplexity|claude|gemini|copilot|deepseek|mistral|meta\.ai).* |
Try → |
Google added an AI Assistant default channel in 2026, so recognized assistants are bucketed automatically now. Keep this custom channel anyway to catch referrers Google hasn't added yet — and drag it above Referral, or the default Referral rule claims the visits first.
6. Internal traffic
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Source | matches regex | .*(localhost|127\.0\.0\.1|0\.0\.0\.0|staging|\.local|\.internal|dev\.).* |
Try → |
7. Affiliates & partners
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Medium | matches regex | ^(.*affiliate.*|partner|partners|referral-.*|ambassador)$ |
Try → |
| OR Campaign name | matches regex | .*(partner|affiliate|referral).* |
Try → |
Place this channel above the generic Referral channel, otherwise partner visits are reported as plain referrals.
8. Brand vs non-brand campaigns
| Dimension | Match type | Pattern | |
|---|---|---|---|
| Campaign name | matches regex | .*(brand|bv_|brand_).* |
Try → |
| OR Campaign name | does not partially match regex | .*(brand|bv_|brand_).* |
Try → |
Two channels, one pattern each: the positive rule catches brand traffic, the negative rule below it sends everything else to Non-brand. Remember the brand terms must reflect how your campaigns are actually named — check real values in the report first, don't guess.
5 common mistakes (and the fix)
- Wrong order — the big one. GA4 walks the channel list top to bottom and stops at the first match. A new AI or partner channel added at the bottom never fires because Referral already claimed the visit. Fix: click Reorder and drag narrow, specific rules above broad catch-alls (Referral, Direct, Unassigned).
- Writing partial patterns under full match.
googlealone matches nothing under matches regex unless the value is exactlygoogle. Fix: use partially matches regex where offered, or wrap:.*google.*. - Case slips.
Email,Facebook,CPCin your UTMs won't match lowercase rules — GA4 regex is case sensitive. Fix:(?i)at the front, or list the variants you actually see. - Unescaped dots in domains.
t.comatchest-co;x.commatchesxacom. Fix:t\.co,x\.com— and note.*is still the correct wildcard. - Editing the default group and finding nothing. The predefined group is read-only; your changes belong in a copy. Fix: Copy to create new, edit there, then switch the report's dimension to your group.
Before you hit Save group
- Narrow above broad — every custom channel sits above Referral/Direct.
- Patterns are full-match safe — wrapped in
.*….*or anchored with^…$. - Case handled —
(?i)or explicit variants. - Dots escaped in every hostname.
- Tested with real values — paste 5–10 actual source/medium strings into the tester first.
- An Other/Unassigned fallback kept — so unmatched traffic stays visible instead of vanishing.
FAQ
Where do I add a regex condition in a GA4 custom channel group?
Admin → Data display → Channel groups → copy the default group → open or add a channel → + Add condition group → choose a dimension (Source, Medium, Campaign name…) → set the operator to matches regex. This surface also offers partially matches regex, which works like contains.
Does the order of channels matter?
Yes — GA4 assigns each session to the first channel whose definition it matches, top to bottom. A broad rule above a narrow one hides it completely. Put specific channels (AI, partners, brand) above generic ones (Referral, Paid Search).
Is regex in channel groups case sensitive?
Yes. utm_medium=Email will not match a rule written for email. Lead with the inline flag — (?i)^(email|newsletter)$ — or enumerate the case variants you see in your data.
How many custom channel groups can I create?
Two on a standard property (five on GA4 360), each with up to 50 channels, in addition to the predefined default group. Custom groups reclassify historical data retroactively.
Do I still need an AI channel now that GA4 has a default AI Assistant channel?
For recognized assistants, no — Google classifies them automatically. A custom regex channel still adds value for platforms Google hasn't recognized yet, and for splitting AI traffic (chat vs search vs coding tools) beyond one bucket.
Why is my new channel showing zero sessions?
Almost always order: a rule above it already matches those sessions. Second most likely: the pattern is written for partial match but the condition is set to full-match matches regex. Reorder first, then re-test the pattern against real values in the tester.
Pattern syntax in detail lives in the GA4 regex match types guide. Ready-made patterns for paths, events and sources are in the GA4 regex cheat sheet, path rules in the page path regex guide, event rules in the event filter regex guide, and engine limits in RE2 vs PCRE.