Mission Growth

UTM Codes: How to Build Them and Fix Unassigned in GA4

UTM codes are the URL tags GA4 reads to sort clicks into channels. Build them with a naming table, then fix Unassigned and AI assistant traffic.

Published 12 min read
UTM codes as three slate trays of tagged parcels, with one parcel bearing a green tag that fits no slot left outside the trays
On this page

UTM codes are the tags you add to a link so GA4 can tell which email, post or ad sent a click. The tags are half the job. GA4 matches your utm_medium against fixed channel rules, and a label that matches none lands in Unassigned.

In our test set of 15 medium labels, 4 of 15 match no rule: newsletter, influencer, qr and podcast. All four read like sensible medium names.

In this guide:

  • The nine parameters Google documents and the three you always set
  • How to build a UTM link by hand, in Google's builder or in a sheet
  • Which GA4 channel each medium label lands in
  • When Google Ads auto-tagging overrides your tags
  • Naming rules and the places UTM codes break

The UTM parameters GA4 reads

UTM codes are the query-string tags (Urchin Tracking Module) that tell Google Analytics which campaign sent a click, and you should always set utm_source, utm_medium and utm_campaign.

Here's what the five standard parameters carry:

ParameterWhat it carriesStatus
utm_sourceWhere the click came from, such as a platform or a listAlways set
utm_mediumThe marketing medium, which GA4 matches against channel rulesAlways set
utm_campaignThe campaign or promotion, such as spring_saleAlways set
utm_termThe paid keywordOptional
utm_contentWhich link or ad variation was clickedOptional

Four extra fields sit beside them: utm_id, the utm_source_platform field, utm_creative_format and utm_marketing_tactic. Google's help page lists 9 parameters in total, and removing those 4 leaves the 5 standard ones above (our count from that list).

The part that trips people up is partial tagging. Google says missing UTM parameters result in (not set) values in reporting, and it strongly recommends that if you set one parameter you set all relevant UTM parameters.

So a link with a source and a medium but no campaign shows (not set) values in the campaign column. You can't group those clicks into a campaign afterwards, because the name was never sent.

That is why UTM tracking pays off. You name the campaign yourself, and every report from then on can be cut by that name.

A UTM link is your page URL plus a question mark and parameter=value pairs joined by ampersands. Write it by hand, in Google's builder or in a sheet.

Here's the build, step by step:

  1. Start with the final landing page URL, the exact page the click should open.
  2. Add a question mark, then your first pair, such as utm_source=crm.
  3. Join each further pair with an ampersand: utm_medium=email, then utm_campaign=spring_sale.
  4. Keep every value free of spaces and special characters. Google says special characters in parameter values must be URL encoded, so a dash or underscore saves you the trouble.
  5. If the URL carries a page-jump hashtag, place the UTM parameters before it.

Put together, the link reads https://example.com/pricing?utm_source=crm&utm_medium=email&utm_campaign=spring_sale. Google separates the parameters from the address with a question mark, and it's the one character you can't leave out.

Two example UTM codes side by side: a link with source, medium and campaign reports a channel, and one missing utm_medium reports (not set).
A link missing utm_medium reports (not set), while a full link reports a channel.

If you only need a few links, Google's own utm builder fills in the string for you. For a whole campaign, use a sheet with one row per placement and join the columns with a text concatenation formula, so the link is never retyped.

For example, here's one campaign, spring_sale, spread over 5 placements. Each row is its own URL, and the last column is the resulting channel GA4 assigns:

Placementutm_sourceutm_mediumutm_contentResulting channel
Launch email, header buttoncrmemailheader_buttonEmail
Partner site bannerpartner-sitebannerleaderboardDisplay
Podcast host readweekly-showaudiohost_readAudio
Reminder text messagecrmsmsreminder_textSMS
QR code on a flyerflyerreferraldoor_hangerReferral

The flyer row shows the habit this guide argues for. The medium was chosen because a GA4 rule matches it, which is why the next section matters.

How GA4 turns utm_medium into a channel

GA4 matches your utm_medium against fixed rules in its default channel group, so the label you type decides the channel, and any label that matches no rule lands in Unassigned.

Google defines Unassigned as the value Analytics uses when no other channel rule matches the event data. We took 15 medium labels (email, social, banner, referral, cpc, paid-social, ai-assistant, affiliate, sms, audio, push, newsletter, influencer, qr and podcast) and ran each against Google's published rules. These are our test set, a mix of labels teams use, not a ranking of the most common ones.

