TidyURLs
Go to Tools
BLOG
The TidyURLsJournal

Practical guides, tutorials, and insights about URLs, SEO, web development, and online marketing. Learn, troubleshoot, and get the most of the web.

Back to the Journal
TidyURLs Journal

Why UTM Parameters Disappear After a Redirect

Practical insights, clear explanations, and useful ideas for understanding the web.

October 28, 20268 min read5 topics
Why UTM Parameters Disappear After a Redirect
Explore the details
#UTM parameters#redirects#campaign tracking#analytics attribution#troubleshooting
October 28, 20268 min read

UTM parameters lost during redirect can make a campaign URL appear to work while its tracking details vanish before the landing page loads. To find where that happens, inspect each redirect response—not just the final page—and compare the query string at every step. Then investigate analytics attribution separately: a URL can retain its UTMs without producing the expected report or conversion credit.

Key Takeaways

  • A redirect does not automatically preserve the incoming query string. The next URL is determined by the redirect's Location value.
  • Record each request URL and each Location header to identify the first hop where UTM parameters disappear.
  • Redirect rules, application code that rebuilds URLs, and cross-domain handoffs are common causes.
  • UTM parameters being present is not the same as analytics successfully recording or attributing a visit. Consent, browser privacy controls, and tracking configuration can affect measurement.
  • Test the same path a real visitor takes, including relevant cookies, consent choices, and device or browser conditions.

Inspect the redirect chain one hop at a time

Start with the exact campaign URL, including its full query string. For example:

https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring

For each HTTP redirect, note the URL you requested, the response status, and the Location header. The Location value tells the client where to make the next request. If it points to a URL without the UTM query string, that redirect response is the first place to investigate.

You can inspect the first response with curl:

curl -sS -D - -o /dev/null \
  'https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring'

Look for a status such as 301, 302, 303, 307, or 308, followed by a Location header. If the destination is another redirect, request that URL and record its response too. Repeat until you reach the landing page. This manual approach makes it easier to associate each Location header with the URL that triggered it.

You can also have curl follow redirects and print the response headers:

curl -sS -L --max-redirs 10 -D - -o /dev/null \
  'https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring'

This shows the headers from the redirect responses in sequence, but you still need to read each Location value to follow the chain. For a browser-based check, open Developer Tools, select the Network panel, enable Preserve log, and load the campaign URL. Inspect the requests and their response headers. A [Redirect Checker](Redirect Checker) can also help you view a redirect chain; confirm important findings in the browser or with a request from your own environment.

Use a simple record like this:

StepRequested URLResponseLocation or final URLUTM status
1https://example.com/spring-sale?utm_source=newsletter...301https://www.example.com/spring-sale?utm_source=newsletter...Present
2https://www.example.com/spring-sale?utm_source=newsletter...302https://shop.example.net/spring-saleMissing
3https://shop.example.net/spring-sale200—Missing

In this example, investigate the rule or application producing step 2's Location. The first hop preserved the query; the second did not. Redact personal data and sensitive values before sharing request logs. UTM values are often not secret, but query strings can contain other data that should not be exposed.

Why redirect chains drop campaign parameters

A redirect rule builds a destination without the query

A server, CDN, or hosting platform may be configured to send every request to a fixed destination, such as a preferred hostname or a new page. If the destination is constructed without the incoming query string, the UTM values can be lost. The exact configuration and default behavior depend on the server or platform, so inspect the rule that produced the Location header rather than assuming query strings are forwarded automatically.

Application code rebuilds the URL

Redirect handlers often create a destination from a route name, database field, or hard-coded string. For example, code might redirect to /checkout rather than carry forward the original query. Middleware, routing frameworks, and link-shortening services can have similar behavior.

Check the code path that generates the redirect and determine which query parameters it is intended to preserve. Avoid blindly copying every incoming parameter: some applications should allow only known campaign keys, and other query values may be irrelevant or unsafe to propagate.

A cross-domain handoff does not copy the query

A redirect from one domain to another is not guaranteed to carry campaign parameters along. The destination must be constructed with the parameters, or the receiving site must obtain campaign information through another correctly configured mechanism. Check each domain boundary separately, including links generated by checkout providers, campaign platforms, and custom landing-page code.

A redirect checker can show whether a parameter appears in the URLs it observes. It cannot establish whether an analytics tag ran, whether consent permitted measurement, or how an analytics platform credited a visit.

