UTM Code

A UTM code is a snippet of text added to the end of a URL to track the source, medium, and campaign that drove a click in Google Analytics. UTM stands for Urchin Tracking Module, the analytics system Google acquired in 2005 that became Google Analytics. The code is made up of named parameters separated by ampersands, appended to the URL after a question mark.
What a UTM Code Looks Like
A UTM code sits in the query string of a URL, after the ?. Each parameter starts with utm_ followed by its name and value.
https://linkutm.com/?utm_source=facebook&utm_medium=social&utm_campaign=spring_sale
In the example above, the UTM code is everything after the ?. It tells Google Analytics 4 (GA4) that the visitor came from Facebook, through a social channel, as part of the spring_sale campaign. The visitor still lands on the same page; the parameters are read by analytics and stripped from the page URL.
UTM codes work on any web URL: landing pages, blog posts, product pages, even short links. They do not affect how the page renders or how search engines index it.
The 5 UTM Code Parameters
A UTM code can include up to five parameters. Three are required for meaningful reporting; two are optional.
| Parameter | Required | Purpose | Example value |
|---|---|---|---|
utm_source | Yes | Identifies the platform or referrer | facebook, newsletter, google |
utm_medium | Yes | Identifies the marketing channel type | cpc, email, social |
utm_campaign | Yes | Identifies the specific campaign | spring_sale, q4_launch |
utm_term | No | Tracks paid keywords | running_shoes |
utm_content | No | Differentiates ads or links inside one campaign | header_cta, sidebar_v2 |
The three required parameters are enough for clean campaign reporting. Add utm_term only for paid search keyword tracking. Add utm_content to A/B test creatives or differentiate multiple links inside a single email or page.
How to Create a UTM Code
There are three ways to build a UTM code. All produce the same output.
- Manual construction. Append
?utm_source=value&utm_medium=value&utm_campaign=valueto the destination URL. Replace each value with a lowercase, hyphen-or-underscore-separated string. - Spreadsheet template. Use a Google Sheet with formulas that concatenate the URL and parameter columns. This is fine for small teams running fewer than 10 campaigns per month.
- A UTM builder tool. Free generators like linkutm’s UTM builder handle encoding, enforce naming conventions, and produce ready-to-use links in seconds.
Whichever method is used, the parameter values must be consistent across team members. GA4 treats Facebook and facebook as two separate sources, so a single typo can split a campaign into multiple rows in reports.
UTM Code vs UTM Parameter vs UTM Tag
These three terms get used interchangeably and cause confusion. The technical distinction is small but worth knowing.
- UTM parameter refers to a single named field, such as
utm_sourceorutm_campaign. - UTM code refers to the complete string of parameters appended to a URL. A UTM code contains multiple UTM parameters.
- UTM tag is a casual synonym for either of the above, used most often in marketing teams. Most people will understand any of the three.
In practice, “UTM code” and “UTM tag” describe the full appended snippet. “UTM parameter” describes one named piece inside it. See the broader UTM definition for the origin and history of the term.
Common UTM Code Mistakes
Five errors break UTM code reporting more than any others.
- Mixed capitalization. GA4 is case sensitive.
utm_source=Facebookandutm_source=facebookproduce two separate rows. Always use lowercase. - Spaces in values. Spaces are encoded as
%20in URLs and can cause parsing issues. Use underscores or hyphens instead:spring_sale, notspring sale. - Inconsistent values across teams. Two team members tagging the same Facebook campaign as
fbandfacebookfragments the data permanently. - Tagging internal links. UTM codes on links inside the same site overwrite the original session source in GA4. Only tag links that come from external sources.
- Forgetting one of the three required parameters. Missing
utm_mediumis the most common cause of “(not set)” entries in GA4 reports.
Frequently Asked Questions
What is a UTM code in simple terms?
A UTM code is the snippet added to the end of a URL that tells analytics tools where a click came from. It includes named tags such as utm_source=facebook to identify the traffic source, channel, and campaign. Google Analytics 4 reads these tags and groups visits accordingly.
What is a UTM code example?
A typical UTM code example is ?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale. Appended to a destination URL, it tells GA4 the click came from a newsletter sent over email as part of the spring_sale campaign. Real codes use the same three required parameters at minimum.
How do I create a UTM code?
The fastest way to create a UTM code is to use a free UTM builder, which handles URL encoding and enforces consistent naming. Manual construction works too: append the parameters to the URL after a ?, separate each with &, and use lowercase values. Save naming standards in a shared document so the codes stay consistent across team members.
Are UTM codes case sensitive?
Yes, UTM codes are case sensitive in Google Analytics. utm_source=Facebook and utm_source=facebook are treated as two different sources. Always use lowercase values to keep campaign data clean and joinable.
Do UTM codes affect SEO?
No, UTM codes do not directly affect SEO. They are query string parameters that analytics tools read and strip; search engines treat the underlying URL as the canonical destination. The only indirect risk is if duplicate URLs with different UTM codes get indexed, which is solved with a canonical tag pointing to the clean URL.
To build UTM-tagged links without writing them by hand, use the free UTM builder.