The table assumes a source outside Google's lists, so we used partner-site. This medium lookup table shows where each label lands:

utm_medium labelRule it meetsLands in
emailSource or medium is an email variant (email, e-mail, e_mail, e mail)Email
socialMedium is one of the social variantsOrganic Social
bannerMedium is display, banner, expandable, interstitial or cpmDisplay
referralMedium is referral, app or linkReferral
cpcMedium contains cp, equals ppc or retargeting, or starts with paid (the Paid Other pattern)Paid Other
paid-socialMedium matches the same patternPaid Other
ai-assistantMedium exactly matches ai-assistantAI Assistant
affiliateMedium is affiliateAffiliates
smsSource or medium exactly matches smsSMS
audioMedium exactly matches audioAudio
pushMedium ends with pushMobile Push
newsletterNo rule: the Email rule needs an email variantUnassigned
influencerNo ruleUnassigned
qrNo ruleUnassigned
podcastNo ruleUnassigned

Every other label matches a rule, but 4 of 15 don't: newsletter, influencer, qr and podcast. Each of those four lands in Unassigned.

15 test-set utm_medium labels in two lists: 11 that match a GA4 channel rule, and newsletter, influencer, qr and podcast in Unassigned.
Four of the 15 utm_medium labels in our test set match no GA4 default channel rule and land in Unassigned.

Newsletter is the one that hurts, because it sounds like email. The Email rule wants the word email in the source or the medium, and newsletter is neither. Send utm_medium=email and keep newsletter in utm_source or utm_campaign.

The same logic fixes podcast: send audio as the medium and put the show in utm_source. For influencer links, a social medium variant gets you to Organic Social, and the creator's name goes in utm_content.

With qr, none of the rules names print. Our workaround, not Google's guidance: pick a medium a rule does match, as the flyer row above did with referral, or accept Unassigned and read the source column.

Mediums do not have to equal channel names

Your mediums do not have to equal GA4's channel names, despite a common rule of thumb that says they do. They don't.

Paid Social isn't something you type. It needs a source from Google's social list plus the paid pattern, so paid-social with our partner-site source falls to Paid Other. Rules match strings and patterns, and the channel names in your reports are what comes out of them. Google also says channel definitions aren't case sensitive and can't be edited.

AI assistants follow the same table. A link tagged with the medium exactly ai-assistant is matched by the same rule as the AI Assistant channel that GA4 fills from referrers. Google's channel definition names sources like ChatGPT, Gemini, Deepseek, Copilot and Grok. Clicks from AI Overviews and AI Mode stay in Organic Search, per Google. For the channel setup, read our guide to AI search analytics; the volumes are in the AI referral traffic statistics.

When auto-tagging beats your UTM codes

On Google Ads traffic with auto-tagging, GA4 takes source and medium from the gclid, and your utm_content and utm_term only fill the Manual Ad Content and Manual Term dimensions.

If you use manual tagging and auto-tagging together, Google says the source, medium and other traffic-classification dimensions use the auto-tagged values. Your typed medium does not overrule the click ID while the gclid works.

Here's the order GA4 follows:

Flow from a Google Ads click to the gclid check, then the UTM fallback that sets the default channel group when the gclid cannot be used.
GA4 uses the gclid first and falls back to UTM values only when the gclid cannot be used.

The fallback matters more than it looks. Google notes that even with auto-tagging enabled, there are cases where the Google Click Identifier (GCLID) or DoubleClick Identifier (DCLID) cannot be used as intended. In those cases Google Analytics uses UTM values to set the default channel group.

So keep both. Auto-tagging stays on for Google Ads, and you still tag the link with source, medium and campaign, because GA4 falls back to your UTM values when the click ID cannot be used.

You can also use utm_content as a plain differentiator. If one email carries two links to the same page, give them utm_content=header_button and utm_content=footer_link, and the campaign data splits by link without a second campaign name.

Naming rules that keep reports clean

GA4 treats UTM values as case sensitive, so one lowercase value per platform and a shared naming sheet stop one campaign splitting into several rows.

Google's example is Meta and meta: keywords with different capitalization are treated as different values. The channel rules ignore case, so Email and email both reach the Email channel, but the report rows for source and campaign stay separate. A mixed-case habit won't break your channels. It will break your campaign totals.

