best-practicesUpdated 2025

UTM Value Formatting Rules: Style Guide for Consistent Tracking

Standardize UTM parameter formatting across your team. Complete style guide covering case, separators, special characters, and length limits.

9 min readbest-practices

Your team uses "Facebook", "facebook", and "fb" interchangeably. GA4 shows three separate sources.

Inconsistent formatting fragments data. Here's your complete UTM formatting style guide.

🚨 Not sure what's breaking your tracking?

Run a free 60-second audit to check all 40+ ways UTM tracking can fail.

Scan Your Campaigns Free

✓ No credit card ✓ See results instantly

Why Formatting Matters

Without formatting rules:

  • Same campaign appears as multiple values
  • Data fragments across reports
  • Attribution becomes unreliable
  • Team members create conflicting URLs

With formatting rules:

  • Consistent data across all campaigns
  • Reliable reporting
  • Easy campaign identification
  • Scalable tracking system

Core Formatting Rules

Rule 1: Use Lowercase

Code
✅ CORRECT:
utm_source=facebook
utm_medium=cpc
utm_campaign=spring_sale

❌ WRONG (fragments data):
utm_source=Facebook
utm_source=FACEBOOK
utm_source=FaceBook

Why: GA4 is case-sensitive. "Facebook" ≠ "facebook".

Exception: Brand names that require specific casing can use title case, but document and enforce consistently.

Rule 2: Use Underscores for Spaces

Code
✅ CORRECT:
utm_campaign=spring_sale_2024
utm_content=hero_banner

❌ AVOID (requires encoding):
utm_campaign=spring sale 2024
utm_campaign=spring%20sale%202024

❌ AVOID (less readable):
utm_campaign=springsale2024

Why: Underscores are URL-safe, readable, and need no encoding.

Alternative: Hyphens are also acceptable if used consistently.

Rule 3: No Special Characters

Code
✅ CORRECT:
utm_campaign=save_20_percent
utm_content=buy_and_save

❌ WRONG (breaks tracking):
utm_campaign=save-20%-off
utm_campaign=buy&save
utm_campaign=spring/summer

Banned characters: & = ? # % + / \ < > " '

Safe characters: a-z 0-9 - _ . ~

Rule 4: Use Descriptive But Concise Names

Code
✅ CORRECT:
utm_campaign=spring_sale_2024
utm_source=newsletter_weekly
utm_content=cta_button

❌ TOO LONG:
utm_campaign=spring_summer_seasonal_sale_promotion_2024_limited_time_offer

❌ TOO SHORT:
utm_campaign=ss24
utm_source=nl
utm_content=btn

Target length: 15-30 characters per parameter

Rule 5: Use Standard Values

Code
APPROVED VALUES:

utm_source:
- facebook, instagram, twitter, linkedin
- google, bing, duckduckgo
- newsletter, email_blast
- youtube, tiktok

utm_medium:
- cpc, paid, organic
- email, social, referral
- display, video, affiliate

utm_campaign:
- `{"{"}{"{"}season{"}"}{"}"}}`_`{"{"}{"{"}year{"}"}{"}"}}` (spring_2024)
- `{"{"}{"{"}product{"}"}{"}"}}`_`{"{"}{"{"}promo{"}"}{"}"}}` (shoes_sale)
- `{"{"}{"{"}event{"}"}{"}"}}`_`{"{"}{"{"}type{"}"}{"}"}}` (webinar_signup)

😰 Is this your only tracking issue?

This is just 1 of 40+ ways UTM tracking breaks. Most marketing teams have 8-12 critical issues they don't know about.

• 94% of sites have UTM errors

• Average: $8,400/month in wasted ad spend

• Fix time: 15 minutes with our report

✓ Connects directly to GA4 (read-only, secure)

✓ Scans 90 days of data in 2 minutes

✓ Prioritizes issues by revenue impact

✓ Shows exact sessions affected

Get Your Free Audit Report

Parameter-Specific Guidelines

utm_source (Traffic Source)

Code
Purpose: Where traffic originates

Format: lowercase_platform_name

Examples:
✅ facebook
✅ google_ads
✅ newsletter_weekly
✅ partner_site_name

