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 AuditWhy 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
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:
- Export all campaign URLs to spreadsheet
- Use find/replace: Find " " (space), Replace with "-" (hyphen)
- Review changes manually
- Test 5-10 sample URLs
- 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:
- Scans all page URLs in your GA4 data
- Identifies space characters in query parameters
- Checks for unencoded spaces (literal space vs %20)
- Reports affected URLs and session counts
- Suggests hyphenated alternatives
- 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
Related Validation Rules
Related Validation Rules
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
- RFC 3986: URL Character Encoding
- Google Campaign URL Builder
- W3C URL Encoding Reference
- MDN: Encoding URLs
ā 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
Join 2,847 marketers fixing their tracking daily
url_encoding_issues