troubleshootingUpdated 2025

UTM Folder Structure Error: Common CMS Mistake

Your CMS is turning UTM parameters into folder paths. GA4 can't track them. Here's how to fix WordPress, Webflow, and other platforms.

7 min readtroubleshooting

Your WordPress site just broke all your UTM tracking. Your "SEO-friendly" URL settings converted:

Code
site.com/page?utm_source=facebook

Into:

Code
site.com/page/utm_source/facebook/

GA4 shows zero campaign data. Your CMS turned UTM parameters into folder paths.

🚨 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

The Problem: CMS URL Rewriting

Modern CMS platforms offer "pretty URLs" or "SEO-friendly URLs." They convert query parameters into path segments:

Before (working):

Code
blog.com/article?utm_source=newsletter&utm_campaign=weekly

After "SEO optimization" (broken):

Code
blog.com/article/utm_source/newsletter/utm_campaign/weekly/

Result: GA4 can't read UTMs in folder paths. All traffic shows as "Direct."

Why CMS Platforms Do This

The SEO Myth

Some marketers believe:

  • Query parameters (?) look "ugly"
  • Folder paths (/) look "cleaner"
  • Search engines prefer paths over parameters

The truth:

  • Google handles query parameters perfectly
  • UTM parameters don't affect SEO
  • "Pretty URLs" break analytics tracking

The Technical Reality

Search engines like Google: ✅ Index query parameters correctly ✅ Ignore UTM parameters when ranking ✅ Use canonical tags to handle duplicates

Analytics platforms like GA4: ❌ Don't read UTMs from URL paths ✅ Only read UTMs from query strings ❌ Can't extract path-based parameters automatically

😰 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

Platform-Specific Fixes

WordPress

Problem: Permalink settings converting query parameters to paths.

Check current settings:

Code
WordPress Admin → Settings → Permalinks

❌ WRONG (if using custom structure with UTM variables):
Custom Structure: /%postname%/%utm_source%/%utm_medium%/

✅ CORRECT (default or simple):
Post name: /%postname%/

Fix Steps:

  1. Disable custom UTM permalink structure

    Code
    Settings → Permalinks
    Select: Post name (/%postname%/)
    Save Changes
    
  2. Remove URL rewrite rules

    Php
    // If you added custom rewrite rules, remove them:
    // In theme's functions.php or custom plugin
     
    // ❌ Remove this:
    add_rewrite_rule('^article/utm_source/([^/]+)/?', 'index.php?...', 'top');
  3. Flush rewrite rules

    Code
    Settings → Permalinks → Save Changes
    (This regenerates .htaccess)
    
  4. Test

    Code
    Visit: site.com/article?utm_source=test
    Check GA4 Real-Time: Should show campaign
    

Webflow

Problem: CMS collection URL structure including UTM parameters.

Fix:

Code
Webflow CMS Settings → Collection Settings → URL Structure

❌ WRONG:
/blog/`{"{"}{"{"}slug{"}"}{"}"}}`/`{"{"}{"{"}utm_source{"}"}{"}"}}`/`{"{"}{"{"}utm_medium{"}"}{"}"}}`

✅ CORRECT:
/blog/`{"{"}{"{"}slug{"}"}{"}"}}`

Add UTMs in query string when linking, not in URL structure template.

Squarespace

Problem: Advanced URL settings converting parameters to paths.

Fix:

Code
Settings → Advanced → URL Settings

Disable: "Convert query parameters to paths"
(If this option exists in your Squarespace version)

Otherwise, ensure your campaign URLs use standard query string format.

Custom CMS or Framework

Check .htaccess or nginx.conf for rewrite rules:

Apache (.htaccess):

Apache
# ❌ Remove rules like this:
RewriteRule ^page/utm_source/([^/]+)/utm_medium/([^/]+)/?$ /page?utm_source=$1&utm_medium=$2 [L]
 
# If you need path-to-query conversion, use this:
# But better to not generate path-based URLs at all

Nginx:

Nginx
# ❌ Remove rules like this:
rewrite ^/page/utm_source/([^/]+)/utm_medium/([^/]+)/?$ /page?utm_source=$1&utm_medium=$2 last;

Shopify

Problem: App or theme modifying URL structure.

Fix:

