Advertisement

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 dimensionTypical use
SourceHostnames and platforms: facebook, chatgpt.com, your own domains
MediumHow the visit was tagged: cpc, organic, email, referral
Campaign nameBrand vs non-brand, seasonal and promo splits
Campaign IDExact campaign matching from your ad platform
Source platformDistinguishing Google Ads from Google Ads / other buying platforms
Manual ad contentCreative-level splits carried in utm_content
Default channel groupRe-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

  1. Admin → Data display → Channel groups (in older UI: Admin → Data Settings → Channel groups).
  2. 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.
  3. Name the group (e.g. Channels — 2026) and open a channel row → › → edit it, or click + Add channel for a new one.
  4. 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).
  5. Combine multiple conditions with AND / OR, click Save channel, then Save group.
  6. 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 typeBehaviourPattern 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:

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)

DimensionMatch typePattern
Mediummatches regex ^(.*cp.*|ppc|paid.*)$ Try →
AND Sourcematches 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

DimensionMatch typePattern
Sourcematches regex .*(facebook|instagram|linkedin|twitter|pinterest|tiktok|reddit).* Try →
AND Mediummatches regex ^(.*cp.*|ppc|paid.*)$ Try →

3. Organic Social

DimensionMatch typePattern
Sourcematches regex .*(facebook|instagram|linkedin|twitter|t\.co|reddit|pinterest|tiktok|quora).* Try →
OR Mediummatches 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

DimensionMatch typePattern
Mediummatches 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

DimensionMatch typePattern
Sourcematches 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

DimensionMatch typePattern
Sourcematches regex .*(localhost|127\.0\.0\.1|0\.0\.0\.0|staging|\.local|\.internal|dev\.).* Try →

7. Affiliates & partners

DimensionMatch typePattern
Mediummatches regex ^(.*affiliate.*|partner|partners|referral-.*|ambassador)$ Try →
OR Campaign namematches 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

DimensionMatch typePattern
Campaign namematches regex .*(brand|bv_|brand_).* Try →
OR Campaign namedoes 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.

Test the pattern before it decides your numbers
Load any pattern above with its sample value, swap in your real source/medium/campaign strings, and confirm the match list — then paste it into the channel condition.
Open the regex tester →

5 common mistakes (and the fix)

  1. 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).
  2. Writing partial patterns under full match. google alone matches nothing under matches regex unless the value is exactly google. Fix: use partially matches regex where offered, or wrap: .*google.*.
  3. Case slips. Email, Facebook, CPC in your UTMs won't match lowercase rules — GA4 regex is case sensitive. Fix: (?i) at the front, or list the variants you actually see.
  4. Unescaped dots in domains. t.co matches t-co; x.com matches xacom. Fix: t\.co, x\.com — and note .* is still the correct wildcard.
  5. 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

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.