Home › Blog › UTM codes explained: meaning and a naming convention
Blog · Tracking & analytics

UTM codes explained: meaning and a naming convention

With UTM codes, GA4 shows which newsletter, post or QR code brought in visitors. What each of the nine parameters means and a naming convention that holds up.

UTM codes are the bits of text after a link, such as ?utm_source=newsletter&utm_medium=email&utm_campaign=spring-2027, that tell GA4 where a visitor came from [1]. Always use source, medium and campaign, all in lowercase, with a medium that fits GA4's channel rules. Otherwise your traffic ends up under Unassigned.

You need them for channels that don't pass on their origin themselves: newsletters, organic posts, QR codes on printed matter and partner links. You don't tag Google Ads with auto-tagging, or links within your own site.

Tagging a link is easy; doing it consistently, across your whole team, is the hard part. If you have your measurement set up by a Google Analytics agency, the naming convention is the first thing you agree on together.

Which parameters do you use?

Always utm_source, utm_medium and utm_campaign [1]. If you set one UTM parameter, Google recommends setting all relevant ones, especially utm_id and utm_source_platform as well; missing parameters result in (not set) [1].

The main UTM parameters (source [1])
ParameterMeaningExample
utm_sourceWhere the link wasnewsletter, facebook
utm_mediumThe marketing mediumemail, social, referral
utm_campaignThe campaign or promotionspring-2027
utm_idThe campaign IDc2027-04
utm_contentDistinguishes creatives or links within the same campaigntop-button, video-a

GA4 recognises nine. There are also utm_term for the paid keyword and utm_source_platform for the platform that sends the traffic; utm_creative_format and utm_marketing_tactic are currently not reported [1].

The values are case-sensitive: google and Google are two different sources for GA4 [1]. And your UTM codes don't appear in the Landing page + query string dimension, but they do appear in Page location [1].

How GA4 sorts your medium into a channel

GA4 assigns traffic to fixed channels, such as Email or Organic Social, based on source and medium. You can't change those rules, and a value that fits no rule ends up under Unassigned [2].

A selection of GA4's channel rules (source [2])
ChannelWorksDoesn't work
Emailutm_medium=emailutm_medium=newsletter
Organic Socialutm_source=facebook&utm_medium=socialutm_medium=post with an unknown source
Paid Socialutm_source=instagram&utm_medium=paid_socialutm_medium=ad
Referralutm_medium=referralutm_medium=partner
Affiliatesutm_medium=affiliateutm_medium=partner-programme

QR codes and printed matter fit no channel: utm_medium=qr ends up under Unassigned. If you want to see printed matter separately, create a custom channel group; a standard property can have two, and they also work retroactively [3].

Traffic from AI assistants such as ChatGPT, Gemini, Copilot or Grok gets its own channel in GA4, AI Assistant. Google's AI Overviews and AI Mode count as Organic Search [2].

A naming convention that holds up

Six agreements prevent most pollution:

  1. Everything in lowercase, as Google recommends [1].
  2. No spaces or special characters. They have to be encoded in a URL [4]; use hyphens, as in spring-2027.
  3. One fixed value per source and per medium [1], in a list everyone uses.
  4. Campaign names as in the advertising platform. If a platform supports dynamic parameters such as {{campaign.name}}, use them [1].
  5. A period in the campaign name, so that this year's spring promotion doesn't merge with last year's.
  6. One owner of the list, who approves new values.

If a campaign runs in both Dutch and French, decide in advance where the language goes. In the campaign name (spring-2027-nl) if they are two campaigns with their own budget or audience; in utm_content (nl-button) if it is one campaign with two language versions.

You build links with Google's free Campaign URL Builder [5] or, for a team, with a shared spreadsheet with drop-down lists for source and medium. The cheatsheet contains the channel rules, a starter list and a formula.

Where don't you use a UTM code?

  • Google Ads with auto-tagging. GA4 gives auto-tagging priority over manual tagging [6]. For certain campaigns, such as Demand Gen, Google does recommend UTM codes as a supplement [7].
  • Links within your own site. A UTM code on a banner on your homepage gives the visit a new source in the middle of the session. Measure your own banners with the view_promotion and select_promotion events [8].

