Sub topic 4
How GA4 Matches a Session to a Channel
This chapter assumes you know what sessions, users and events are in GA4, and that a URL can carry query parameters such as ?utm_medium=email. It also assumes you have seen source, medium and campaign in a standard report. Here you will learn how GA4 turns those three values into one channel name, and the errors that follow from the way the rules work.
The classification is a rule list, read top to bottom
The default channel group is a list of rules. Each rule names a channel and a condition on source, medium, campaign and sometimes the source category. GA4 checks a session against the rules in a fixed order. The first rule whose condition is true decides the channel, and GA4 stops checking.
Two consequences follow:
- A session gets exactly one channel. It cannot be counted in both Email and Paid Search.
- Order matters. If two rules could both match, the one earlier in the list wins.
If no rule matches, the session is labeled Unassigned. That outcome is covered in its own chapter. Here, treat it as the result of "nothing matched."
What the rules read
Each rule reads some of these values for the session:
- Source: where the visit came from, such as
google,newsletterorpartner-site.com. - Medium: the kind of traffic, such as
cpc,email,organicorreferral. - Campaign: the campaign name, such as
spring_sale_2026. - Source category: a label GA4 gives to a known source, such as SOURCECATEGORYSEARCH or SOURCECATEGORYSOCIAL. GA4 looks the source up in an internal list. You cannot edit that list.
- Whether the click was tagged by Google Ads auto-tagging or came with a Google Ads click ID. Auto-tagging is covered in a later chapter.
The values come from the session's first attributed event. They arrive in one of three ways:
- UTM parameters on the landing page URL.
- Google Ads auto-tagging, which GA4 reads from the click ID.
- Defaults GA4 derives itself, such as the referring domain from the browser's referrer, or
(direct)and(none)when there is no referrer.
Explicit tagging takes priority over what GA4 infers. A landing URL with utm_medium=email is treated as email even if the visitor came from a webmail site that would otherwise look like a referral.
A worked pair of URLs
These two links point to the same page but belong to different channels.
https://www.example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale_2026The medium is email, so GA4 puts sessions from this link in the Email channel. The source newsletter is just a label you chose. It does not affect the channel here.
https://www.example.com/spring-sale?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale_2026The source is a known search site and the medium is cpc, a paid medium. GA4 treats this as Paid Search. If you changed only the medium to organic, the same source would give Organic Search. The medium is the field that decides paid versus unpaid.
The rule order in practice
The default group has many channels, and the order of its rules is hard to memorize. The pattern is easier to remember in broad strokes:
- Direct is checked first. It requires source
(direct)and a medium of(none)or(not set). - Rules for specific paid and tagged traffic come next: Cross-network, Paid Shopping, Paid Search, Paid Social, Paid Video, Display, and similar.
- Organic rules follow: Organic Search, Organic Social, Organic Video, Organic Shopping.
- Email, Affiliates, Referral, Audio, SMS, Mobile Push Notifications and other medium-based rules fill in the rest.
- Anything left over is Unassigned.
The exact order in Google's table differs in places, and Google can change it. The principle holds: narrow, high-confidence rules come before broad ones. Referral, for example, is a broad catch-all for traffic that arrived from another site, so it must sit after the rules for search and social sites, or every search click would count as a referral.
A simplified model in code
This script models the idea with a short list of channels and search sites. It is not GA4's real logic. It shows how ordered checks produce one answer.
import re
SEARCH_SOURCES = {"google", "bing", "duckduckgo"}
PAID_MEDIUM = re.compile(r"^(.*cp.*|ppc|retargeting|paid.*)$")
def classify(source, medium):
source = (source or "").lower()
medium = (medium or "").lower()
if source == "(direct)" and medium in ("(none)", "(not set)"):
return "Direct"
if medium in ("email", "e-mail", "e_mail", "e mail"):
return "Email"
if source in SEARCH_SOURCES and PAID_MEDIUM.match(medium):
return "Paid Search"
if source in SEARCH_SOURCES or medium == "organic":
return "Organic Search"
if medium in ("referral", "app", "link"):
return "Referral"
return "Unassigned"
print(classify("google", "cpc"))
print(classify("newsletter", "email"))
print(classify("partner-site.com", "referral"))
print(classify("promo", "banner-x"))The output is:
Paid Search
Email
Referral
UnassignedNotice what the code shows:
googlewithcpcreturns Paid Search, because the paid check comes before the organic check. If you swapped those twoifstatements, every Google click would become Organic Search, because the organic rule accepts any search source.promowithbanner-xmatches nothing, so it falls to Unassigned. The source and medium were present. They were just not values any rule recognizes.
The paid pattern shows another detail. GA4's paid medium test is a regular expression on the medium value. A medium that contains cp (as in cpc, cpm, cpv) or starts with paid counts as paid. This is why a typo like cpcc still classifies as paid, while paidsearch and paid_search also work but ppc-search does not match the same way. The medium text is matched, not understood.
Matching is literal and mostly case-insensitive in practice
GA4 compares text. It does not interpret intent. The common effects are:
| What you wrote | What GA4 sees | Result |
|---|---|---|
| `utm_medium=email` | An exact medium match | |
| `utm_medium=newsletter` | A medium no default rule uses | Unassigned, unless another rule matches the source |
| `utm_medium=Email` | Same value, different capitalization | Usually treated as the same value for classification, but may appear as a separate row in some reports |
| `utm_medium=social` with source `facebook` | A social source with an unpaid medium | Organic Social |
| `utm_medium=paid_social` with source `facebook` | A social source with a paid medium | Paid Social |
| `utm_medium=banner` | No rule for banner | Unassigned |
Treat capitalization as a risk even when classification tolerates it. Use lowercase in every tag, so reports do not split one source across several rows.
Source and medium can disagree
The rules often need both fields to agree. Two cases catch people out.
- A paid medium on an unrecognized source. The medium
cpcwith sourcenewsletterdoes not match Paid Search, becausenewsletteris not a search site. Depending on the rules, it may land in Unassigned or in another paid channel such as Display. - A recognized source with an unrelated medium. A source of
googlewith mediumbannermatches no search rule, because the medium is neither paid nor organic.
When you build links, pick the medium first from the list the default group expects, then choose a source that fits.
Session scope and when the value is fixed
GA4 assigns the channel from the traffic source of the session's start. Later events in the same session do not change it. If a visitor lands from an organic search, then opens a tagged link in a new tab, GA4 starts a new session when the campaign changes, and that session has its own channel. The scope of the channel dimension, and the difference between session, first-user and event versions, has its own chapter.
Common errors
- Reordering your thinking. People assume "the campaign name says email, so it is email." The campaign name is not read by most default rules. The medium is.
- Tagging internal links. A UTM tag on a link inside your own site starts a new session and overwrites the real source. Use UTM tags only on links that point to your site from outside.
- Untagged paid links. Without UTM tags or auto-tagging, a paid click looks like a plain referral or direct visit, and it is classified that way.
- Assuming the list is permanent. Google adds and renames channels over time. A report built on one channel name can break when the definition changes.
Checking a classification yourself
To see why a session landed where it did, build a report with Session source / medium as a dimension, and Session default channel group as a second dimension. Each row pairs a source/medium with its channel. Find the row you doubt and read the pair. Then compare it against the rules above: was the medium recognized, did the source category match, was an earlier rule satisfied first?
Exercise
A link is tagged utm_source=google&utm_medium=organic&utm_campaign=autumn_launch, and the marketer expected it to be reported as Paid Search because the campaign was funded. Which channel will GA4 most likely assign, and what single change would move it to Paid Search?
Show answer
GA4 will most likely assign Organic Search, because the source is a search site and the medium is organic, which is an unpaid medium. The campaign name is not used to decide paid or unpaid. Changing utm_medium to a paid value such as cpc makes the paid rule match first, and the session goes to Paid Search.
Exercise
In the Python model, you move the Organic Search check above the Paid Search check. What does classify("google", "cpc") return, and what does this show about rule order?
Show answer
It returns Organic Search. The organic rule accepts any search source, so it matches before the paid rule gets a turn. Because the first matching rule wins, a broad rule placed before a narrow one hides the narrow one.
Exercise
A team tags a banner ad with utm_source=partnerbanner&utm_medium=banner&utm_campaign=q4. Sessions show as Unassigned. Give two ways to fix the tagging so the traffic lands in a named channel.
Show answer
Use a medium the default rules recognize, for example display or cpm for the Display channel, or referral if you want it counted as Referral. Alternatively, create a custom channel group with a rule that matches medium banner, which is covered in a later chapter. The first option fixes the data at the source, so it is usually preferred.