Clean Tracking
Teach a team one naming rule for campaign links, and check it with a short script.
Objective
By the end of this lesson, you can teach a team a naming rule for campaign links and check links against it.
What tracking is
Tracking means recording where people came from and what they did. Many websites use Google Analytics 4 (GA4) for this. GA4 became Google's standard analytics tool in 2023, when the older version stopped collecting new data.
To know which flyer, email, or post brought people in, teams add tags to the end of a link. These are called UTM tags. A UTM tag is a label in the web address that tells your analytics tool where a visit came from.
https://example.org/enroll?utm_source=newsletter&utm_medium=email&utm_campaign=spring-tutoring
| Tag | Meaning | Example |
|---|---|---|
utm_source | Who sent the visit | newsletter |
utm_medium | What kind of channel | |
utm_campaign | Which effort | spring-tutoring |
Google offers a free Campaign URL Builder that fills these in for you.
Why one rule matters
Analytics tools treat "Email", "email", and "e-mail" as three different things. If three people tag links three ways, one campaign shows up as three rows. Then the report is wrong, and nobody trusts it.
Teach one rule and write it down:
- All lowercase.
- Use hyphens, not spaces.
- Pick from a short list of approved mediums: email, social, print, sms, referral.
- Campaign names follow
program-season, liketutoring-spring.
Check links with code
Run the script below. It checks a list of tags against the rule and flags the problems. The first run downloads a small Python program, which may take a minute on phone data. Keyboard users: press Esc, then Tab, to leave the editor.
approved = ["email", "social", "print", "sms", "referral"]
links = [
("newsletter", "email", "tutoring-spring"),
("Flyer", "Print", "tutoring spring"),
("partner", "e-mail", "tutoring-spring"),
]
for source, medium, campaign in links:
problems = []
if source != source.lower() or medium != medium.lower():
problems.append("use lowercase")
if " " in campaign:
problems.append("no spaces")
if medium.lower() not in approved:
problems.append("medium not approved")
if problems:
print(source, "->", ", ".join(problems))
else:
print(source, "-> ok")
You do not need code to teach this. A shared spreadsheet with a checklist works too. The code shows how a simple rule can be checked the same way every time.
Judgment: when tracking goes too far
Tags should describe the channel, never the person.
- Never put a name, email address, or phone number in a link tag.
- Do not create one link per person to see who clicked. That turns marketing into surveillance.
- Ask for consent where the law or your organization requires it before using tracking cookies.
Teach the tracking rule
0 of 5 doneGo deeper: Consent as signal: the first-party data layer you own
Discussion
Ask. Answer. Build together.
Loading…