For ads on Meta, LinkedIn or TikTok you do use UTM codes, preferably with dynamic parameters. Since 1 January 2024, Meta may add source, medium and campaign IDs itself, and what you enter in the URL parameters field overrides them [9]. Why GA4 and Google Ads show different numbers anyway is explained in Why GA4 and Google Ads show different numbers.

UTM in your Google Business Profile

A UTM code on the website link of your Business Profile makes that traffic visible. Google's guidelines say nothing about UTM codes; they do prohibit URLs that redirect to pages other than those of your own business [10]. With utm_source=google&utm_medium=organic&utm_campaign=business-profile the traffic stays in Organic Search, and you still see it separately [2].

How to make further use of your Business Profile is explained in Local SEO: how to get found in your own region.

Privacy and checks

Never put personal data in a UTM code: Google prohibits data such as email addresses or mobile numbers, including in URL parameters [11]. The European regulators also count links with an identifier that has nothing to do with the requested page among the techniques covered by the ePrivacy rule [12]. So keep your values at campaign level, without subscriber IDs or other identifiers per recipient.

Every month, check three things in Traffic acquisition [1]:

  • the share of Unassigned, and which medium doesn't fit the rules;
  • (not set) for campaigns, often caused by incomplete UTM parameters [13];
  • variants of the same source, such as facebook, Facebook and fb.

How to clean up that pollution is explained in Fixing (not set), spam and duplicate purchases in GA4. Or let the free tracking audit look for missing UTM tags, (not set) values and traffic in the wrong channel.

Frequently asked questions

Which UTM parameters are required?

Google asks you to always include utm_source, utm_medium and utm_campaign. If you set one UTM parameter, Google strongly recommends setting all relevant ones, especially utm_id and utm_source_platform. Missing parameters result in (not set) in your reports.

Does it matter whether I use capital letters?

Yes. The values are case-sensitive: utm_source=google and utm_source=Google become two different sources in GA4. So agree that everything is written in lowercase.

Should I use UTM codes in Google Ads?

Usually not. With auto-tagging, Google Ads adds a click ID itself, and GA4 gives auto-tagging priority over manual UTM codes. You mainly use manual UTM codes for channels without such a link, such as newsletters, organic posts, QR codes and partner links.

Why is my campaign under Unassigned in GA4?

GA4 assigns traffic to channels according to fixed rules based on source and medium. If you use a medium that fits no rule, such as utm_medium=newsletter or utm_medium=qr, the traffic ends up under Unassigned. A fixed list of permitted values prevents this.

Can I put an email address or customer number in a UTM code?

No. Google prohibits sending personal data to Google Analytics, including via URL parameters. And according to the European regulators, links with an identifier per recipient are tracking links, covered by the same ePrivacy rule as cookies. Use campaign names, never anything that points to a person.

Sources

  1. URL builders: Collect campaign data with custom URLs — Analytics Help, accessed 27 Sep 2026
  2. Default channel group — Analytics Help, accessed 27 Sep 2026
  3. Custom channel groups — Analytics Help, accessed 27 Sep 2026
  4. [GA4] How traffic source dimensions are updated — Analytics Help, accessed 27 Sep 2026
  5. Campaign URL Builder — Google Analytics Demos & Tools, accessed 27 Sep 2026
  6. About auto-tagging — Google Ads Help, accessed 27 Sep 2026
  7. Clicks and Sessions Discrepancy for Google Ads and Google Analytics: Troubleshoot — Google Ads Help, accessed 27 Sep 2026
  8. [GA4] Set up ecommerce events — Analytics Help, accessed 27 Sep 2026
  9. Add URL parameters to your Meta ads — Meta Business Help Center, accessed 27 Sep 2026
  10. Guidelines for representing your business on Google — Google Business Profile Help, accessed 27 Sep 2026
  11. Best practices to avoid sending Personally Identifiable Information (PII) — Analytics Help, accessed 27 Sep 2026
  12. Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive, version 2.0 — European Data Protection Board, 7 Oct 2024, accessed 27 Sep 2026
  13. What the value (not set) means in your reports — Analytics Help, accessed 27 Sep 2026
·

Further reading

Blog · Tracking & analytics

Are your numbers right?