On this page
What this issue is
UTMs are tags added to a link, such as ?utm_source=google&utm_medium=cpc, that tell analytics where a visit came from. Click IDs like gclid (Google Ads) and fbclid (Meta) do a similar job for ad platforms. Together they are the query string.
Many sites redirect the first URL a visitor lands on to a canonical version: http:// to https://, example.com to www.example.com, or /pricing to /pricing/. If a redirect rule sends the visitor to the new address without the query string, the browser arrives at a clean URL. Your analytics and ad tags never see the parameters.
- Ad clickhttp://example.com/offer?utm_source=google&gclid=abc
- Redirect301 to https://www.example.com/offer/ with no query string
- Landing pageURL has no UTMs or gclid
- ConversionRecorded as direct or unassigned
The redirect hop removes the query string, so everything after it sees a visit with no campaign data.
Why it costs you leads or sales
The visitor still lands and may still convert, so nothing looks broken. What breaks is the credit. Paid conversions are attributed to direct or organic, and Google Ads or Meta may not receive the click ID needed to match a conversion to an ad.
Reports then say the campaign does not work. You cut budget on channels that were performing, and bidding algorithms learn from fewer conversions. The cost is wasted spend and wrong decisions, not an error message.
Example: 100 real conversions from paid clicks. With a redirect that strips the query string, most appear as direct.
How to check if your site has it
Test every variation a visitor or an old ad link could use, not just the final URL. Add a fake parameter so you can see what survives.
Build test URLs
Use the http and https versions, with and without www, with and without a trailing slash, each ending in
?utm_source=test&utm_medium=cpc&gclid=test123.Open each one in a browser
Look at the address bar after the page loads. If the parameters are gone, that redirect is stripping them.
Inspect the redirect chain
Run the command below, or use the Network tab in your browser's developer tools with Preserve log on. Check the Location header of each hop.
Test your real ad URLs
Copy the final URLs from your ad platforms, including any tracking templates, and repeat the test.
curl -sIL "http://example.com/offer?utm_source=test&gclid=test123" | grep -iE "^(HTTP|location)"How to fix it
The principle is the same everywhere: the redirect must append the original query string, and there should be as few hops as possible. Where you set that depends on your platform.
Check the site address
In Settings > General, make sure WordPress Address and Site Address use https and your preferred www or non-www version. WordPress then handles most canonical redirects and keeps the query string.
Review redirect plugins
In plugins such as Redirection or Yoast Premium, open each rule and turn on the option to pass through or ignore query parameters. Avoid rules that redirect to a fixed target URL without it.
Check server rules and the SSL plugin
If a force-https plugin or your host's setting adds a second redirect, switch to a single server-level rule (see the Custom code tab).
Set the primary domain
In Settings > Domains, choose your primary domain so Shopify redirects the other versions to it. Shopify keeps the query string on these redirects.
Check URL redirects
In Content > Menus > View URL Redirects, look for custom redirects on landing pages. Shopify redirects to the exact target you enter, so ad URLs that hit an old path may lose parameters. Update ads to the live URL instead.
Know the limit
GTM runs after the page loads, so it cannot recover parameters removed by a redirect. Fix the redirect at the server or platform first.
Capture parameters on the first page
Once redirects are fixed, add a Custom HTML or cookie variable that stores UTMs on arrival, so later redirects or internal navigation do not lose them.
Set the default domain and SSL
In Project settings > Hosting, set your default domain and enable SSL. Webflow handles http to https and www redirects and keeps the query string.
Review 301 redirects
In Hosting > 301 redirects, rules map one path to another. Test them with a query string. If one drops it, point ads at the final path instead.
Check the funnel domain
In Sites > Funnels, open Settings and confirm the domain, then use the final URL (with the right path) in ads.
Review path redirects
Under the funnel or website Settings, check any redirect rules. Test each with a query string and replace any that drop it by updating ad links.
Set the primary domain
In Domains, choose your primary domain so the others redirect to it.
Check URL redirect manager
In SEO > URL Redirect Manager, test old URLs with a query string. If parameters are dropped, point ad links at the final URL instead.
Set the primary domain and SSL
In Settings > Domains, set the primary domain and make sure SSL is on, so http and other versions redirect to one URL.
Check URL Mappings
In Settings > Developer Tools > URL Mappings, check your 301 rules. Test them with a query string and update ads if a rule drops it.
Use one redirect for protocol and host
Send http and non-canonical hosts straight to the final https URL in one hop. In nginx,
$request_uriincludes the query string. In Apache, rewrite rules keep it by default; do not add a?at the end of the target.Fix trailing slash rules
Make sure rules that add or remove a slash keep the query string. See the snippets below.
server {
listen 80;
server_name example.com www.example.com;
return 301 https://www.example.com$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
# ssl_certificate lines here
return 301 https://www.example.com$request_uri;
}RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301,QSA]Before
- http://example.com/offer?utm_source=google redirects to https://www.example.com/offer/
- Two or three hops in a chain
- Landing page URL has no parameters
- Conversions show as direct
After
- One 301 to https://www.example.com/offer/?utm_source=google
- Query string kept on every hop
- Landing page sees UTMs and gclid
- Conversions credited to the campaign
How to confirm it's fixed
- Every http, www and trailing slash variation of a test URL ends on the final URL with
utm_source,utm_mediumandgclidintact - The curl command shows a single redirect hop, or a chain where each Location keeps the query string
- In GA4 Realtime, a visit using your test UTMs shows the right source and medium
- Your ad platform's landing page URL test or tag diagnostics show the click ID arriving
- Old ad, email and social links tested too, not just the main landing page
Ad click → yoursite.com/offer?gclid=Cj0KCQ…&utm_source=google&utm_campaign=spring
301 redirect
Lands on → yoursite.com/offer/
- gclid
- utm_source
- utm_campaign
The visitor lands on a clean URL. GA4 and ad tags see no UTMs or gclid, and the conversion is reported as direct.
Toggle the redirect behaviour to compare the attribution result.
How to prevent it happening again
- Keep one canonical URL pattern (https, one host, one slash style) and use it in every ad and email
- Re-test redirects with a query string after any migration, SSL change, CDN change or new redirect plugin
- Keep redirect rules in one place so no second layer adds a hop
- Test a sample tagged URL whenever you launch a new campaign
- Ask developers to review any rule that ends in
?or sets a fixed target
How FunnelGuard handles this
FunnelGuard detects this issue today with its UTM persistence check. A robot visitor opens your landing page with marked test parameters (the test traffic uses utm_source=funnelguard and fg_test=1) and checks whether the campaign data is still present after any redirects and as the journey continues.
If a check fails, FunnelGuard re-checks from a second region before sending one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. It does not fix your redirects for you. You still make the change, and the next scheduled run shows whether it worked. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans include a 3-day free trial.
Questions people ask
Why are my UTM parameters disappearing after a redirect?
The redirect rule probably sends visitors to the new URL without the query string. This often happens with http to https, non-www to www, or trailing slash rules, or with redirect plugins that use a fixed target. Test with curl or your browser's Network tab to see which hop drops the parameters.
Does an http to https redirect remove UTMs?
It should not. A correctly configured redirect keeps the query string, for example return 301 https://www.example.com$request_uri; in nginx. If your UTMs vanish, a custom rule or a plugin is replacing the URL instead of passing the query string on.
How do I keep the query string in a 301 redirect?
Append the original query string to the target. In nginx use $request_uri, in Apache add the QSA flag and avoid a trailing ?, and in redirect plugins or platform settings turn on the pass-through option for query parameters. Then test with a tagged URL.
Can Google Tag Manager recover UTMs lost in a redirect?
No. GTM runs after the page has loaded, so if the redirect already removed the parameters, there is nothing left to read. Fix the redirect, then use GTM to store UTMs on arrival if you want them to persist across later pages.
Why does my paid traffic show as direct in GA4?
A common cause is that UTMs or gclid were stripped before GA4 loaded, usually by a redirect. Other causes include missing tags on email or SMS links, or links that cross domains. Test your landing URLs with parameters to rule out redirects first.
Should I point ads at the final URL instead of a redirecting one?
Yes. Using the exact canonical URL (https, the right host and slash style) removes the redirect hop, so there is nothing to strip the parameters. It is also faster for visitors.
How can I monitor UTM loss on redirects automatically?
FunnelGuard runs a UTM persistence check on a schedule. It loads your landing page with marked test parameters and alerts you when they do not survive. You can start with the Free plan, which has 1 site and 2 journeys with daily checks.
Related issues
- TRK-334Server redirects drop query string (301 to /)Fix guide
- TRK-335Language/geo redirect drops click IDsFix guide
- TRK-336A/B testing tool redirect drops UTMsFix guide
- TRK-312UTMs lost when moving from landing page to form pageFix guide
- TRK-333Shortener/redirect link (bit.ly, Linktree) strips UTMsFix guide
- TRK-322fbclid/gclid trigger 404 or WAF block on landing pageFix guide