← 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. Three are essential; two are optional but useful for granular tracking.

Required parameters:

  • utm_source identifies where the traffic originates. Examples: google, facebook, newsletter
  • utm_medium describes the marketing channel type. Examples: cpc, email, social, referral
  • utm_campaign names the specific promotion or initiative. Examples: black-friday-2024, product-launch, welcome-series

Optional parameters:

  • utm_term captures the keyword that triggered a paid search ad. Example: marketing+automation+software
  • utm_content differentiates between multiple links pointing to the same destination. Use this when you have two CTAs in one email or want to A/B test ad creative. Examples: header-link, sidebar-cta, blue-button

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

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, campaign attribution typically lasts for six months by default. If a visitor returns within that window, they may still be attributed to the original campaign depending on your attribution model settings.

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.