šŸ”“CriticalImpact: URL truncation when shared - complete tracking loss
šŸ“„Category: url-syntax

What This Rule Detects

Detects unencoded space characters in URLs. Spaces are not valid URL characters - when present, they cause URLs to be truncated at the first space when shared via email, messaging apps, or social media platforms, losing all tracking parameters that come after the space.

šŸ” Want to scan for this issue automatically?

UTMGuard checks for this and 39 other validation rules in 60 seconds.

Try Free Audit

Why It Matters

Business Impact:

  • 100% tracking loss when URL is shared via email or messaging
  • Broken links - Users cannot reach intended destination
  • Revenue loss - E-commerce links break before checkout
  • Campaign failure - Marketing campaigns become unmeasurable
  • Poor user experience - Links appear broken, reducing trust

Technical Impact:

  • Spaces are not valid characters in URLs per RFC 3986 standard
  • Email clients truncate URLs at first space when rendering links
  • Messaging apps (WhatsApp, Slack, Teams) stop parsing at space
  • Social platforms may reject URLs with spaces entirely
  • Browsers may auto-encode spaces, but sharing breaks URLs first
  • Everything after the space is lost: UTM parameters, query strings, fragments

Real Example:

  • Your URL: example.com?utm_campaign=summer sale&utm_medium=email
  • Email client renders: example.com?utm_campaign=summer (TRUNCATED)
  • Lost: sale&utm_medium=email
  • Recipient clicks shortened URL
  • GA4 receives incomplete data: campaign = "summer", medium = (not set)
  • Result: Partial or complete tracking failure

Common Scenarios

Scenario 1: Spaces in Campaign Names

Using multi-word campaign names without encoding:

Scenario 2: Spaces in Content Parameter

Ad variation names with spaces:

Scenario 3: Spaces in Multiple Parameters

Complex campaign with several spaced values:

😰 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

How to Fix

Step 1: Understand Why Spaces Break URLs

Technical explanation:

  • URLs follow RFC 3986 standard
  • Only specific characters are valid in URLs
  • Space is NOT a valid character
  • When email/messaging apps see a space, they assume the URL ended
  • Everything after the space is treated as regular text, not part of the URL

Truncation example:

Original: https://example.com?utm_campaign=summer sale&utm_medium=email
Email renders: https://example.com?utm_campaign=summer
Lost text: " sale&utm_medium=email" (appears as plain text, not clickable)

Step 2: Choose Your Encoding Strategy

Option A: Replace Spaces with Hyphens (RECOMMENDED)

Why recommended:

  • āœ… Human-readable URLs
  • āœ… Works everywhere (email, social, messaging)
  • āœ… No encoding/decoding needed
  • āœ… Looks professional
  • āœ… Easy to type manually if needed

How to do it:

āŒ "summer sale" → āœ… "summer-sale"
āŒ "new products" → āœ… "new-products"
āŒ "black friday" → āœ… "black-friday"

Option B: URL-Encode Spaces as %20

When to use:

  • When you need to preserve exact spacing for technical reasons
  • When integrating with systems that expect spaces
  • For one-time links that won't be manually typed

How to do it:

āŒ "summer sale" → āœ… "summer%20sale"
āŒ "new products" → āœ… "new%20products"

Comparison:

Hyphens:    utm_campaign=summer-sale (19 chars, readable)
Encoded:    utm_campaign=summer%20sale (23 chars, technical)

Recommendation: Use hyphens for clarity and brevity

Step 3: Fix All Parameter Values

Step-by-step process:

1. Find all spaces in your URL:

Original: example.com?utm_source=partner site&utm_campaign=spring sale 2024
Spaces found: "partner site" (1 space), "spring sale 2024" (2 spaces)

2. Replace with hyphens:

Fixed: example.com?utm_source=partner-site&utm_campaign=spring-sale-2024

3. Verify no spaces remain:

āœ… Check: No space characters in entire URL
āœ… Check: All parameters separated by & (not spaces)
āœ… Check: URL is one continuous string

Step 4: Implement Naming Conventions

Best practices for campaign naming:

Use hyphens instead of spaces:

  • āœ… summer-shoes-2024
  • āœ… black-friday-sale
  • āœ… email-newsletter-march
  • āŒ summer shoes 2024
  • āŒ black friday sale
  • āŒ email newsletter march

Use underscores for multi-part identifiers:

  • āœ… campaign_id_12345
  • āœ… product_category_shoes
  • āŒ campaign id 12345
  • āŒ product category shoes

Combine for complex names:

  • āœ… q1-2024_product-launch_email-series
  • āœ… facebook_summer-sale_carousel-ad

Step 5: Update URLs Across All Platforms

Where to update:

1. Email Service Providers (ESP):

  • Mailchimp: Edit campaign links
  • SendGrid: Update link templates
  • HubSpot: Modify email links
  • Constant Contact: Fix campaign URLs

2. Social Media Platforms:

  • Facebook Ads Manager: Update destination URLs
  • LinkedIn Campaign Manager: Edit link parameters
  • Twitter/X Ads: Fix tweet link destinations
  • Instagram bio links: Update landing pages

3. Paid Advertising:

  • Google Ads: Edit final URLs
  • Microsoft Ads: Update destination URLs
  • Display networks: Fix creative links

4. Other Sources:

  • Affiliate partner links
  • QR code destinations
  • SMS marketing campaigns
  • Printed materials (regenerate before next print run)