Client-side navigation changes the URL

The first server response may preserve the query while JavaScript or a single-page application subsequently navigates to a URL without it. Compare the address bar and Network panel from the initial document request through the final page state. If the query disappears after the initial response, inspect client-side routing and navigation code as well as server redirects.

The URL changes after campaign data has been collected

Some sites read campaign parameters on arrival and then remove them from the visible URL or navigate to a cleaner address. That observation alone does not show whether analytics recorded the campaign. Check the site's tracking configuration and analytics diagnostics rather than treating the final address bar as proof of attribution success or failure.

Separate URL preservation from analytics attribution

Treat these as two investigations:

  1. Parameter preservation: Did the relevant utm_ values reach the page or system that is supposed to read them?
  2. Measurement and attribution: Did the analytics tag run, send the expected data, and report the visit or conversion as expected?

A campaign URL can retain its UTMs while measurement is affected by a visitor declining consent, browser privacy settings, content blockers, a tag that does not fire, or a tracking configuration issue. Conversely, a site may capture campaign information on an earlier page before a later redirect removes the visible parameters. Neither outcome can be inferred from the final URL alone.

When investigating an analytics discrepancy, record the landing-page URL, consent state, browser and device, relevant tag or network requests, and the report or event where the discrepancy appears. Compare a controlled test with the site's approved consent and analytics setup. Avoid using real customer data or changing consent settings in a way that bypasses the site's policy.

I could not live-check current analytics-platform or web-server documentation while preparing this guide. The troubleshooting steps therefore describe observable redirect behavior and keep product-specific attribution advice general. Before changing server or analytics settings, confirm the current instructions for your platform and configuration.

A practical diagnosis workflow

  1. Capture the exact input URL. Copy the campaign link as sent, including capitalization, separators, and all query parameters. Do not test a manually reconstructed version unless you compare it with the original.
  2. Record each redirect. Use curl or the browser Network panel. For every step, write down the requested URL, status code, and Location value. Mark the first step where a UTM parameter is absent.
  3. Repeat in the visitor's context. Check the real link and normal browser journey. Cookies, consent, user-agent rules, client-side navigation, or an intermediary service may make a browser path differ from a basic command-line request.
  4. Identify who creates the failing destination. The response and host at the first failing hop help narrow whether to inspect an application, web-server rule, CDN, link service, or external domain.
  5. Check the analytics path independently. Verify that the intended landing page loads the right tracking configuration and that measurement behaves as expected under the applicable consent state. Do not use UTM presence as a proxy for successful attribution.
  6. Retest after a targeted change. Repeat the same journey and compare every hop. Also test URLs with no query string and with unrelated parameters so a fix does not create unexpected redirects or propagate data that should not be forwarded.

Common Mistakes

  • Checking only the final page. That shows the outcome, not which redirect first removed the parameters.
  • Assuming a redirect preserves the query by default. Inspect the actual destination in the Location header.
  • Relying on a single test method. A command-line request and a real browser can follow different paths or encounter different client-side behavior.
  • Treating a missing UTM in the address bar as proof of missing analytics data. Measurement may have occurred earlier, or it may have been prevented for other reasons.
  • Treating present UTMs as proof of attribution. A correctly tagged URL does not guarantee that analytics collection, consent, or reporting is configured as intended.
  • Forwarding every query parameter without review. Preserve only what the destination needs and what your application is permitted to pass on.

Best Practices

  • Keep an example of the intended campaign URL and its expected redirect chain for testing.
  • Make redirect destinations explicit, and decide deliberately which query parameters should be retained.
  • Test cross-domain and client-side navigation separately from simple server redirects.
  • Diagnose URL behavior and analytics behavior as related but distinct problems.
  • Document changes to redirect rules and retest them after deployments or changes to a CDN, link service, or routing layer.
  • Follow your analytics platform's current documentation for campaign collection, consent, and attribution; details vary by platform and configuration.

Conclusion

To diagnose UTM parameters lost during redirect, find the first hop whose destination no longer contains the campaign values, then inspect the rule or code that created it. After addressing URL preservation, verify analytics measurement separately. This avoids confusing a redirect defect with an attribution or consent issue.

References

No external documentation was live-checked for this article. Consult the current official documentation for your web server, redirect provider, and analytics platform before applying product-specific configuration changes.