Code
1. Check installed apps for URL modification features
2. Disable any "SEO URL optimizer" apps
3. Review theme code for custom URL builders
4. Test campaign URLs in incognito mode

Migration Fix: Redirecting Old URLs

If you already have thousands of path-based URLs published, set up redirects:

Apache (.htaccess)

Apache
# Redirect path-based UTMs to query-based
RewriteEngine On
 
# Single parameter
RewriteRule ^(.+)/utm_source/([^/]+)/?$ /$1?utm_source=$2 [R=301,L,QSA]
 
# Two parameters
RewriteRule ^(.+)/utm_source/([^/]+)/utm_medium/([^/]+)/?$ /$1?utm_source=$2&utm_medium=$3 [R=301,L,QSA]
 
# Three parameters
RewriteRule ^(.+)/utm_source/([^/]+)/utm_medium/([^/]+)/utm_campaign/([^/]+)/?$ /$1?utm_source=$2&utm_medium=$3&utm_campaign=$4 [R=301,L,QSA]

Nginx

Nginx
# Redirect path-based UTMs to query-based
location ~ ^(.+)/utm_source/([^/]+)/utm_medium/([^/]+)/utm_campaign/([^/]+)/?$ {
    return 301 $1?utm_source=$2&utm_medium=$3&utm_campaign=$4;
}
 
location ~ ^(.+)/utm_source/([^/]+)/utm_medium/([^/]+)/?$ {
    return 301 $1?utm_source=$2&utm_medium=$3;
}
 
location ~ ^(.+)/utm_source/([^/]+)/?$ {
    return 301 $1?utm_source=$2;
}

Real Example: WordPress Blog Migration

Site: Health & wellness blog (50,000 monthly visitors) Problem: Developer "optimized" URLs during redesign

Before redesign (working):

Code
healthblog.com/article?utm_source=pinterest&utm_medium=social

After redesign (broken):

Code
healthblog.com/article/source/pinterest/medium/social/

Impact:

  • 3 months of zero campaign attribution
  • Couldn't measure which content performed best
  • Wasted $12,000 in promoted content
  • No idea which channels drove traffic

Discovery process:

  1. Client noticed "Direct" traffic jumped 400%
  2. Social media traffic dropped to near zero
  3. But social media platform analytics showed clicks unchanged
  4. Realized clicks were arriving but not being attributed

Investigation:

Code
Client clicked:
pinterest.com/pin → healthblog.com/article?utm_source=pinterest

Browser landed at:
healthblog.com/article/source/pinterest/medium/social/

Server logs:
GET /article/source/pinterest/medium/social/ HTTP/1.1 200

GA4 tracking code:
utm_source: null
utm_medium: null

Root cause: WordPress permalink structure with custom UTM variables.

Fix implemented:

  1. Changed permalink structure to default
  2. Added .htaccess redirects for old URLs
  3. Updated all active campaign URLs
  4. Retrained content team on correct URL format

Results:

  • Campaign tracking restored within 24 hours
  • Identified Pinterest as #1 traffic source
  • Increased Pinterest content budget by 3x
  • Recovered attribution for future traffic

✅ 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

Why do CMS platforms offer path-based parameters?

For aesthetic reasons ("prettier URLs"), but it breaks analytics. Don't use it for UTM parameters.

Can I convert path-based to query-based automatically?

Yes, with server rewrites, but it's better to generate correct URLs from the start.

What if my SEO consultant insists on path-based URLs?

Explain that Google treats query parameters correctly and UTM parameters don't affect SEO rankings.

Will changing URL structure hurt my SEO?

No. Use 301 redirects from old to new format. Google handles this perfectly.

How do I know if my CMS is doing this?

Check your campaign URLs. If you see /utm_source/value/ instead of ?utm_source=value, your CMS is rewriting URLs.

Can I use path parameters for other data?

Yes (like /products/category/shoes/), but never for UTM parameters. Those must stay in query string.

Conclusion

CMS platforms turning UTM parameters into folder paths breaks GA4 tracking.

Fix:

  1. Disable "pretty URL" features for query parameters
  2. Use standard query string format: ?utm_source=x&utm_medium=y
  3. Set up redirects if you have existing path-based URLs
  4. Test in GA4 Real-Time reports

Remember: UTM parameters belong in query strings (after ?), never in URL paths.


Technical Reference: UTM in Path Validation Rule

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.