Table of Contents
- How Redirects Can Lose Campaign Parameters
- Five Redirect Tracking Mistakes
- 1. Redirect Rules That Do Not Preserve Query Parameters
- 2. HTTP to HTTPS Protocol Upgrades Dropping Parameters
- 3. Trailing Slash Mismatches (/landing vs /landing/)
- 4. CDN Edge Rules Stripping Unrecognized Query Strings
- 5. Client-Side JavaScript Redirects That Forget window.location.search
- Server Configuration Fixes for Apache and Nginx
- Frequently Asked Questions
A redirect that drops campaign parameters can leave GA4 without the source information you expected. Check each hop and the final landing URL before blaming the redirect. This guide covers five ways query strings can change.
How Redirects Can Lose Campaign Parameters
When a web server returns an HTTP 301 (Moved Permanently) or 302 (Found) status code, it sends a Location header instructing the browser where to go next. Whether the next URL includes the incoming query string depends on the redirect rule and server configuration. Inspect the response's Location header and the final URL to see whether the campaign parameters were preserved.
Five Redirect Tracking Mistakes
1. Redirect Rules That Do Not Preserve Query Parameters
[QSA] is an Apache mod_rewrite flag. It appends an incoming query string when the rewrite substitution already contains a query string; it is not a universal redirect setting. For a path-only redirect, inspect Apache's resulting Location header rather than assuming the flag is required.
2. HTTP to HTTPS Protocol Upgrades Dropping Parameters
Ad links pointing to http://example.com that redirect to https://example.com can drop parameters if the SSL redirection rule is misconfigured.
3. Trailing Slash Mismatches (/landing vs /landing/)
Most content management systems (WordPress, Webflow) enforce canonical trailing slashes. Advertising /promo?utm_source=... causes the CMS to redirect to /promo/?utm_source=.... If poorly coded, the query parameters disappear.
4. CDN Edge Rules Stripping Unrecognized Query Strings
Aggressive CDN caching rules (Cloudflare, Fastly) configured to optimize cache hit ratios may strip query strings before passing requests to your origin server.
5. Client-Side JavaScript Redirects That Forget window.location.search
A script that changes the URL to /new-page can drop the existing query string. Check whether the analytics tag collected the campaign values before that change and whether later pages need them.
Server Configuration Fixes for Apache and Nginx
Redirect query-string behavior depends on the server and rule. In Apache mod_rewrite, [QSA] is relevant when the substitution already creates a query string and the incoming query also needs to be appended. For a path-only substitution, inspect the resulting Location header:
RewriteRule ^old-page$ /new-page [R=301,L]
For a manual Nginx return redirect, include the incoming query string when it should be retained. A rewrite can preserve it automatically, so inspect the actual rule rather than adding arguments twice.
return 301 https://example.com/new-page$is_args$args;
Frequently Asked Questions
How can I tell if a redirect is stripping my UTM parameters?
Open an incognito browser window, open DevTools Network tab, paste your tagged URL, and check the 301/302 response Location header. If the query string is absent in the Location URL, your parameters are being stripped.
Does a 301 redirect pass Google Ads GCLID?
A redirect may preserve or remove the incoming query string depending on its configuration. If the gclid is removed, GA4 may lose Google Ads information; the final classification depends on other traffic-source data it receives. Check the redirect response and final URL.
For the broader setup, read 15 UTM Tracking Mistakes That Ruin Your GA4 Data (and How to Fix Them). Browse the UTM Mistakes & Tracking Audits guides to choose another troubleshooting task.
References
- RFC 9110: HTTP Semantics - Redirection 3xx (IETF)
- Apache Module mod_rewrite Documentation: Flag QSA (Apache Software Foundation)