Sub topic 2
Naming conventions that keep reports clean
This chapter assumes you know how URLs and query strings work, that your GA4 property has the web data stream installed, and that you can open the acquisition reports.
Naming conventions
A campaign name should be consistent across every link. Pick one style, such as lowercase words joined by underscores, and apply it to every utm_ value. Keep a shared list of allowed utm_medium values, such as email, cpc, social, and referral, so teammates do not invent new ones.
Normalize values in code so people do not have to remember the rules:
import re
def normalize(value: str) -> str:
"""Lowercase, trim, and replace runs of spaces or hyphens with underscores."""
return re.sub(r"[\s\-]+", "_", value.strip().lower())
print(normalize(" Spring Sale-2026 ")) # spring_sale_2026How GA4 turns UTM values into dimensions
When a visit starts with utm_source=newsletter, GA4 records the session source as newsletter. The utm_medium value becomes the session medium, and utm_campaign becomes the session campaign. Each distinct value is its own row in reports. A visit with no UTM values is reported as (not set).
From source and medium to channel groups
GA4 combines the source and medium into a default channel group. The medium carries most of the signal. The table shows typical results, but check the current GA4 channel definitions for your property because they can change.
| utm_medium | Typical default channel group |
|---|---|
| cpc | Paid Search |
| paid_social | Paid Social |
| social | Organic Social |
| referral | Referral |
Exercise
What does normalize(" Summer Promo-Email ") return, using the helper from this chapter?
Show answer
summerpromoemail. The function trims the spaces, lowercases the text, and replaces each run of spaces or hyphens with one underscore.