❌ Facebook Ads (mixed case)
❌ fb (too abbreviated)
❌ google-cpc (medium info in source)

utm_medium (Marketing Medium)

Code
Purpose: Type of marketing activity

Format: lowercase_category

Standard values:
✅ cpc (cost-per-click ads)
✅ organic (unpaid search/social)
✅ email (email marketing)
✅ social (organic social)
✅ referral (link from other site)
✅ display (banner ads)
✅ video (video ads)
✅ affiliate (affiliate links)

Custom values OK if documented:
✅ podcast_ad
✅ influencer_post
✅ sms_campaign

utm_campaign (Campaign Name)

Code
Purpose: Specific promotion or initiative

Format: descriptive_name_with_context

Pattern: `{"{"}{"{"}theme{"}"}{"}"}}`_{year/quarter} or `{"{"}{"{"}product{"}"}{"}"}}`_`{"{"}{"{"}promo{"}"}{"}"}}`

Examples:
✅ spring_sale_2024
✅ new_product_launch
✅ webinar_q1_2024
✅ black_friday_2024

❌ campaign1 (not descriptive)
❌ SPRING-SALE (uppercase)
❌ spring sale (unencoded space)

utm_content (Content Differentiator)

Code
Purpose: Distinguish ads/links in same campaign

Format: specific_identifier

Examples:
✅ hero_banner
✅ sidebar_ad
✅ cta_button_blue
✅ email_header

❌ ad1 (not descriptive)
❌ HeroBanner (mixed case)

utm_term (Paid Search Keywords)

Code
Purpose: Paid search keyword (or custom use)

Format: keyword_phrase (lowercase, underscores)

Examples:
✅ running_shoes
✅ best_crm_software
✅ `{"{"}{"{"}keyword{"}"}{"}"}}` (dynamic insert)

Usually auto-populated by ad platforms

Naming Convention Patterns

Pattern 1: Hierarchical

Code
Structure: `{"{"}{"{"}category{"}"}{"}"}}`_`{"{"}{"{"}subcategory{"}"}{"}"}}`_`{"{"}{"{"}specific{"}"}{"}"}}`

Examples:
utm_source=social_facebook_ads
utm_campaign=product_shoes_spring_sale
utm_content=banner_hero_desktop

Pattern 2: Date-Based

Code
Structure: `{"{"}{"{"}theme{"}"}{"}"}}`_`{"{"}{"{"}year{"}"}{"}"}}`_{quarter/month}

Examples:
utm_campaign=sale_2024_q1
utm_campaign=webinar_2024_03
utm_content=email_2024_week_12

Pattern 3: A/B Testing

Code
Structure: `{"{"}{"{"}base_name{"}"}{"}"}}`_`{"{"}{"{"}variant{"}"}{"}"}}`

Examples:
utm_content=cta_button_red
utm_content=cta_button_blue
utm_campaign=spring_sale_short_copy
utm_campaign=spring_sale_long_copy

Validation Checklist

Javascript
function validateUtmFormat(url) {
    const issues = [];
    const params = new URL(url).searchParams;
 
    // Check each UTM parameter
    ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'].forEach(key => {
        const value = params.get(key);
 
        if (!value) return; // Skip if not present
 
        // Rule 1: Lowercase only
        if (value !== value.toLowerCase()) {
            issues.push({
                param: key,
                rule: 'Lowercase',
                current: value,
                fix: value.toLowerCase()
            });
        }
 
        // Rule 2: No spaces
        if (value.includes(' ')) {
            issues.push({
                param: key,
                rule: 'No spaces',
                current: value,
                fix: value.replace(/\s+/g, '_')
            });
        }
 
        // Rule 3: No special characters
        if (value.match(/[&=?#%+\/\\<>"']/)) {
            issues.push({
                param: key,
                rule: 'No special characters',
                current: value,
                fix: 'Remove or encode special characters'
            });
        }
 
        // Rule 4: Length check
        if (value.length > 50) {
            issues.push({
                param: key,
                rule: 'Too long',
                length: value.length,
                fix: 'Consider shortening'
            });
        }
 
        if (value.length < 2) {
            issues.push({
                param: key,
                rule: 'Too short',
                current: value,
                fix: 'Use more descriptive name'
            });
        }
    });
 
    return {
        valid: issues.length === 0,
        issues
    };
}