Three rules cover most of it:

  • Lowercase everything. Type values in lowercase and never let a builder or a teammate capitalize one.
  • One value per platform. Pick linkedin and use it everywhere, never a mix of linkedin and LinkedIn depending on who built the link.
  • One sheet owns the values. Every new source, medium or campaign gets added to the shared sheet before a link uses it.

The naming sheet is a short table anyone can fill in:

ParameterRuleExample
utm_sourceOne lowercase value per platformlinkedin
utm_mediumOnly labels from the lookup tableemail
utm_campaignLowercase, underscores between wordsspring_sale
utm_contentNames the link or creativeheader_button
utm_termPaid keyword, only if you use oneproject_management

The medium row is the one to lock down, because it picks the channel. A sheet where every placement already shows its resulting channel, like the campaign sheet above, catches an Unassigned label before it ships.

A table like this is also what a good SEO dashboard leans on: when source and campaign are consistent, one campaign is one row, and the dashboard needs no cleanup layer.

Where UTM codes break

UTM codes fail when a parameter is missing, when a medium matches no channel rule, or when internal links carry tags, a case for which Google's documentation states no rule.

The first two are mechanical. A missing parameter produces (not set) values, and a medium outside the rules lands in Unassigned. Both show up in the report as soon as data arrives, which is why the medium and the three required parameters are the first things to check on any link.

Internal links are the unresolved one. Google documents the session rule: a session starts when none is currently active, and by default it ends after 30 minutes of inactivity. It states no rule for a tag on an internal link.

Its scopes page has one worked example with a link tagged utm_source=internal_promotion, and the results table never lists that value as a session source, but the page does not explain it.

So we can't tell you what a tag on an internal link does, and we won't guess. The safe move costs nothing, and it is our recommendation, not Google's: put UTM codes on external links pointing to your site, and keep internal links untagged.

Two more breaks come from how the URL is read:

  • Page location. UTM information isn't captured in the landing page plus query string dimensions. Google says it's populated in the Page location dimension instead, so look there to check a tag.
  • Shared links. One QR code printed in 3 places gives one row for all of them. Use one URL per placement, so each placement has its own content value. The same goes for each influencer: one URL per creator, with the creator's handle in utm_content.

Clean tagging also feeds your SEO reporting: the cleaner the rows, the less time you spend explaining Unassigned in a monthly review.

Tagging well comes down to one fact. A UTM code is only as good as the GA4 rule that reads it, and the medium you type picks the channel. This week, take every utm_medium you use, check it against the lookup table, and rewrite any that land in Unassigned.

Frequently asked questions

What does UTM stand for?

UTM stands for Urchin Tracking Module. The name comes from Urchin, the analytics software behind early Google Analytics. On a link, the tags tell analytics which source, medium and campaign sent the visit.

What are the 5 UTM parameters?

Source, medium, campaign, term and content make up the standard five, each with a utm_ prefix. Google says you should always use source, medium and campaign. Term and content are optional, covering the paid keyword and the link or ad variation.

How do I get a UTM code?

You build it, because no one issues UTM codes. Add a question mark to your page URL, then your parameters joined by ampersands. Google's Campaign URL Builder assembles the string for you, and a spreadsheet does it for a whole campaign.

Is a UTM builder free?

A tagged URL is plain text, so you can build one at no cost in a spreadsheet or in Google's Campaign URL Builder. Any utm builder only joins parameters and encodes characters. What matters is the medium you choose, which the builder won't check against GA4's rules.

Do I need UTM codes on every link?

No. Tag links from other places that point to your site: emails, posts, ads, QR codes. Leave internal links untagged. Google asks you to always use utm_source, utm_medium and utm_campaign on a tagged link, so a link with one is incomplete.

Cite this page

Aktaş, F. (2026, November 30). UTM Codes: How to Build Them and Fix Unassigned in GA4. Mission Growth. https://missiongrowth.io/blog/utm-codes

Figures we made for this post are free to reuse under CC BY 4.0 with credit to Mission Growth.

Up nextAI Search Analytics: The New Measurement Stack
17 min read
Next step

Put these playbooks to work

Start with a free audit. See where the lift is before you commit.

How it works

  1. 01

    30-minute audit call

    We map your funnel against your goal and pull live data from your channels.

  2. 02

    Lift estimate

    You get a written estimate of where the lift is, with a 30-day plan to capture it.

  3. 03

    You decide

    Run it with us, run it in-house, or shelve it. No commitment from the audit.