What Are UTM Codes and How Do You Create Them?

September 19, 2025

You may be running multiple marketing campaigns across different channels, but when leads convert, you can’t tell which Facebook ad, email newsletter, or Google search brought them in. Sound familiar? Without properly tracking this, you may find yourself in a lot of gray space when it comes to clarity on what’s fueling business.
A UTM code is a snippet of text added to any URL that tracks the source, medium, and campaign name of your web traffic. In short, acting like a footprint that follows visitors from first click to final conversion, giving you a trail of their movement, and a metric for following exactly where marketing spend yields the most ROI.
A UTM code solves this problem by leaving a breadcrumb trail for visitor interaction. They’re simple additions to your URLs that tell Google Analytics exactly where your traffic came from, which campaigns are working, and where to double down your budget. According to an Adobe Digital report, companies that invest time in proper tracking setup see up to a 40 percent increase in attribution data accuracy. You can learn more about collecting campaign data with Google Analytics directly from Google.
UTM links are powerful for when you’re actively managing campaigns through Google Ads or when testing which methods of acquiring traffic are working best. Once you have UTM parameters down, you’ll have an organized and methodical strategy for conquering link tagging and turning guessing games into fact-based decisions.
Why Use UTM Codes
Google Analytics sometimes groups most of your traffic together into ambiguous categories like “direct” or “referral” and keeps you in the dark about which campaigns are actually performing – UTM to the rescue.
Accelerates attribution accuracy
These codes remove the guesswork by giving you a direct line from click to conversion. Rather than reporting “email” as your traffic source, you’ll be able to see if those leads were generated from your Monday newsletter, your product launch announcement, or your weekly digest. This granular tracking also allows you to identify patterns such as “our Tuesday sends always outperform our Friday sends” or “video thumbnails get 40 percent more clicks than static images.”
Enables channel-level performance comparison.
With proper UTM tracking, you can finally answer questions like: “Does our LinkedIn spend generate better leads than Facebook?” or “Which performs better—organic social posts or paid social ads?” Without UTMs, these channels often get mixed together in analytics, making it impossible to optimize your channel mix. According to recent research compiled by Embryo, attribution across your multitude of marketing channels can provide efficiency gains of 15 percent, with 56 percent of marketers believing attribution is important and 33 percent considering it critical. Research from AdRoll also shows that employing multi-touch attribution models often leads to a 50 percent improvement in marketing effectiveness by ensuring budget allocation to the most impactful channels.
Improves budget allocation and optimization decisions.
UTM data helps you go from shooting in the dark with your marketing budget to making informed decisions. After all, when you can see that your “summer-sale-email” campaign brought 150 conversions at a $12 cost-per-acquisition while your “summer-sale-facebook” campaign netted just 50 conversions at $28 CPA, where you want to reallocate budget is a no-brainer. More importantly, this level of insight also allows you to double down on what’s working and stop wasting money on what isn’t. That way, every campaign is a learning experience for the next one.
What are UTM Parameters?
UTM codes work by attaching five different parameters to your URLs. Each one corresponds to a distinct type of tracking data that works to capture the key components of your traffic sources: who, what, where, when, and why. Here’s a look:
utm_source: Traffic Origin (Who)
This specifies the direct origin of your traffic. It’s the actual website or platform that’s sending visitors your way. Source is the most important UTM parameter, and the only one that you need to track the actual source of your clicks. When taking a look at Google Analytics documentation, you’ll see that utm_source identifies the referrer— whether that be google, a newsletter, or a facebook ad.
- facebook (for Facebook posts or ads)
- google (for Google Ads campaigns)
- newsletter (for email campaigns)
- linkedIn (for LinkedIn posts)
- twitter (for Twitter campaigns)
- partnersite (for affiliate or partner referrals)
Consistency is key when naming your sources. Don’t use both “facebook” and “fb” or “google” and “google-ads”—pick a format and use it across all of your campaigns.
utm_medium: Marketing Vehicle (What)
Medium, as the name suggests, refers to the marketing channel used to transmit your message. It’s a higher-level, more aggregate value than the traffic source that’ll help you group similar types of traffic together for a more segmented analysis.
Example Values:
- email (all email campaigns)
- social (organic social media posts)
- cpc (paid search ads)
- display (banner ads)
- affiliate (partner marketing)
- referral (word-of-mouth campaigns)
Using these metrics, you’ll be able to compare performance across different marketing approaches, like “How does our email marketing perform vs. our social media efforts?”
utm_campaign: Promotion Identifier (When)
Campaign denotes specific promotion identifiers. This is where you can get as granular as you want with info about what you’re promoting and when.
Example values:
- summer-sale-2024 (seasonal promotions)
- product-launch-may (new product announcements)
- webinar-lead-gen (event marketing)
- back-to-school (educational campaigns)
- black-friday-early-bird (holiday promotions)
Campaign names should be descriptive enough that anyone on your team can look at the link and know what it promotes by reading the UTM.
utm_content: Creative or Variant tag (Where)
Content differentiates between different versions of the same campaign. Use this when you’re A/B testing creative elements or running multiple variations of the same promotion.
Example values:
- video-thumbnail (video-based creative)
- cta-button-red (testing button colors)
- headline-urgency (testing urgent vs. calm messaging)
- banner-top (different ad placements)
- email-footer-link (different link positions)
This parameter is optional but invaluable for optimization. It answers questions like “Which email subject line drove more clicks?” or “Does our carousel ad outperform our single-image ad?”
utm_term: paid‑search keyword, example values
Term captures the specific keywords that triggered your paid search ads. It’s primarily used for Google Ads and other pay-per-click platforms.
Example values:
- project-management-software (broad match keywords)
- “best crm for small business” (exact match keywords)
- marketing+automation+tools (phrase match keywords)
- competitor-brand-name (for competitive campaigns)
Most advertising platforms auto-populate this parameter, but you can manually set it for better organization. Use it to track which keywords drive the highest-quality traffic and conversions.
Tip: While utm_source, utm_medium, and utm_campaign are essential for every UTM link, utm_content and utm_term are optional. Focus on getting the first three right before adding complexity with the additional parameters.
UTM Naming Conventions
The quickest way to create chaos in your tracking data is by using inconsistent UTM naming conventions. A CB/I Digital audit found that a fashion retailer had just 3 visits attributed to their email channel, while 150,000+ visits were denoted under ‘Other’ due to UTM capitalization errors. Without a system in place, it’s easy to have “Facebook,” “facebook,” and “fb” all show up as separate sources of traffic in your reports. The result? A complete analysis nightmare.
Follow a consistent syntax structure
Stick to a syntax structure for naming and use the same formula each time. A common format is date-objective-audience like “2024-q1-lead-gen-smb” or “march-webinar-enterprise.” The beauty of this structure is you can sort and filter easily later. Other helpful formats include:
- Channel-campaign-variant: “email-product-launch-version-a”
- Product-promotion-timeframe: “crm-free-trial-q2”
- Audience-objective-creative: “enterprise-demo-video-thumbnail”
And of course, use only lowercase. This will split your data when it should be aggregated. To prevent this problem, use all lowercase letters when creating your UTM parameters. If you accidentally type some UTM parameters with capital letters, your reports will show duplicate entries that will skew your data.
Maintain a central reference spreadsheet or document.
Create a master spreadsheet or document with your UTM naming conventions, approved values, and active campaigns. This is an essential step to preventing duplication and ensuring your team members aren’t creating their own conflicting UTM parameters. Include the following columns at a mihttps://supermetrics.com/blog/campaign-naming-conventionsnimum:
- Campaign name
- UTM parameters used
- Campaign dates
- Campaign owner
- Notes or objectives
Update your master list whenever you launch a new campaign, and have your team members reference it before creating new UTMs. This will save you hours of cleanup later and keep your analytics data clean and accurate.
Replace spaces with hyphens or underscores.
Spaces break URLs and create tracking errors. Instead of “summer sale 2024,” use “summer-sale-2024” or “summer_sale_2024.” Use one or the other consistently on all of your campaigns. Hyphens over underscores are recommended because they’re easier to read and type. The difference between the right approach and an analytics mess is self-evident. Choose your conventions early and enforce them consistently.
Best Tools to Create UTM Codes
Creating UTM codes manually is repetitive and easy to get wrong if you’re running a lot of campaigns. The following tools make bulk creation much easier, while reducing the likelihood of manual errors that can cause tracking to break.
Note that whichever tool you use, you should always test UTM links in an incognito browser window before running campaigns. Click the link to ensure it properly redirects and the parameters are present in your analytics. This quick sanity check can prevent broken tracking that will cost you valuable campaign data.
Google Campaign URL Builder: Free and foolproof
Google’s official UTM builder is the best, most reliable link creation tool. The interface is intuitive: paste your destination URL → complete the required fields (source, medium, campaign) → include optional fields as needed → click “Generate URL.”
This tool auto-populates the fields in the correct format and outputs a clean link you can copy and paste immediately. It also provides useful examples for each field, making it a great choice if you’re new to UTMs.
HubSpot UTM generator: Built-in tracking integration
HubSpot offers two methods for creating UTM’s, one for existing HubSpot customers and one for non-customers. Users can access the UTM builder built into their marketing tools at “Tracking URL Builder”, while non-customers can download a free HubSpot UTM generator spreadsheet that automates building links.
Mailchimp email tracking toggle and custom settings.
Mailchimp automatically appends UTM parameters to every link in your email campaigns—no need to add them manually. In your campaign settings, toggle on “Google Analytics Link Tracking” → Mailchimp appends utm_source=mailchimp, utm_medium=email, and utm_campaign=[your-campaign-name].
Mailchimp also lets you override their default parameters with your own naming conventions using their custom UTM settings. This is great if you want to maintain consistency across all your marketing channels.
Step‑by‑Step UTM Link Construction
While tools may be very useful, being able to build your own UTM links ensures your business has maximum control over your tracking parameters, while getting the most accurate insight into exactly how the system functions. Follow these instructions for constructing your own.
Step 1: Start with the destination URL.
The base of your link should be the clean destination URL with no existing parameters or tracking codes. Include only the full web address where you want traffic to be sent.
- For example, use “https://yoursite.com/product-demo” not “https://yoursite.com/product-demo?ref=homepage.”
- If your destination URL already contains parameters (indicated by a “?” in the URL), you’ll need to join UTM parameters with “&” instead of starting with “?” in Step 2.
Step 2: Append “?” then add parameters joined by “&”
After your destination URL, add a question mark followed by your first UTM parameter. Subsequent parameters are appended with an ampersand.
Basic Format: yoursite.com/page?utm_source=value&utm_medium=value&utm_campaign=value
Always start with utm_source, followed by utm_medium, then utm_campaign—this creates consistency across all your links.
Step 3: Enter each parameter value following naming rules.
Fill in your parameter values using the naming conventions you established: lowercase only, hyphens instead of spaces, and no special characters.
Example: utm_source=facebook&utm_medium=social&utm_campaign=summer-sale-2024&utm_content=video-carousel
- & separates each utm section
- = attaches a word or “value” to it
- utm_insertType tells you the data form
Review each parameter value to verify it follows your naming convention and is consistent with other campaigns using a reference spreadsheet.
Step 4: Encode special characters if necessary
If your parameter values include special characters (spaces, apostrophes, or symbols), they need to be URL-encoded to avoid broken links. Google’s technical documentation specifies that all characters to be URL-encoded are encoded using a ‘%’ character and a two-character hex value corresponding to their UTF-8 character.
Common special character encodings: space = %20, apostrophe = %27, ampersand = %26.
Most UTM tools automatically handle encoding but if building manually ensure special characters are encoded using an online URL encoder or omit them by using your naming convention.
Step 5: Copy and store the completed link
Once complete, copy the full link and save it to your campaign tracking spreadsheet along with campaign notes, creation date, usage notes, etc.
Test links by pasting into an incognito window to ensure proper functioning and correct destination page before using in campaigns.
Example of completed link: https://example.com/free-trial?utm_source=linkedin&utm_medium=social&utm_campaign=q1-lead-gen-2025&utm_content=video-carousel&utm_term=marketing-automation
Dirty data and dead links: Common UTM errors
Even professional marketers make UTM mistakes that may pollute analytics data or completely break tracking links. Analytics Mania documentation reveals that GA4 supports only a fixed list of UTM parameters, and issues like server-side redirects or JavaScript frameworks can cause UTMs to disappear after page load. These blunders are surprisingly common, yet they can set you back weeks of valuable campaign data. Let’s look at the five most common errors and how to avoid them.
Inconsistent parameter naming
This is the single most destructive habit that marketers have. As mentioned before, consistently referring to the same traffic source as “facebook”, “Facebook” and “fb” creates three completely different data boxes in your reports. Once done, there’s no way to aggregate that data and understand your actual Facebook performance without completely starting over – you can’t clean up an entire year’s worth of this.
The solution: create a master list of approved parameter values and follow it religiously. Cross-reference all of your UTM values against your naming conventions document before
Omitting required parameters
UTM parameters must include utm_source, utm_medium, and utm_campaign values to function.
If you omit any of these, you’ll launch into incomplete tracking that makes your insights unreliable. Some marketers may skip utm_medium, thinking it’s optional, but it’s crucial for understanding your channel performance from one to another.
Appending UTMs to organically shared links
Applying UTM parameters to links that are commonly shared in your normal web traffic “distorts” your organic referral data.
If someone tweets out your UTM-tagged link or shares it on LinkedIn, the code will overwrite that social share referral, making your data look as though your campaign generated that referral traffic, when it was in fact a natural organic share.
Including personally identifiable information
Names of your customers, their email addresses, and other personally identifiable data have no place in your UTM parameters.
They will show up in your Google Analytics reports and can run you afoul of privacy policies. Links should only include the level of data about the campaign, not individual people. Instead of using company names or user names, segment your audiences as “enterprise”, “small-business” or other general categories.
Using spaces that break URLs
The number one cause of broken links is spaces in the URL. A link with a space becomes untrackable and broken, leading to an error page instead of your site.
As we covered earlier, be sure to replace spaces with hyphens or underscores for your UTM values. Google Search Central recommends using hyphens to separate words for better clarity for users and search engines. A campaign title of “summer sale 2024” will have to be “summer-sale-2024” in your UTM code.
Create a UTM checklist that includes your most common mistakes and make sure to review it before launching any campaign. A two-minute review can save hours of data cleanup and prevent tracking gaps that cost you valuable insights.
Advanced Tactics
Once you’ve mastered basic UTM tracking, these advanced techniques will help you capture more accurate data, reduce manual work, and connect your UTM insights to actual business outcomes. These tactics require more technical setup but deliver exponentially better tracking capabilities.
Auto-append UTMs with Google Tag Manager
Don’t manually add UTM parameters to each and every link. Instead, create a trigger in GTM that automatically appends UTMs based on certain conditions or tags. For example, automatically add utm_source=newsletter&utm_medium=email to all links clicked within your email marketing messages.
This will help you to prevent typos and human error, guaranteeing every marketing channel or campaign gets automatically tracked with the right UTM codes. Create variables for common UTM values in GTM, then triggers for common events to fire tags whenever a user clicks on a link from a certain source e.g., a specific social channel or newsletter campaign.
Implement server-side tagging for data integrity
Browser-based tracking faces increasing challenges from ad blockers, cookie restrictions, and privacy updates, making server-side tagging essential for accurate attribution.
Server directly to GA4 (or another analytics platform) rather than relying on the client-side browser. Set up a server-side GTM container that captures UTM and other parameters at the server and forwards it to your analytics platform.
This offers several benefits:
- You’ll have cleaner, more accurate attribution to track
- Your iOS users who have been hammered by Apple’s privacy updates will see a massive data boost.
- Your data will be far more accurate overall.
Map UTM values to fields in your CRM for full-funnel attribution
UTM values only get interesting once you can map them to real revenue-generating events. Set up your CRM to capture UTM values from form submissions and record that data in a lead record. So for example, when someone submits a demo request form, capture their utm_source, utm_medium, and utm_campaign parameters in hidden fields that get passed along to your CRM.
HubSpot Community best practices recommend the use of hidden UTM fields on forms and workflow automation for data propagation. This will ensure deal-level attribution in CRM systems.
Now, not only can you track clicks to form submissions, but you can also track total deals closed, revenue by campaign, and even customer lifetime value based on UTM parameters.
Create trackable links for dark social sharing
Dark social refers to sharing that occurs via private messaging apps, email forwards, and copy-and-paste actions. All of this traffic shows up as “direct” in your analytics platform. Combat dark social by creating your own UTM-tagged shortened URLs for people to click and share.
Ex. “Share this link with your team” “Copy this link for friends” etc.
You want to grab as much of this sharing data as possible that otherwise would get lost in the direct traffic blackhole.
Take a look at our news on Marketing & Sales



by Nick Perry

by Nick Perry

by Shanel Pouatcha

by Shanel Pouatcha

by Nick Perry

by Nick Perry

by Nick Perry

by Nick Perry

by Shanel Pouatcha

by Shanel Pouatcha