Sub topic 4
Naming conventions that keep reports clean
This chapter assumes you know how a UTM-tagged URL is built and what utm_source, utm_medium and utm_campaign mean. Both were covered in the earlier chapters. It also assumes you can open the GA4 acquisition reports. Here you will decide what values go into those parameters, and how to keep them consistent across people, tools and years.
Why naming drift breaks reports
GA4 does not interpret what you meant. It stores the exact strings it receives and groups rows by exact match. These three links describe the same email campaign, but GA4 sees three different campaigns:
utm_campaign=spring_sale_2026utm_campaign=Spring_Sale_2026utm_campaign=spring-sale-2026
The same happens with sources and mediums. If one marketer writes utm_medium=email and another writes utm_medium=Email or e-mail, you get separate rows in the Session source / medium report. Their totals will not add up in one place. The damage grows over time, because GA4 does not let you rename or merge values that are already collected.
Bad names also affect channel grouping. The default channel group is assigned by rules that test source and medium. A medium like newsletter matches no Email rule, so those sessions can land in Unassigned or in a different channel from the one you intended. The next chapters cover the channel rules in detail. For now, treat a medium value as a controlled vocabulary, not free text.
The core rules
Keep the rules short enough that people will remember them. These five cover most problems.
1. Use lowercase only
Lowercase removes the whole class of case mismatches. It also makes filters and regular expressions simpler, because you never need a case-insensitive flag.
2. Pick one separator
Choose either underscores or hyphens and never mix them. This tutorial uses underscores, so spring_sale_2026 is correct and spring-sale-2026 is not. Underscores are a good default. They are not a URL delimiter, they read well in report tables, and they match the helper function from the URL construction chapter, which replaces spaces with underscores.
3. Avoid spaces and special characters
A space in a URL becomes %20 or +. Some tools encode it one way and some the other, and an ampersand or equals sign inside a value will break the query string. Stick to a-z, 0-9 and the separator. Letting URLSearchParams do the encoding, as the helper did, protects you from malformed URLs. It does not protect you from messy values.
4. Never put personal data in a value
Do not use email addresses, names, phone numbers or user IDs in any UTM parameter. The URL appears in browser history, server logs and the referrer sent to other sites. Google's terms for Analytics also forbid sending personally identifiable information. If you need to tell recipients apart, use an anonymous campaign or segment name such as vip_segment.
5. Keep values short and stable
A name should stay readable in a report column and should not change meaning later. Describe what the campaign is, not who made it or when you sent it. Put the year or quarter in the campaign name only if the same promotion repeats and you need to compare editions.
Designing a controlled vocabulary
Each parameter gets a different level of control. A good scheme is strict where values drive reporting logic and loose where they only add detail.
| Parameter | Control level | Rule | Example values |
|---|---|---|---|
| `utm_medium` | Closed list | Only values from an approved list. It decides channel grouping. | `email`, `cpc`, `paid_social`, `social`, `affiliate`, `display`, `referral` |
| `utm_source` | Semi-closed list | The platform or sender, with one spelling per source. | `newsletter`, `google`, `facebook`, `linkedin`, `partner_acme` |
| `utm_campaign` | Pattern | A short name following a pattern, unique per initiative. | `spring_sale_2026`, `webinar_ga4_basics` |
| `utm_content` | Free within the format | Distinguishes links inside one campaign. | `hero_button`, `footer_link`, `variant_b` |
| `utm_term` | Free within the format | The paid keyword, when relevant. | `running_shoes` |
The medium list deserves the most care. Some of its values are matched by the default channel group rules, so a spelling that looks reasonable (e-mail, newsletter, paid-social) may still fall outside them. Check the current default channel group definition in the Google Analytics help center when you pick the list, and reuse the exact words GA4 expects. Pairing a source and medium that GA4 recognizes as paid or social matters too. For example, facebook with paid_social has a clearer meaning than facebook with ads.
Source should name the origin, not the tactic
Use newsletter or facebook as the source and leave the tactic to the medium. A value like facebook_ad_march mixes three ideas in one field. That makes it impossible to compare Facebook across months.
Campaign naming patterns
A pattern gives people a structure to fill in instead of a blank box. A simple one is theme_detail_year:
spring_sale_2026webinar_ga4_basics_2026black_friday_2026
Teams with many campaigns often prefer a pattern that also carries a number, such as cmp1042_spring_sale. A numeric ID in the name is useful if you later cross-reference ad platforms or a spreadsheet. If you use that approach, pick it from the start, because changing the pattern midyear splits the history. If you want a separate ID, GA4 also has a utm_id parameter, which is covered in a later chapter.
Content and term
utm_content is where small variations belong. Use it to tell links apart inside the same email or ad set, such as hero_button versus footer_link. Define a short list of position words and reuse them. Avoid putting the same information in both utm_content and utm_campaign, which duplicates it and bloats the name.
Putting the convention in writing
A convention that lives in someone's head fails when that person is on holiday. Write a one-page document with four parts:
- The rules above, in your own words.
- The approved list of mediums and sources, with the exact spelling.
- The campaign pattern and two worked examples.
- The name of the person or team who approves additions.
Then store it where tagging happens. A shared spreadsheet with locked dropdowns for source and medium is enough for many teams. The spreadsheet can build the final URL from the cell values, so nobody types a medium by hand.
Enforcing the convention in code
If links are produced by a script, a CMS plugin or an email system with an API, validate them before they go out. The validator below checks the three required parameters, the shape of every utm_ value and the medium list. It runs under Node.js 18 or later.
const ALLOWED_MEDIUMS = new Set([
'email', 'cpc', 'paid_social', 'social',
'affiliate', 'display', 'referral', 'sms', 'qr',
]);
// lowercase letters and digits, joined by single underscores
const SLUG = /^[a-z0-9]+(?:_[a-z0-9]+)*$/;
function validateUtm(rawUrl) {
const params = new URL(rawUrl).searchParams;
const problems = [];
for (const key of ['utm_source', 'utm_medium', 'utm_campaign']) {
if (!params.get(key)) {
problems.push(`${key} is missing`);
}
}
for (const [key, value] of params) {
if (key.startsWith('utm_') && !SLUG.test(value)) {
problems.push(`${key}="${value}" is not lowercase_snake_case`);
}
}
const medium = params.get('utm_medium');
if (medium && !ALLOWED_MEDIUMS.has(medium)) {
problems.push(`utm_medium="${medium}" is not in the approved list`);
}
return problems;
}
console.log(validateUtm(
'https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale_2026'
));
// []
console.log(validateUtm(
'https://example.com/spring-sale?utm_source=Newsletter&utm_medium=e-mail&utm_campaign=Spring%20Sale'
));
// [
// 'utm_source="Newsletter" is not lowercase_snake_case',
// 'utm_medium="e-mail" is not lowercase_snake_case',
// 'utm_campaign="Spring Sale" is not lowercase_snake_case',
// 'utm_medium="e-mail" is not in the approved list'
// ]Note that the check only validates form. It cannot know that spring_sale_2026 is a real campaign. That judgment stays with the person who owns the campaign list.
Where the naming process lives
Conventions work when the check happens before the link is published and a named person owns changes. The diagram shows a small, realistic process.
The campaign register is a plain list of campaign names, dates and owners. Its main use is to look up what black_friday_2026 was and who ran it.
Dealing with data that is already messy
You cannot edit values that GA4 has already stored. These are the practical options, from cheapest to most involved:
- Fix forward. Start using the convention on all new links and note the cutover date in your documentation. Reports before and after that date will not be directly comparable.
- Normalize in reports. In an Exploration, use a filter or segment with a regular expression, such as
(?i)spring[_-]sale, to combine variants for analysis. - Group in a custom channel group. A custom channel group can place several spellings of a medium in one channel. This helps the Channel dimension but does not repair the source or medium columns.
- Fix it downstream. If you export GA4 data to BigQuery, a
LOWER()andREPLACE()step in your query normalizes the values for dashboards.
Each of these treats the symptom. The convention and the validation step are the only things that prevent the problem.
Common naming mistakes
- Capitalized medium values.
Emailandemailcreate two rows. Always lowercase. - Inventing a medium for each campaign. A medium like
spring_promotells you nothing about the channel and probably fits no channel rule. Put the promotion inutm_campaign. - Using the campaign name as the source. This turns the source column into a list of campaigns and hides which platforms drive traffic.
- Changing names while a campaign is running. Sessions before and after the change split into two campaigns. Fix typos on new links only, and record the change in your register.
- Tagging internal links. Putting UTM parameters on links inside your own site starts a new session with the new campaign values and overwrites the true origin of the visit. Use UTM tagging only on links that bring people from outside.
- Skipping the register. Without it, nobody knows whether a name is already in use, and two teams reuse
summer_sale.
Exercise
A teammate sends you the link https://example.com/offer?utm_source=LinkedIn&utm_medium=Paid-Social&utm_campaign=Q2 Launch and asks why it will be a problem in GA4. List the problems and write a corrected URL using the convention in this chapter.
Show answer
The values mix uppercase letters, a hyphen where the convention uses underscores, and a space in the campaign name. LinkedIn and linkedin would be separate rows, Paid-Social is not the approved medium paid_social and may not match the channel rule for paid social, and Q2 Launch is encoded as Q2%20Launch and is inconsistent with other campaign names. A corrected URL is https://example.com/offer?utm_source=linkedin&utm_medium=paid_social&utm_campaign=q2_launch.
Exercise
Your team wants to add a new medium called podcast. Describe the steps from this chapter's process, and explain what you would check before approving it.
Show answer
The requester submits the new medium to the convention owner instead of using it directly. The owner checks that no approved medium already covers it (for example referral or display), and looks up whether GA4's default channel group has a rule that would match podcast. If it would land in Unassigned, the owner decides whether a custom channel group is needed. If approved, the owner adds the exact lowercase spelling to the approved list, updates the template dropdown and the validator's ALLOWED_MEDIUMS, and records the change.
Exercise
A report shows two rows, spring_sale_2026 and Spring_Sale_2026, for the same promotion. Can you merge them in GA4's stored data? What can you do?
Show answer
No. GA4 does not let you rename or merge values already collected. You can use lowercase on all new links, combine the two rows in an Exploration with a regular expression filter or segment, or normalize the values with LOWER() if you export to BigQuery.