GA4 Lab 2: Audit Your Campaign Links for UTM Mistakes and Build a Tracking Plan

Google Analytics 40 min min read Updated: Nov 18, 2026 Intermediate
GA4 Lab 2: Audit Your Campaign Links for UTM Mistakes and Build a Tracking Plan
Intermediate Topic 2 of 3

Goal

Check a list of campaign links against our naming rules, then write a tracking plan for the next campaign.

Naming Rules

  • utm_source, utm_medium and utm_campaign are required
  • All values are lowercase, with no spaces
  • utm_medium must be one of: email, cpc, paid_social, social, organic, referral

The Checker

python from urllib.parse import urlparse, parse_qs links = [ "https://example.com/?utm_source=newsletter&utm_medium=email&utm_campaign=nov_sale", "https://example.com/?utm_source=Facebook&utm_medium=paid_social&utm_campaign=Nov Sale", "https://example.com/?utm_medium=email&utm_campaign=nov_sale", "https://example.com/?utm_source=google&utm_medium=cpc&utm_campaign=brand", ] ALLOWED = {"email","cpc","paid_social","social","organic","referral"} for i,u in enumerate(links,1): q = {k:v[0] for k,v in parse_qs(urlparse(u).query).items()} problems=[] for req in ("utm_source","utm_medium","utm_campaign"): if req not in q: problems.append("missing "+req) for k,v in q.items(): if v != v.lower(): problems.append(k+" has uppercase") if " " in v: problems.append(k+" has space") if q.get("utm_medium") and q["utm_medium"] not in ALLOWED: problems.append("medium not allowed") print(i, "OK" if not problems else "; ".join(problems))
Result

1 OK | 2 utm_source has uppercase; utm_campaign has uppercase; utm_campaign has space | 3 missing utm_source | 4 OK

Your Turn

  1. Add a link with utm_medium=Email and see what the checker says
  2. Add a rule that warns when utm_campaign is longer than 30 characters
  3. Fix link 2 by hand and run the checker again

Tracking Plan for a New Campaign

Copy this table and fill it for your own campaign.

ItemExample
Goal200 newsletter signups in 30 days
Key eventsign_up (method = newsletter)
ChannelsEmail, Paid Social, Organic Social
UTM campaign namewinter_course_launch
Landing page/winter-course/
Report to watchTraffic acquisition with key event sign_up
Owner and review datePriya, every Monday

Conclusion

A small checker catches UTM mistakes quickly. A tracking plan keeps everyone using the same names.

Quick Summary: Rules; checker; exercises; tracking plan.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators