On this page
What this issue is
A redirect test (also called a split URL test) sends a share of visitors from page A to a different URL, page B. The tool does this with JavaScript in the browser, or with a server or edge rule. The other kind of test, an on-page test, changes the page in place and never changes the URL.
The problem appears when the redirect builds the new address without the query string. A visitor arrives on /offer?utm_source=google&utm_medium=cpc&gclid=abc and lands on /offer-b. The parameters are gone, so analytics and ad platforms never see them.
- Ad clickURL has utm_* and gclid
- Test tool assigns variant BRedirects to /offer-b
- Variant pageNo UTMs or gclid in URL
- ConversionCounted as direct
The ad click is fine. The redirect to the variant drops the parameters, so later steps lose attribution.
Why it costs you leads or sales
Only the visitors sent to the variant lose their data, so the damage looks random. Ad platforms cannot match those conversions to a click, so campaigns look worse than they are. Smart bidding then learns from less data and may cut spend on campaigns that actually work.
The test itself is also skewed. Variant B gets more untracked traffic, so you may judge the test on conversions that are attributed unevenly between the two versions.
Example: both variants convert about the same, but variant B loses its UTMs, so far fewer of its conversions are credited to paid search.
How to check if your site has it
Build a tagged URL
Take the test page URL and add
?utm_source=test&utm_medium=cpc&utm_campaign=ab_check&gclid=TEST123.Open it in a fresh private window
A new session means you are bucketed again. Check the address bar after the page loads.
Repeat until you see the variant
You are assigned randomly, so open the link in new private windows several times. Look for a final URL that differs from the original.
Compare the final URL
If the variant URL has no
utm_orgclidvalues, the redirect drops them.Check the network tab
In browser DevTools, Network, tick Preserve log. Look at the redirect response (a 301/302
Locationheader, or a script-driven navigation) and see whether the query string is included.
How to fix it
The exact setting depends on your testing tool. The idea is the same everywhere: the redirect must carry the original query string to the variant URL, or you should avoid the redirect.
Turn on query-string passthrough
Most split URL features have an option to preserve or append query parameters when redirecting. Look in the test's URL or advanced settings, and enable it. Option names differ by tool, so check your tool's documentation.
Or use an on-page variant
If the change is only copy, layout or images, build it as an on-page test. The URL never changes, so nothing can be dropped.
Run the redirect before analytics loads
If a redirect fires after the GA4 page view, you may get a double session or a lost source. Load the test snippet early in the head so the redirect happens first.
Fix custom redirects
If you wrote the redirect yourself, copy
location.searchand the hash. See the code below.Retest with a tagged URL
Repeat the manual check until every variant keeps the parameters.
var variantUrl = '/offer-b';
var target = variantUrl + window.location.search + window.location.hash;
window.location.replace(target);location = /offer {
return 302 /offer-b$is_args$args;
}How to confirm it's fixed
- A tagged URL ends on the variant URL with every utm_ parameter and gclid intact.
- You tested several times so you saw both the original and the variant.
- GA4 Realtime or DebugView shows the correct source and medium for a variant visit.
- Variant landing pages no longer show unusual shares of Direct or Unassigned traffic.
- Ad platform tag helpers or network requests show the click ID on the variant page.
Before
- Arrive on /offer?utm_source=google&gclid=abc
- Redirect to /offer-b
- Conversion attributed to direct
After
- Arrive on /offer?utm_source=google&gclid=abc
- Redirect to /offer-b?utm_source=google&gclid=abc
- Conversion attributed to google / cpc
How to prevent it happening again
- Open a tagged URL and confirm the variant keeps the parameters.
- Prefer on-page variants when the URL does not need to change.
- Add the passthrough step to your test launch checklist.
- Re-test after changing the tool, its snippet or your server redirect rules.
- Watch Direct and Unassigned traffic on variant pages for the first days of a test.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. It runs your real journeys on a schedule and checks the tracking hits sent to ad and analytics platforms, so it can show when a tagged visit stops producing the expected hits or loses its UTMs along the way.
What it does not do is pin an A/B variant. A robot visit may be assigned variant A or variant B, and FunnelGuard cannot force it into the redirected variant. A broken redirect on one variant can therefore go unseen on runs that land on the other.
You can start with the Free plan (1 site, 2 journeys, daily checks, no card), or run a free read-only website audit.
Questions people ask
Why is my A/B test losing UTM parameters?
Your tool probably redirects visitors to the variant URL without copying the query string. The variant page then loads with no UTMs or gclid, so analytics sees the visit as direct. Turn on query-string passthrough in the tool or build an on-page variant.
Does a split URL test remove gclid?
It can. If the redirect does not append the original query string, gclid is dropped along with the UTMs. Google Ads then cannot match the conversion to the click, unless auto-tagging data is captured before the redirect.
How do I make my A/B testing tool keep UTMs on redirect?
Look for an option to preserve or pass through query parameters in the split URL test settings and enable it. If you use a custom redirect, append window.location.search to the variant URL. Then test with a tagged URL.
How can I test if my A/B test redirect drops UTMs?
Add UTMs and a fake gclid to the test page URL and open it in several fresh private windows. When you land on the variant, check whether the address bar still has the parameters. The Network tab with Preserve log shows the redirect step.
Do on-page A/B tests have this problem?
No. On-page tests change the page content in place and the URL stays the same, so UTMs and click IDs are untouched. This is why they are safer for paid traffic when a redirect is not needed.
Why does my A/B test variant show lots of direct traffic in GA4?
Lost UTMs are a likely cause. When a redirect strips the parameters, GA4 has no campaign data and may label the session direct or unassigned. Compare Direct share on the variant URL with the original.
Can FunnelGuard detect A/B redirect UTM loss?
Only partly. It checks tracking hits and attribution on your journeys, but it does not pin an A/B variant, so it may not land on the redirected one. Check each redirect test by hand as well.
Related issues
- TRK-311UTMs lost on redirect (http->https, www, trailing slash)Fix guide
- TRK-334Server redirects drop query string (301 to /)Fix guide
- TRK-335Language/geo redirect drops click IDsFix guide
- TRK-333Shortener/redirect link (bit.ly, Linktree) strips UTMsFix guide
- TRK-312UTMs lost when moving from landing page to form pageFix guide
- TRK-322fbclid/gclid trigger 404 or WAF block on landing pageFix guide