On this page
What this issue is
The query string is the part of a URL after the ?, such as ?utm_source=google&gclid=abc123. It carries your campaign tags and ad click IDs. A server redirect is a response (usually a 301 or 302) that tells the browser to go to another address.
This issue happens when the redirect target is written as a plain path, like /, and the query string is not added to it. The visitor lands on the right page, but the address no longer holds any tracking data. Because analytics tags read the URL on arrival, they never see the parameters.
- Ad click/old-offer?utm_source=google&gclid=abc123
- Server 301 to /Query string not carried over
- Landing pageURL is just /
- Analytics and ad tagsNo gclid or UTMs to read
- ConversionCounted as direct or unmatched
The ad click is fine. The redirect is the break, and everything after it works with no campaign data.
Why it costs you leads or sales
You still get the visitor, but you lose the proof of where they came from. Paid traffic gets reported as direct, so channels look worse than they are and budgets get cut for the wrong reasons. Google Ads and Meta cannot link the conversion to the click, which weakens automated bidding and optimisation.
Example: the same 100 real paid conversions, reported with and without the redirect stripping the query string.
The tagged URL goes in, a bare URL comes out.
How to check if your site has it
Build a test URL
Take a URL that is redirected, such as an old page, the non-canonical host or a campaign link, and add
?utm_source=test&utm_medium=cpc&gclid=TEST123.Follow the redirect
Open it in a browser and look at the address bar after the page loads. If the parameters are gone, the redirect dropped them.
Inspect the headers
Run the command below and read the Location header of each hop. A Location of
/with no query string confirms the problem.Check every hop
Chains such as http to https to www to a final page can each drop parameters. Test each one.
curl -sIL "https://example.com/old-offer?utm_source=test&gclid=TEST123" | grep -iE "^(HTTP|location)"How to fix it
The fix is the same everywhere: make the redirect pass the original query string to the target. How you do it depends on where the rule lives. Find the rule first, since it may be in the server config, a plugin, your CMS or a CDN.
Apache .htaccess with mod_rewrite
Add the QSA flag (query string append) or let the rule pass it through. Example:
RewriteRule ^old-offer/?$ / [R=301,L,QSA]. Note that withmod_rewrite, a target without a?already keeps the original query string, but a target ending in?removes it. Delete any trailing?.Apache mod_alias Redirect
Redirect 301 /old-offer /new-offerkeeps the query string by default. If you usedRedirectMatch, make sure the target does not end in?.nginx
Use
return 301 /new-offer$is_args$args;instead ofreturn 301 /new-offer;. Withrewrite, a trailing?on the target removes arguments, so remove it.
Find the redirect source
Check redirect plugins (Redirection, Rank Math, Yoast Premium, Safe Redirect Manager), then
.htaccess, then your host's redirect tool.Pass parameters through
In Redirection, set the source URL match to ignore query parameters and pass them to the target (the 'Query Parameters' option on the redirect, set to 'Ignore & pass parameters to the target'). Other plugins have a similar option, so check its settings.
Review URL redirects
Go to Online Store > Navigation > URL Redirects. Shopify's redirects normally carry the query string, but a redirect to
/can come from an app or theme code.Check apps and theme
Disable geo, language or redirect apps one at a time and retest. Search theme.liquid for
window.locationredirects.
Open 301 redirects
Go to Site settings > Hosting > 301 Redirects. Check each old path and its target, then test with a tagged URL. If a rule drops the parameters, replace it with a direct link to the final page in your campaign URLs and retest.
Check URL Redirect Manager
Open Settings > SEO > URL Redirect Manager (menu names can vary by editor). Test each redirect with a tagged URL, and if a rule drops parameters, point your ad URLs at the final page instead.
Check URL Mappings
Open Settings > Developer Tools > URL Mappings. Test each mapping with a tagged URL. If parameters are dropped, use the final page URL in your ads.
Drops the query string
- RewriteRule ^old-offer/?$ /? [R=301,L]
- Trailing ? clears the query string
- Lands on / with no gclid or UTMs
Keeps the query string
- RewriteRule ^old-offer/?$ / [R=301,L,QSA]
- Original parameters are passed on
- Lands on /?utm_source=...&gclid=...
How to confirm it's fixed
- Clear your browser and CDN cache, since 301s are cached hard.
- Open the tagged test URL and confirm the parameters are still in the address bar after loading.
- Run the curl command and check each Location header contains the query string.
- In GA4 Realtime or DebugView, check that the visit shows your test source and medium.
- Check the cookies the page sets (for example
_gcl_aw) to confirm the click ID was stored. - Test the http, https, www and non-www versions of the URL.
How to prevent it happening again
Redirects get added during migrations, SEO clean-ups and plugin installs, often by people who never test with campaign URLs. Keep a short list of rules and test each one with a tagged URL when it is added.
- Always test redirects with a URL that has utm_ and gclid parameters.
- Never end a redirect target with a bare
?unless you mean to clear it. - Point ads at final URLs, not at redirected ones.
- Keep all redirect rules in one place and note who owns them.
- Re-test after site migrations, plugin updates, CDN changes and new language or geo rules.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor opens your landing page with test parameters added (marked as FunnelGuard test traffic), follows the redirects, and compares what arrives with what was sent. It then checks whether the parameters persist, meaning they are still in the final URL and stored where your tags expect them.
If the query string is lost, you get one alert, after the failure is re-checked from a second region, with a screenshot and a likely cause. It checks the journeys you set up, on a schedule, so it will not find every redirect on your site. The Free plan covers 1 site and 2 journeys with daily checks and no card.
Frequently asked questions
The most common questions are answered below.
Questions people ask
Why is my 301 redirect removing UTM parameters?
The rule most likely sends visitors to a fixed address such as / without adding the original query string. A trailing ? in an Apache or nginx rewrite target also clears it. Change the rule so the query string is passed through.
How do I keep the query string in an htaccess redirect?
With mod_rewrite, add the QSA flag and make sure the target has no trailing ?, for example RewriteRule ^old/?$ /new [R=301,L,QSA]. A plain Redirect 301 from mod_alias already keeps the query string. Test with a tagged URL afterwards.
How do I keep the query string in an nginx redirect?
Use return 301 /new-page$is_args$args;. This adds a ? only when there are arguments and appends them. Avoid a trailing ? on rewrite targets, as it removes the arguments.
Why is my gclid missing after a redirect?
The redirect probably removed it with the rest of the query string. Because gclid is read from the landing URL, it is never stored. Fix the redirect or send ads to the final URL.
How can I test whether a redirect drops my tracking parameters?
Add ?utm_source=test&gclid=TEST123 to the redirected URL and open it. If the address bar loses the parameters, or curl -sIL shows a Location header without them, the redirect drops them.
Does a 301 redirect hurt Google Ads tracking?
A 301 is fine when it keeps the query string. It hurts tracking only when it drops gclid and other parameters before the page loads. Auto-tagging also needs the final page to receive the gclid.
Can FunnelGuard tell me if my redirect strips UTMs?
Yes. It loads your page with marked test parameters, follows the redirects and checks whether they are still there and stored. It alerts you with a screenshot and a likely cause when they are lost.
Related issues
- TRK-311UTMs lost on redirect (http->https, www, trailing slash)Fix guide
- TRK-335Language/geo redirect drops click IDsFix guide
- TRK-336A/B testing tool redirect drops UTMsFix guide
- TRK-333Shortener/redirect link (bit.ly, Linktree) strips UTMsFix guide
- TRK-322fbclid/gclid trigger 404 or WAF block on landing pageFix guide
- TRK-312UTMs lost when moving from landing page to form pageFix guide