Team Implementation

Step 1: Create Approved Values List

Javascript
// utm-standards.js
export const UTM_STANDARDS = {
    sources: [
        'facebook', 'instagram', 'twitter', 'linkedin',
        'google', 'bing', 'youtube',
        'newsletter', 'email_blast',
        'partner_site'
    ],
    mediums: [
        'cpc', 'organic', 'email', 'social',
        'referral', 'display', 'video', 'affiliate'
    ],
    campaignPatterns: [
        '`{"{"}{"{"}season{"}"}{"}"}}`_`{"{"}{"{"}year{"}"}{"}"}}`',      // spring_2024
        '`{"{"}{"{"}product{"}"}{"}"}}`_`{"{"}{"{"}promo{"}"}{"}"}}`',    // shoes_sale
        '`{"{"}{"{"}event{"}"}{"}"}}`_`{"{"}{"{"}type{"}"}{"}"}}`'        // webinar_signup
    ]
};

Step 2: Build Validator

Javascript
function validateAgainstStandards(url) {
    const params = new URL(url).searchParams;
    const warnings = [];
 
    // Check source against approved list
    const source = params.get('utm_source');
    if (source && !UTM_STANDARDS.sources.includes(source)) {
        warnings.push({
            param: 'utm_source',
            value: source,
            message: 'Not in approved source list'
        });
    }
 
    // Check medium against approved list
    const medium = params.get('utm_medium');
    if (medium && !UTM_STANDARDS.mediums.includes(medium)) {
        warnings.push({
            param: 'utm_medium',
            value: medium,
            message: 'Not in approved medium list'
        });
    }
 
    return warnings;
}

Step 3: Document & Distribute

Markdown
# UTM Formatting Style Guide
 
## Core Rules
1. Lowercase only
2. Use underscores for spaces
3. No special characters
4. 15-30 characters per parameter
5. Use approved values
 
## Approved Values
 
### utm_source
- facebook, instagram, twitter, linkedin
- google, bing, youtube
- newsletter, email_blast
 
### utm_medium
- cpc, organic, email, social
- referral, display, video
 
### Campaign Naming
Pattern: `{"{"}{"{"}theme{"}"}{"}"}}`_`{"{"}{"{"}year{"}"}{"}"}}` or `{"{"}{"{"}product{"}"}{"}"}}`_`{"{"}{"{"}promo{"}"}{"}"}}`
Example: spring_sale_2024
 
## Examples
✅ utm_source=facebook&utm_medium=cpc&utm_campaign=spring_sale_2024
❌ utm_source=Facebook&utm_medium=CPC&utm_campaign=Spring Sale 2024

✅ Fixed this issue? Great! Now check the other 39...

You just fixed one tracking issue. But are your Google Ads doubling sessions? Is Facebook attribution broken? Are internal links overwriting campaigns?

Connects to GA4 (read-only, OAuth secured)

Scans 90 days of traffic in 2 minutes

Prioritizes by revenue impact

Free forever for monthly audits

Run Complete UTM Audit (Free Forever)

Join 2,847 marketers fixing their tracking daily

FAQ

Can I use hyphens instead of underscores?

Yes, if used consistently across all campaigns. Choose one and document it.

What about brand names with capital letters?

Prefer lowercase for consistency. If brand requirements dictate capitals, document exception and apply consistently.

How do I handle very long campaign names?

Abbreviate intelligently: "black_friday_sale" not "bfs", "webinar_registration" not "webinar_reg".

Should I include dates in campaign names?

Yes, for temporal campaigns: "spring_sale_2024", "webinar_2024_q1". Helps with historical analysis.

Conclusion

Consistent UTM formatting prevents data fragmentation and improves reporting reliability.

Core Rules:

  1. Lowercase
  2. Underscores for spaces
  3. No special characters
  4. Descriptive but concise
  5. Use standard approved values

Document your formatting rules and enforce through validation before campaign launch.


Technical Reference: UTM Validation Rules

UTM

Get Your Free Audit in 60 Seconds

Connect GA4, run the scan, and see exactly where tracking is leaking budget. No credit card required.

Trusted by growth teams and agencies to keep attribution clean.