Bulk update process:

  1. Export all campaign URLs to spreadsheet
  2. Use find/replace: Find " " (space), Replace with "-" (hyphen)
  3. Review changes manually
  4. Test 5-10 sample URLs
  5. Import corrected URLs back to platforms

Examples

āŒ Incorrect Examples

https://example.com?utm_campaign=summer sale&utm_medium=email
When shared in email:
- Link appears as: https://example.com?utm_campaign=summer
- Plain text after: "sale&utm_medium=email"
- Result: utm_campaign = "summer" (incomplete), utm_medium = (not set)
Impact: Partial tracking failure, campaign name incorrect

https://shop.com/products?utm_source=partner site&utm_campaign=spring promo 2024
When shared in Slack:
- Link truncates at first space
- Only "https://shop.com/products?utm_source=partner" is clickable
- Result: utm_source = "partner" (incomplete), no campaign data
Impact: 100% tracking failure for utm_campaign

https://example.com/landing?utm_content=blue banner ad&utm_term=running shoes
When shared on social media:
- Platform may reject URL entirely
- Or truncates: "https://example.com/landing?utm_content=blue"
- Result: Broken link, user frustration
Impact: Link doesn't work, zero traffic

āœ… Correct Examples

https://example.com?utm_campaign=summer-sale&utm_medium=email
Result: Works perfectly across all platforms
- utm_campaign = "summer-sale"
- utm_medium = "email"
Tracking: SUCCESS (full attribution)

https://shop.com/products?utm_source=partner-site&utm_campaign=spring-promo-2024
Result: URL remains intact when shared
- utm_source = "partner-site"
- utm_campaign = "spring-promo-2024"
Tracking: SUCCESS (complete parameter capture)

https://example.com/landing?utm_content=blue-banner-ad&utm_term=running-shoes
Result: Shareable everywhere (email, social, messaging)
- utm_content = "blue-banner-ad"
- utm_term = "running-shoes"
Tracking: SUCCESS (all parameters preserved)

GA4 Impact Analysis

URL Truncation in Email:

  • Email clients render URLs up to first space only
  • Everything after space appears as plain text
  • Users click truncated URL without UTM parameters
  • GA4 receives incomplete or zero tracking data

Session Attribution:

  • Truncated URLs appear as Direct traffic
  • Partial parameters cause misattribution
  • Example: Campaign name "summer" instead of "summer sale"
  • Creates duplicate campaign entries in reports

Channel Grouping:

  • Missing utm_medium (lost after space) → "Unassigned" channel
  • Partial utm_source values → Wrong channel assignment
  • Complete tracking failure → Direct channel

Data Fragmentation:

  • Same campaign appears in multiple forms:
    • "summer-sale" (correct, from direct clicks)
    • "summer" (truncated, from email shares)
    • "(not set)" (completely lost)
  • Makes campaign consolidation impossible
  • ROI calculation unreliable

Conversion Attribution:

  • E-commerce purchases: Wrong campaign attribution
  • Lead forms: Incomplete source tracking
  • Revenue: Split across truncated variants
  • Multi-touch attribution: Broken journey tracking

Detection in UTMGuard

UTMGuard automatically detects unencoded spaces:

  1. Scans all page URLs in your GA4 data
  2. Identifies space characters in query parameters
  3. Checks for unencoded spaces (literal space vs %20)
  4. Reports affected URLs and session counts
  5. Suggests hyphenated alternatives
  6. Calculates potential traffic loss from URL sharing

Audit Report Shows:

  • Total sessions with spaces in URLs
  • List of malformed parameter values
  • Suggested corrected values with hyphens
  • Estimated sharing impact (email, social, messaging)
  • Before/after examples

Frequently Asked Questions

Q: Why do spaces work when I paste the URL directly into my browser?

A: Browsers auto-encode spaces as %20 when you paste URLs directly. But email clients, messaging apps, and social platforms do NOT auto-encode - they truncate at spaces. The URL works for you but breaks for everyone you share it with.

Q: Should I use %20 or hyphens?

A: Use hyphens for campaign names. They're readable, professional, and work everywhere. Use %20 only when technically required (e.g., preserving exact spacing in form submissions).

Q: What if I already sent emails with spaces in URLs?

A: Historical data is lost. Fix the URLs for future campaigns immediately. Consider resending corrected campaigns if it's a high-value audience.

Q: Do URL shorteners fix this?

A: Only if the DESTINATION URL has no spaces. Shorteners hide the URL, but if the destination has spaces, tracking still fails when users arrive.

Q: Can I use underscores instead of hyphens?

A: Yes! Underscores work perfectly. Choose either hyphens or underscores and be consistent. Recommendation: Use hyphens for readability (summer-sale vs summer_sale).

Q: Will fixing this affect my historical data?

A: No. Historical sessions remain fragmented. The fix prevents future tracking errors. You cannot recover data from truncated historical URLs.

Q: How do I test if a URL will break?

A: Send yourself a test email with the URL. Click the link from your email client (not web interface). Check GA4 Real-Time to see what parameters were captured.

Q: What about spaces in the domain or path?

A: Spaces are invalid ANYWHERE in URLs - domain, path, or query string. Always use hyphens or encoding for all URL components.

External Resources

āœ… 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


Last Updated: November 9, 2025
Rule ID: url_encoding_issues
Severity: Critical
Category: Url Syntax