Vai al contenuto
Docs menu

Guides

UTM naming convention, rules and a template to copy

A UTM naming convention is a short written list of allowed values for source, medium and campaign. Rules that keep GA4 reports clean, a template you can copy, and how to apply it to short links.

Updated

A UTM naming convention is a short document that lists which values your team may use in utm_source, utm_medium and utm_campaign, and how to write new ones. Without one, the same newsletter shows up in Google Analytics as newsletter, Newsletter, email and mailchimp, and nobody can add them up.

The convention below is built around GA4's channel rules, so every value on the allowed list lands in a named channel instead of Unassigned.

The rules

  1. Lowercase only. GA4 reports treat Email and email as different values.
  2. Underscores between words, no spaces. Spaces turn into %20 or + in URLs, and people type them inconsistently. Use spring_sale, not Spring Sale.
  3. Medium is the type of channel, source is the specific site or list. utm_medium=email with utm_source=customers_newsletter, not the other way round.
  4. Medium comes from a fixed list. Nobody invents a new medium without updating the convention.
  5. Campaign names follow one pattern. For example yyyy_mm_name, such as 2026_11_black_friday. The date prefix keeps campaigns sorted and stops black_friday from merging across years.
  6. Placement goes in utm_content. Use it to tell apart two links in the same message or post, like header_button and footer_link, or bio and story.
  7. No personal data. Never put an email address or name in a UTM value. It ends up in your analytics and in the URL people share.

Allowed values

Copy this table into a shared sheet and change the sources to match the channels you use.

utm_mediumUse forExample utm_source valuesGA4 channel
emailNewsletters, onboarding and transactional emailcustomers_newsletter, onboardingEmail
socialUnpaid posts, bios, stories, DMs, groupsinstagram, linkedin, tiktok, whatsapp, youtubeOrganic Social
paid_socialPaid posts and ads on social networksinstagram, facebook, linkedinPaid Social
cpcPaid search adsgoogle, bingPaid Search
smsText messagessms or the provider list nameSMS
affiliatePaid creators and partnersthe partner's handle or nameAffiliates
referralLinks on partner sites and directoriesthe site, such as producthuntReferral
displayBanner adsthe ad networkDisplay
qrQR codes on printed materialthe placement, such as menu_tableUnassigned, unless you add a custom channel

For QR codes and print, GA4 has no default channel. Keep qr as the medium and add a custom channel group in GA4. See GA4 Unassigned traffic from UTM links.

Placementutm_sourceutm_mediumutm_campaignutm_content
November newsletter, main buttoncustomers_newsletteremail2026_11_black_fridaymain_button
Instagram bioinstagramsocial2026_11_black_fridaybio
Instagram Story, day 2instagramsocial2026_11_black_fridaystory_day2
Creator @jane on TikTokjaneaffiliate2026_11_black_fridaytiktok_video1
Store window posterstore_windowqr2026_11_black_fridayposter_a3

All rows share one campaign value, so GA4 can show the whole campaign in one row and break it down by source and content.

Give each row its own short link and set the values in the UTM Builder when you create it. The parameters are stored on the short link and added to the destination on every click, so the URL you share stays short and nobody can edit the tags by hand. See Add UTM parameters to a short link.

UTM Builder with source, medium and campaign filled in

If you create links in bulk from a sheet, put the UTM values in columns and create the links with the API or Google Sheets. The values then come straight from the approved list instead of being typed again.

Check values automatically

When links are created by a script, check each value against the convention before creating anything. This Python function rejects values that break the rules above:

import re

ALLOWED_MEDIUMS = {"email", "social", "paid_social", "cpc", "sms", "affiliate", "referral", "display", "qr"}
VALUE = re.compile(r"^[a-z0-9]+(_[a-z0-9]+)*$")
CAMPAIGN = re.compile(r"^\d{4}_\d{2}_[a-z0-9_]+$")

def check_utm(params: dict) -> list[str]:
    errors = []
    for name in ("utm_source", "utm_medium", "utm_campaign"):
        if not params.get(name):
            errors.append(f"{name} is missing")
    for name, value in params.items():
        if name.startswith("utm_") and value and not VALUE.match(value):
            errors.append(f"{name}={value!r}: use lowercase letters, digits and underscores")
    if params.get("utm_medium") and params["utm_medium"] not in ALLOWED_MEDIUMS:
        errors.append(f"utm_medium={params['utm_medium']!r} is not on the allowed list")
    if params.get("utm_campaign") and not CAMPAIGN.match(params["utm_campaign"]):
        errors.append(f"utm_campaign={params['utm_campaign']!r} should look like 2026_11_name")
    return errors

print(check_utm({"utm_source": "Instagram", "utm_medium": "bio", "utm_campaign": "black friday"}))

Keep the convention alive

  • Keep the allowed values in one shared sheet and link to it from wherever people create links.
  • Name an owner who approves new sources and mediums.
  • Once a month, look at Session source / medium in GA4 for values that aren't on the list, and fix the links that produced them.

Frequently asked questions

Should I use utm_source or utm_medium for the platform name?

Source. The medium is the type of channel, such as social or email. The platform, like instagram or linkedin, goes in utm_source.

Do I need utm_term and utm_content?

utm_content is worth using whenever one campaign has several links in the same place, so you can compare them. utm_term was made for paid search keywords and is rarely needed on other links.

Yes. Edit the short link and fill in the UTM Builder. Every click after the change gets the new values, including clicks on QR codes already printed.