Skip to main content
Terminus
Contents
FoundationsChapter 2 · ~7 min read

How Tracking Works

URLs, referrer data, and the five UTM parameters: how campaign information travels from click to report.

On this page

Three things stand between you and your first correctly tagged campaign: how URLs are put together, why the browser can’t tell you where visitors come from, and what each of the five UTM parameters actually does.

None of it is hard. Most tracking messes start with someone skipping one of the three.

Deconstructing the URL

A tagged link is just a URL doing extra work. The components:

  • Scheme: The protocol (https://). Always use HTTPS for security and to preserve referrer data.
  • Hostname: The domain (www.example.com).
  • Path: The specific page (/products/shoes). Case-sensitive on most servers.
  • Query Parameters: The tracking workhorse. Starts with ?, uses key=value pairs separated by &. These carry your campaign data without changing what page loads.
  • Fragment: The anchor (#details). Points to a section within a page. Processed client-side only, never sent to the server, so analytics won’t capture it. Important: query parameters must come before the fragment, or they’ll be ignored.

https://www.example.com/store/shoes?category=running&color=blue#details

Scheme
protocol
Hostname
domain
Path
resource path
Query String
key=value pairs, separated by &, starts with ?
Fragment
anchor, client-side, starts with #

Query String Breakdown:

KeyValue
categoryrunning
colorblue

URL Best Practices for Tracking

  • Use hyphens in URL paths. In the path portion of a URL (e.g., /summer-sale/), always use hyphens. Search engines treat hyphens as word separators, so summer-sale reads as two words while summer_sale may not. This matters for SEO.
  • In query parameter values, either hyphens or underscores work. Search engines don’t index parameter values for keyword meaning, so the SEO argument doesn’t apply there. What matters is consistency: pick one convention and enforce it across your team. Hyphens (summer-sale) are more common and align with URL path conventions. Underscores (summer_sale) have one advantage: they let you use hyphens as a second-level delimiter to separate segments in structured values (e.g., summer_sale-2025_q2). See Chapter 6 for the full two-delimiter convention.
  • Always use lowercase. utm_source=Facebook and utm_source=facebook are treated as two different sources in analytics. Enforce lowercase everywhere. (Chapter 5 covers casing and other common mistakes in detail.)
  • Keep URLs concise. Long UTM-tagged URLs work fine technically, but they’re hard to share and may get truncated. Use URL shorteners when needed.
  • Stick to safe characters. Use only a-z, 0-9, hyphens, and underscores in parameter values. Spaces become %20 and special characters (&, #, +, ?) have reserved meanings that will break your URLs.

That’s the container.

Now, why you can’t rely on the browser to fill it for you.

Why Referrer Data Isn’t Enough

The browser’s Referer header (yes, the misspelling is part of the standard) tells your analytics where a visitor came from. But it’s increasingly unreliable:

  • Often missing entirely: Bookmarks, direct URL entry, email clients, mobile apps, QR codes, and HTTPS-to-HTTP transitions all produce no referrer data, and every one of those visits files under “direct” traffic.
  • Increasingly stripped by policy: Browsers now default to strict-origin-when-cross-origin, meaning you often only see the domain (e.g., partner.com), not the specific page that linked to you.
  • No campaign context: Even when present, referrer data tells you where the click came from, not which campaign or why.

OFF-SITE (External Platforms)

Social Media Platforms

  • Facebook post
  • LinkedIn ad

Search Engines

  • Google Ads
  • Bing Ads

Partner Websites

  • Guest blog links
  • Affiliate banners

Email Clients

  • Newsletter links
  • Drip campaign CTAs

ON-SITE (Your Website)

Analytics Script (GA4, Adobe) collects:

  • Pageviews
  • Session duration
  • Events (form fills, clicks)
  • E-commerce transactions

UTM parameters are read from the URL query string and used to attribute the session:

  • utm_source -> Traffic Source
  • utm_medium -> Channel Type
  • utm_campaign -> Campaign
The UTM-tagged URL acts as a bridge: it carries attribution data from the off-site click to the on-site analytics environment.

This is precisely why UTM parameters exist: they let you embed source and campaign information directly in the URL, bypassing referrer limitations entirely.

The Five UTM Parameters

UTM (Urchin Tracking Module) parameters are the most widely adopted convention for campaign tracking. Five standard parameters each capture a distinct dimension of traffic origin:

ParameterAnswersExamples
utm_sourceWHEREgoogle, facebook, newsletter
utm_mediumHOWcpc, email, social
utm_campaignWHY/WHATspring_sale, product_launch
utm_termWHICH KEYWORDrunning-shoes
utm_contentWHICH VARIATIONcta-button-red, hero-banner

The three required parameters (source, medium, and campaign) form the backbone of your tracking. The two optional ones (term and content) add granularity when you need it.

utm_source (Required): identifies the traffic source

Source answers one question: which platform or property is sending this traffic? It identifies the specific origin: the website, app, or communication channel where the user clicked the link.

Common values: google, facebook, linkedin, newsletter, partner-acme, podcast-marketing_over_coffee

The boundary rule: Source identifies where the click came from, not how (that’s medium) or why (that’s campaign). If you’re tempted to put google_ads_brand_search as a source, you’re mixing three things: the platform (google), the channel type (cpc), and the campaign strategy (brand). Those belong in utm_source=google, utm_medium=cpc, and utm_campaign=brand_search-2025_q2 respectively. The pattern partner-acme is fine; it identifies a specific origin (Acme’s website). The pattern qr_code-conference_booth is fine; it identifies a specific physical touchpoint. What doesn’t belong in source is anything about the type of traffic or the strategy behind it.


utm_medium (Required): identifies the marketing medium

Specifies the general channel category (e.g., cpc, social, email, organic, referral, display, affiliate).

Common values: cpc, paid_social, social, email, display, affiliate, referral, offline


utm_campaign (Required): identifies the specific campaign

Names the strategic campaign, product promotion, or slogan (e.g., summer_sale, product_launch_q3, brand_awareness_initiative).

  • Simple (Flat): summer_sale, new_product: plain, readable, works for small teams
  • With date: summer_sale-2025_03, ebook_promo-2025_q2: sortable, filterable by initiative and date
  • Structured (multi-segment): summer_sale-shoes-us-2025_q2: encodes initiative, product, region, and date as separate segments (see Chapter 6 for when to use this approach)

utm_term (Optional): identifies paid search keywords or audiences

Used for paid search to note the keywords targeted. Can also identify audience segments in display or social ads (e.g., running_shoes, marketing_automation_software).

  • Paid search keywords: running_shoes, best_crm_software: the keyword or keyword theme being targeted
  • With match type: running_shoes-exact, crm_software-broad: includes the match type for keyword-level optimization
  • Audience targeting (paid social/display): lookalike-purchasers-30d, retargeting-cart-abandoners: repurposed for audience segments when keyword tracking isn’t relevant

When to use it: Only when running paid search campaigns where keyword-level performance matters, or when you need to track specific audience segments in paid social/display. Skip it for email, organic social, QR codes, and most other channels; it adds complexity without value there.


utm_content (Optional): differentiates ad creatives or links

Used for A/B testing and to distinguish between ads or links that point to the same URL (e.g., logolink, textlink, video_ad_version_A, sidebar_banner).

  • Link placement: hero-cta, footer-link, sidebar-banner: identifies where in the page or email the link appeared
  • A/B test variant: hero-cta-red, hero-cta-blue: same placement, different creative, for controlled comparison
  • Ad creative detail: video-testimonial-30sec, static-product-lifestyle: differentiates ad formats and creative approaches

When to use it: When multiple links in the same email, ad set, or page point to the same destination and you need to know which one was clicked. Also valuable for A/B testing ad creatives. Skip it when there’s only one link per context; it won’t tell you anything useful.

Start with three, add two later. Most teams only need utm_source, utm_medium, and utm_campaign to get meaningful insights. Add utm_term and utm_content when you have a specific analysis need, like paid keyword optimization or in-email click tracking, not by default.


You’ve now met all five parameters. Before moving on, see how an analytics platform actually reads the two that matter most, and what happens when a value is typed by hand. (Chapter 11 goes deep on these classification rules.)

TRY IT · How GA4 reads your link

yoursite.com/spring?utm_source=facebook&utm_medium=paid_social&utm_campaign=spring_sale-shoes-2026_03

Session sourceSession mediumDefault channel group
facebookpaid_socialPaid Social

"paid_social" matches GA4's paid pattern (case ignored: channel definitions aren't case sensitive) and facebook is a recognized social site → Paid Social.

Keeping each dimension in its own parameter is what makes cross-dimensional reporting possible: analyze a single campaign across all source/medium combinations, or compare every campaign within a single channel.

Avoid flattening everything into utm_campaign. A value like utm_campaign=summer_sale_2025_facebook_social_video_ad_A makes it impossible to separately filter by campaign, channel, or creative. Keep each parameter’s data separate.

Bad

  • ?utm_campaign=summer_sale_2025_facebook_social_video_ad_A
    • everything crammed into one field: can't filter or compare

Good

  • ?utm_source=facebook&utm_medium=paid_social&utm_campaign=summer_sale-2025&utm_content=video_ad_a
    • each dimension in its own field: filter, pivot, and compare freely

Beyond these five standard parameters, there are additional tracking mechanisms: custom parameters like cid, platform-specific click identifiers like gclid and fbclid, and Google’s utm_id. Chapter 6 covers them, for teams that need more than the standard five.


The short version: Query parameters must come before the # fragment or they get silently dropped. Referrer data can’t carry campaign context, which is the entire reason UTMs exist. And each of the five parameters answers exactly one question: where (source), how (medium), why (campaign), which keyword (term), which variation (content).

Next upChapter 3: Your First Taxonomy