← Back to Glossary

What is a UTM code?

Definition

UTM code

A UTM code is a snippet of text you add to the end of a URL to track where your website traffic comes from. When someone clicks a link with UTM parameters attached, your analytics tool records exactly which campaign, channel, or piece of content brought them to your site.

Here's what a UTM-tagged URL looks like:

www.yoursite.com/landing-page?utm_source=facebook&utm_medium=paid-social&utm_campaign=spring-sale

Everything after the question mark tells your analytics platform the story: this visitor came from Facebook, through a paid social ad, as part of your spring sale campaign.

Without UTM codes, you'd know someone arrived from "social media." With them, you know they clicked the second ad variation in your retargeting campaign on Instagram Stories. That level of detail changes how you allocate budget and optimize performance.

The five UTM parameters

UTM codes use five standard parameters. Google says to always use the first three, and the other two add detail when you need it.

ParameterNeeded on every link?What it tracksExample values
utm_sourceYesWhere the traffic comes fromgoogle, newsletter
utm_mediumYesThe channel typecpc, email, social
utm_campaignYesThe promotion or initiativespring-sale, welcome-series
utm_termOptionalThe paid search keywordmarketing+automation+software
utm_contentOptionalWhich link or creative was clickedheader-link, blue-button

Google Analytics 4 also reads utm_id (a campaign ID) and utm_source_platform (the platform that sent the traffic). Google's URL builders guide strongly recommends setting both. It also lists utm_creative_format and utm_marketing_tactic, which Analytics doesn't currently report.

When to use UTM codes

Add UTM parameters to any link where you want to track performance beyond basic channel attribution.

Email campaigns benefit most from UTM tracking. Your email marketing platform shows opens and clicks, but UTM codes reveal what happens after the click. Did newsletter subscribers convert at a higher rate than promotional email recipients? UTM data answers that.

Paid advertising across platforms becomes comparable when you use consistent UTM structures. Compare your Facebook retargeting campaign against your Google Display ads using the same naming conventions.

Social media posts look identical in basic analytics. UTM codes let you distinguish between your organic LinkedIn post and the same content shared on Twitter, or between a link in your bio versus one in a story.

Partner and affiliate links need UTM tracking to measure referral performance. When an industry publication mentions your product, you'll know exactly how much traffic and how many conversions that placement generated.

One important rule: never use UTM parameters on internal links within your website. If a visitor arrives from your email campaign and then clicks an internal link tagged with different UTM parameters, you'll lose the original attribution data.

How to create UTM codes

You can type UTM parameters manually, but a URL builder prevents formatting errors and keeps your naming consistent.

Google offers a free Campaign URL Builder that walks you through each parameter. Enter your destination URL, fill in the campaign details, and copy the generated link.

In ActiveCampaign, UTM tracking integrates directly with your campaigns. When you add links to emails, the platform can automatically append UTM parameters based on your settings, eliminating manual work and ensuring consistency across all your marketing automation workflows.

For teams running multiple campaigns, a shared spreadsheet works well for documenting your UTM conventions and storing generated links. This prevents duplicate or inconsistent tags that fragment your data.

Best practices for UTM tracking

Establish naming conventions before you start. Decide whether you'll use "facebook" or "Facebook" or "fb" and stick with it. UTM parameters are case-sensitive, so "Email" and "email" create separate entries in your reports. Lowercase everything to avoid confusion.

Use hyphens or underscores instead of spaces. Spaces convert to "%20" in URLs, making them harder to read and potentially causing tracking issues. Both "spring-sale" and "spring_sale" work; pick one format and use it consistently.

Keep names descriptive but concise. Your future self and teammates should understand what "utm_campaign=q2-webinar-series" means without checking documentation. Avoid cryptic codes like "utm_campaign=ws2024q2v3."

Document everything in a shared location. A running list of your UTM links prevents duplicates and helps new team members understand your tracking structure. Include the full URL, what campaign it belongs to, and where it's being used.

Test before launching. Click your UTM-tagged links and verify the parameters appear correctly in your browser's address bar, then check your analytics platform to confirm the data is being captured as expected.

Viewing UTM data in analytics

Once your tagged links are live, traffic data flows into your analytics platform automatically.

In Google Analytics 4, navigate to Reports → Acquisition → Traffic acquisition. You can filter by source, medium, or campaign to see how each performs. For campaign-specific views, use the "Session campaign" dimension.

The real value emerges when you connect UTM data to conversions. Set up goals or conversion events, then analyze which campaigns drive not just traffic but actual results. A campaign generating thousands of visits matters less than one generating hundreds of customers.

ActiveCampaign users can track UTM parameters alongside contact behavior, connecting campaign attribution to individual customer journeys. See which campaign first brought a contact to your site, then follow their path through your sales CRM to closed deal.

Common UTM mistakes to avoid

Inconsistent capitalization splits your data across multiple entries. "Facebook," "facebook," and "FACEBOOK" all appear as separate sources in your reports.

Overly complex naming creates confusion. If you need a decoder ring to understand your UTM parameters, simplify them.

Tagging internal links overwrites your original attribution data. Only use UTM codes on links from external sources pointing to your site.

Forgetting to shorten URLs for social sharing. A link with five UTM parameters looks cluttered in a tweet. Use a URL shortener like Bitly to clean it up while preserving the tracking data.

Not testing links before sending campaigns. A typo in your UTM parameters means lost or misattributed data that you can't recover.

FAQs

What is utm_campaign?
utm_campaign is the UTM parameter that names the marketing campaign a link belongs to, such as spring-sale or welcome-series. Use the same name on every link in that campaign so its traffic reports together.

What's the difference between a UTM code and a UTM parameter?
A UTM parameter is one tag, such as utm_source=facebook. A UTM code is the full set of tags added after the question mark in a URL.

Do UTM codes affect SEO?
No. UTM parameters don't impact your search rankings. Search engines understand these are tracking parameters and ignore them when indexing your pages.

How long do UTM parameters persist?
In Google Analytics 4, a campaign click can earn credit for a key event (GA4's name for a conversion) only inside your lookback window. Google's attribution settings guide puts the default at 90 days, and you can choose 30 or 60 days instead. For acquisition key events like a first visit, the default is 30 days.

The same window also applies to session attribution, Google says. How GA4 splits key event credit across campaigns depends on your attribution model.

Can I use UTM codes with SMS campaigns?
Yes. Add UTM parameters to any links in your text messages to track which SMS campaigns drive website traffic and conversions. This works well alongside your SMS marketing metrics for a complete picture of performance.

What if I forget to add UTM codes?
Traffic still arrives at your site, but it gets bucketed into generic categories like "direct" or the referring domain. You lose the campaign-level detail that makes optimization possible.

Ready to see exactly which campaigns drive results? Start your free ActiveCampaign trial and connect your marketing efforts to real revenue.

Ready to take ActiveCampaign for a spin?

Try it free for 14 days.

Free 14-day trial with email sign-up
Join thousands of customers. No credit card needed. Instant setup.