What This Rule Detects
Detects when UTM parameters appear in the URL path structure (like /utm_source/facebook/utm_medium/cpc) instead of the query string (like ?utm_source=facebook&utm_medium=cpc). When UTMs are in the path, browsers and analytics tools treat them as literal folder names, not tracking parameters, causing 100% tracking failure.
š 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 - GA4 receives zero UTM data
- All campaigns appear as Direct - Cannot attribute traffic to sources
- ROI measurement impossible - No way to track campaign performance
- Budget waste - Spending on campaigns with no attribution
- 404 errors possible - If path doesn't actually exist on server
Technical Impact:
- Web servers parse everything before
?as the URL path - UTM parameters become literal folder/file names:
/utm_source/facebook/ - GA4 only recognizes parameters after
?in query string format - Page path fragmentation: Each parameter combination creates unique path
- Analytics tools cannot extract utm_source, utm_medium, utm_campaign values
Real Example:
- Your ad URL:
example.com/products/utm_source/facebook/utm_medium/cpc - GA4 sees page path:
/products/utm_source/facebook/utm_medium/cpc - GA4 source: Direct (not Facebook)
- GA4 medium: (none) (not cpc)
- Result: 1,000 sessions from $3,000 Facebook campaign show as Direct traffic
Common Scenarios
Scenario 1: REST API-Style Parameter Formatting
Developer mistakes URL routing for query parameters:
Scenario 2: Slug-Based Parameter Embedding
Content management systems with custom URL structures:
Scenario 3: Folder Structure Misunderstanding
Treating UTM parameters like directory navigation:
š° 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 URL Path vs Query String
URL Anatomy:
https://example.com/products/shoes?utm_source=facebook&size=10#reviews
ā ā ā ā ā
ā ā ā ā āā Fragment (anchor)
ā ā ā āā Other query params
ā ā āā Query string (UTM params go here!)
ā āā URL path (NOT for UTM params)
āā Domain
Critical distinction:
-
Path (before
?): Server-side routing, folder structure, page identification- Example:
/products/shoes/nike-air-max - Purpose: Tell server which page to load
- Example:
-
Query String (after
?): Client & server parameters, tracking data- Example:
?utm_source=facebook&utm_medium=cpc - Purpose: Pass data to page (including analytics tracking)
- Example:
Step 2: Identify Path-Based UTM Parameters
Check your URLs for these patterns:
ā /utm_source/facebook
ā /source-facebook/medium-cpc
ā /campaign/summer-sale
ā /traffic/google/paid
ā /facebook-ad-campaign
ā
?utm_source=facebook (correct!)
Red flags:
- UTM parameter names appear before
?character - Slashes (/) separating parameter names and values
- Hyphens (-) joining "utm-source" or "source-value" in path
- No
?character in URL at all
Step 3: Convert Path Parameters to Query String
Conversion formula:
Path format: /utm_source/VALUE/utm_medium/VALUE/utm_campaign/VALUE
Query format: ?utm_source=VALUE&utm_medium=VALUE&utm_campaign=VALUE
Example conversions:
ā Before: example.com/products/utm_source/facebook/utm_medium/cpc
ā
After: example.com/products?utm_source=facebook&utm_medium=cpc
ā Before: example.com/landing/source-email/medium-newsletter
ā
After: example.com/landing?utm_source=email&utm_medium=newsletter
ā Before: example.com/campaign/google/cpc/shoes
ā
After: example.com?utm_source=google&utm_medium=cpc&utm_campaign=shoes
Step 4: Fix All Campaign URLs
Update process:
- Identify all campaigns using path-based parameters
- Extract parameter values from the path
- Reconstruct using proper query string format
- Update URLs in all platforms:
- Email service providers
- Social media ad platforms
- Affiliate partner links
- QR code destinations
- Printed materials
- Test each corrected URL
- Monitor GA4 Real-Time to verify tracking
Bulk fix strategy:
- Export all campaign URLs to spreadsheet
- Use formulas to identify path-based parameters
- Auto-convert to query string format
- Review conversions manually
- Update all platforms simultaneously
- Verify tracking within 24 hours
Step 5: Prevent Future Errors
Prevention checklist:
- ā Always use URL builder tools (auto-generate correct format)
- ā
Create URL templates with
?and&pre-formatted - ā
Document: "UTM parameters MUST come after
?symbol" - ā Test all URLs before launching campaigns
- ā Use UTMGuard to audit URLs automatically
Developer note:
If you need path-based routing (e.g., /products/category/shoes), keep it BEFORE the ?:
ā
Correct: example.com/products/shoes?utm_source=facebook
ā Wrong: example.com/products/utm_source/facebook/shoes
Examples
ā Incorrect Examples
https://example.com/landing/utm_source/google/utm_medium/cpc
Result: GA4 page path = "/landing/utm_source/google/utm_medium/cpc"
utm_source = (not set)
utm_medium = (not set)
Impact: 100% tracking failure, appears as Direct traffic
Possible 404: Server may not have this path configured
https://shop.com/products/source-facebook/medium-social/campaign-spring
Result: Page path = "/products/source-facebook/medium-social/campaign-spring"
No UTM parameters captured
Impact: Campaign invisible in analytics, appears as Direct
May create unique page entries: Fragments reporting
https://example.com/promo/email-newsletter-march-2024
Result: Page path = "/promo/email-newsletter-march-2024"
Cannot extract source, medium, or campaign
Impact: Email campaign performance unmeasurable
ā Correct Examples
https://example.com/landing?utm_source=google&utm_medium=cpc
Result: Page path = "/landing"
utm_source = "google"
utm_medium = "cpc"
Tracking: SUCCESS (attributed to Paid Search channel)
https://shop.com/products?utm_source=facebook&utm_medium=social&utm_campaign=spring
Result: Page path = "/products"
All three UTM parameters captured
Tracking: SUCCESS (attributed to Organic Social channel)
https://example.com/promo?utm_source=newsletter&utm_medium=email&utm_campaign=march-2024
Result: Page path = "/promo"
Complete email campaign tracking
Tracking: SUCCESS (attributed to Email channel)
GA4 Impact Analysis
Session Attribution:
- Path-based UTMs: Source = "Direct", Medium = "(none)"
- Query string UTMs: Source = actual value, Medium = actual value
- Result: 100% of traffic misattributed to Direct channel
Channel Grouping:
- All traffic appears in "Direct" channel
- Paid campaigns show 0 sessions
- Email campaigns show 0 sessions
- Social campaigns show 0 sessions
- Makes channel analysis completely impossible
Page Path Fragmentation:
- Each parameter combination creates a unique page path entry
- Example:
/landing/utm_source/facebook/landing/utm_source/google/landing/utm_source/email- Result: 3 separate page entries instead of 1 landing page
- Makes page performance analysis unreliable
- Top Pages report fragmented across dozens of entries
Conversion Attribution:
- E-commerce revenue: 100% attributed to Direct
- Lead forms: Cannot identify lead source
- Goal completions: No campaign attribution
- Multi-touch attribution: Breaks entire funnel tracking
Technical Errors:
- 404 Not Found: If path doesn't exist on server
- Broken links: Users cannot access intended page
- SEO impact: Search engines may index broken parameter paths
- Duplicate content: Same page accessible via multiple paths
Detection in UTMGuard
UTMGuard automatically identifies path-based UTM parameters:
- Scans all page URLs in GA4 data
- Pattern matching for "utm_source", "utm_medium", "utm_campaign" in paths
- Identifies parameters before
?character - Validates query string is empty or missing UTM data
- Reports affected URLs and session counts
- Suggests corrected query string format
Audit Report Shows:
- Total sessions with path-based UTMs
- List of malformed URLs
- Suggested corrected format
- Session count per broken URL
- Revenue impact of misattributed traffic
Related Validation Rules
Related Validation Rules
Frequently Asked Questions
Q: Can UTM parameters ever be in the URL path?
A: No. UTM parameters must ALWAYS be in the query string (after ?). Path-based parameters are never recognized by GA4 or any analytics platform.
Q: What if my CMS automatically puts parameters in the path?
A: Your CMS is misconfigured. UTM parameters should never be in paths. Check your URL rewriting rules, permalink settings, or contact your developer to fix the routing logic.
Q: Will fixing this create duplicate page entries?
A: No, it fixes fragmentation. Path-based UTMs create duplicates. Moving parameters to query string consolidates all traffic to a single page path.
Q: Do I need to redirect old URLs to new format?
A: If old path-based URLs are bookmarked or indexed, yes. Create 301 redirects from path-based URLs to query string format to preserve link equity and user experience.
Q: Can I mix path parameters and query parameters?
A: Yes! Use path for actual routing (e.g., /products/shoes) and query string for tracking (e.g., ?utm_source=facebook). Never put UTM tracking in the path.
Q: What if my server uses path-based routing for other purposes?
A: That's fine for non-UTM parameters. Keep your routing logic (like /products/category/shoes) but add UTM tracking in query string: /products/category/shoes?utm_source=facebook.
Q: Will this affect my SEO?
A: Path-based UTMs can hurt SEO by creating duplicate content and 404 errors. Moving to query strings improves SEO by consolidating pages and eliminating broken paths.
Q: How do I test if the fix worked?
A: Click your corrected URL. Check GA4 Real-Time reports. You should see the traffic attributed to your utm_source and utm_medium values, not Direct.
External Resources
- RFC 3986: URI Syntax (Path vs Query)
- Google Analytics: Campaign URL Builder
- W3C: URL Structure Standard
- Google Analytics: Custom Campaign Parameters
ā 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
utm_in_path