BeginnerLesson 9 of 305 min read

Tracking, UTM Links and Common Mistakes

Tag links with source, medium and campaign so you know what worked, build and check tagged links with a real program, and learn the habits that avoid the most common beginner mistakes.

In this lesson you will

  • Explain what UTM tags do
  • Build and check tagged links by program
  • Use a naming convention
  • Avoid common beginner mistakes

About 24 minutes

Which email sent the sales?

Noor sends a newsletter, posts on social media and runs a small advert, all in the same week, and sales go up. She cannot tell which one did it. Her analytics shows lots of visitors from ‘direct’, which means it does not know where they came from. Without tracking, she is guessing which work to repeat. The fix is simple and free: add small tags to the links you share, so your analytics can name each source. These tags are called UTM parameters, and they are one of the most useful habits in marketing.

How UTM links work

A UTM link is your normal web address with extra parts added after a question mark. The extra parts do not change the page, but they carry labels. Google Analytics’ own help describes three main ones that you should always use: source, the place that sent the visitor, such as newsletter or instagram; medium, the type of channel, such as email, social or cpc; and campaign, the name of the effort, such as winter-launch. There are optional ones too, such as term for paid search keywords and content for telling two links in the same message apart. The help pages also warn that values are case sensitive, so ‘google’ and ‘Google’ are different, and recommend a consistent naming convention.

Build them with a program and check them

Typing these by hand invites mistakes, so the program below builds a link from its parts using standard tools, and then checks any link for three common problems: a missing required tag, capital letters, and spaces. It also shows why messy naming splits your numbers.

from urllib.parse import urlencode, urlparse, parse_qs

BASE = "https://example.com/candles"

def link(source, medium, campaign, content=None):
    q = {"utm_source": source, "utm_medium": medium, "utm_campaign": campaign}
    if content:
        q["utm_content"] = content
    return BASE + "?" + urlencode(q)

def problems(url):
    q = {k: v[0] for k, v in parse_qs(urlparse(url).query).items()}
    bad = []
    for k in ("utm_source", "utm_medium", "utm_campaign"):
        if k not in q:
            bad.append("missing " + k)
    for k, v in q.items():
        if v != v.lower():
            bad.append(k + " has capitals")
        if " " in v:
            bad.append(k + " has a space")
    return bad

good = link("newsletter", "email", "winter-launch", "top-button")
print(good.split("?")[0])
for part in good.split("?")[1].split("&"):
    print("  " + part)
print("good link problems:", problems(good) or "none")

mess = [BASE + "?utm_source=Newsletter&utm_medium=email&utm_campaign=winter-launch",
        BASE + "?utm_source=insta&utm_campaign=winter%20launch",
        link("instagram", "social", "winter-launch")]
for i, u in enumerate(mess, 1):
    print(f"link {i}:", "; ".join(problems(u)) or "ok")

visits = ["Newsletter", "newsletter", "instagram", "newsletter", "Instagram", "instagram"]
raw, clean = {}, {}
for v in visits:
    raw[v] = raw.get(v, 0) + 1
    clean[v.lower()] = clean.get(v.lower(), 0) + 1
print("rows before cleaning:", len(raw))
print("rows after cleaning:", len(clean))
print("newsletter total:", clean["newsletter"])
https://example.com/candles
  utm_source=newsletter
  utm_medium=email
  utm_campaign=winter-launch
  utm_content=top-button
good link problems: none
link 1: utm_source has capitals
link 2: missing utm_medium; utm_campaign has a space
link 3: ok
rows before cleaning: 4
rows after cleaning: 2
newsletter total: 3

The first link is built correctly, and the checker reports no problems. The three links after it show the usual mistakes. The first has a capital letter in the source, the second is missing the medium and uses a space in the campaign name, and the third is fine. The last part is the most important. Six visits were recorded under four different spellings of two sources: ‘Newsletter’ and ‘newsletter’ are counted as separate rows, as are ‘Instagram’ and ‘instagram’. That gives 4 rows before cleaning and 2 after. Cleaned, the newsletter total is 3. If you had read the messy table you would have undercounted your best source.

A naming convention

  • Use lower case only, with hyphens instead of spaces.
  • Keep a short list of allowed sources and mediums, and use only those.
  • Name campaigns so you can read them in a year, such as winter-launch-2026.
  • Never tag links inside your own site, because it can reset where the visit is credited to. Use tags only on links from outside.
  • Keep a shared sheet of every link you create.

Common mistakes in marketing, and habits that help

  1. Doing everything at once. Pick one channel and one goal for a month.
  2. Not measuring. Tag every link and check results weekly.
  3. Changing too much. One change at a time, so you know what worked.
  4. Ignoring the list. Invite everyone to your email list.
  5. Promising too much. Honest, specific claims build lasting trust.
  6. Giving up early. Most channels take weeks to show results. Keep notes and keep going.
Common mistake: trusting untagged traffic

Reading a number without asking what it is made of. A rise in ‘direct’ traffic may be hidden email or social traffic that was not tagged. Tag first, then trust the report.

Tools change, the idea stays

Analytics tools change their names and menus. The idea of source, medium and campaign stays the same. Check your own tool’s current help pages, and follow the privacy rules where your visitors live, including any consent needed for tracking.

Write a one-page naming guide with your sources, mediums and campaign style. Build three tagged links with it, and run them through a checker.

Practice for this lesson

Check what you learned

Five quick questions. Pick an answer and you will see straight away whether it is right and why.

What do UTM tags do?

  1. Change the page
  2. Speed up the site
  3. Hide the link
  4. Label where a visit came from

They carry labels such as source, medium and campaign to analytics.

Which three tags should you always use?

  1. term, content and id
  2. source, medium and campaign
  3. page, post and tag
  4. name, price and size

Analytics help recommends always setting these three.

Why use lower case only?

  1. Capitals are banned
  2. It looks nicer
  3. Values are case sensitive, so capitals split your data
  4. It is faster

Newsletter and newsletter would be counted separately.

Where should you not use UTM tags?

  1. On links inside your own site
  2. In emails
  3. In social posts
  4. In adverts

Internal tagging can overwrite where a visit is credited.

Why keep a sheet of every link?

  1. To slow down
  2. To hide data
  3. So names stay consistent
  4. It is required by law

A shared record prevents duplicate or messy names.

Summary

  • UTM tags label where visits come from.
  • Always use source, medium and campaign, in lower case.
  • Messy names split your numbers.
  • Measure, change one thing at a time, and keep going.

Next lesson

Lesson 10 is the Beginner project: a one-month marketing plan.

Questions

Do I need paid software for this?

No. Free analytics tools can read these tags. Check your own tool's help pages for where the reports are.

Do UTM tags work in every place?

Mostly, but some apps strip or change links. Test each new link yourself by clicking it and checking the report.

What about privacy?

Follow the rules where your visitors live, including any consent needed for analytics. Check official guidance, because it differs by country.

Progress is saved in this browser.