WebmasterID logoWebmasterID
UTM tracking

UTM parameters in redirects

Redirects are where UTM attribution quietly dies. A 301/302 or a link shortener that does not forward the query string strips your tags before the visitor reaches the landing page. This page explains how to preserve UTM parameters through redirects, shorteners, and vanity URLs.

Verified against primary sources

How redirects lose UTMs

An HTTP redirect sends the browser to a new Location. If that Location URL is hard-coded without the original query string, the UTM parameters are gone. The most common culprits are:

Preserving the query string

The fix is to forward the incoming query string when you build the Location. In most servers and CDNs the redirect rule can carry the original query through (for example, keeping the query in an Nginx rewrite, or appending it in application code).

Worked example (concept):

Incoming: /go/spring?utm_source=email&utm_medium=newsletter Redirect Location: /pricing?utm_source=email&utm_medium=newsletter

The parameters must appear on the final URL, not just the first hop.

Test the whole chain

Multi-hop chains (shortener → vanity → canonical) can drop parameters at any step. Test by following the full chain and confirming the tags are present at the final landing page, not by checking only the first redirect.

How it appears in analytics and logs

If a campaign that you tagged shows up as direct or untagged, a redirect that dropped the query string is a prime suspect. Preserving the query string through redirects restores the lost attribution.

Diagnostic use case

Ensure UTM parameters survive every redirect hop — shortener, vanity URL, www/https canonicalization — so the landing page and analytics still see them.

What WebmasterID can help detect

WebmasterID records attribution at the request that carries the parameters; ensuring redirects forward the query string means that request reaches a URL WebmasterID can see with the tags intact.

Common mistakes

Privacy and accuracy notes

Forwarding the query string moves only the campaign parameters you set. Keep those parameters free of personal data, since they will be visible at the final URL and in logs along the chain.

Frequently asked questions

Do 301 and 302 redirects preserve UTM parameters?
Only if the redirect target includes the query string. The status code itself does not strip parameters — a redirect rule that hard-codes a clean target URL does.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.