Guides

Campaign tracking in practice.

Choose with the arrow keys, open with Enter, close with Esc.

All articles
Guides

Why UTM parameters get lost: redirects, consent and scripts

For Editors and agencies 6 minutes Updated November 2026

A campaign link carries its origin in its parameters: utm_source, utm_medium and utm_campaign. Between the click and the moment your analytics counts the visit, these parameters can disappear. The visit still arrives, but without its campaign. It then counts as direct, as a referral or not at all. The ad looks weaker than it is, and the budget moves in the wrong direction.

We talk about UTM parameters here. Everything applies to Matomo's own parameters such as mtm_campaign in the same way.

How to spot it

  • The ad platform reports far more clicks than your analytics shows visits with that campaign.
  • While the campaign runs, direct visits or referrals from your own domain go up.
  • After opening the link, the parameters are gone from the address bar.

Some difference between clicks and visits is normal, for example when someone closes the page before it loads or does not consent. If almost nothing arrives, one of the following causes is usually behind it.

1. Redirects that cut off the parameters

Many links pass through one or more redirects: from http to https, from the address without www to the one with it, to a trailing slash, to a language version or from an old page to a new one. Link shorteners and redirect plugins in your CMS count too. Every step has to carry the part after the question mark. If it is dropped anywhere, the campaign is lost.

Whether a redirect keeps the parameters depends on its rule:

  • Apache: a RewriteRule keeps the parameters by default as long as the target has none of its own. The QSD flag or a question mark at the end of the target drops them. If the target has its own parameters, the rule needs the QSA flag to keep both.
  • nginx: return 301 https://$host$request_uri; keeps the parameters, because $request_uri contains them. With $uri in the same place they are gone. A rewrite rule appends the old parameters by itself, unless its target ends with a question mark.
  • JavaScript or meta refresh redirects often build the target address from scratch. Check whether the script carries over the part after the question mark.

The simplest fix: put the final address into the campaign link right away, with https, the right spelling with or without www, the trailing slash and the language. Then there is no redirect that can lose anything. The guide Campaign launch without broken links shows an example.

If your analytics only measures after consent, the moment of consent decides.

  • Consent on the landing page: with the setting requireConsent, Matomo holds the requests back and sends them once the visitor consents on the same page, campaign included.
  • Consent only on a later page: the landing page request was never sent. The parameters were only in its address, so the campaign is missing.
  • A banner that starts too late or reloads: some banners turn on tracking only with the next page view, or they reload the page after consent without the campaign parameters. Then too the session starts without a campaign, even if the visitor consented on the landing page. In GA4 it often lands in "Unassigned", see the guide GA4 Unassigned traffic. The right setup: measure on the same page once consent is given, and if the banner reloads, keep the full address including its parameters.
  • Measuring without cookies: with requireCookieConsent, Matomo can count without cookies before consent. The campaign then arrives even if consent comes later or never. Whether this is allowed for your website is a question for your data protection officer.
  • GA4: in the basic mode of Consent Mode, Google tags send nothing before consent. In the advanced mode, cookieless pings go to Google without consent.

So always test campaigns the way new visitors see them: with the banner and without consent given beforehand.

3. Scripts that rewrite the address

Many websites change the address in the browser without reloading the page. Some scripts remove parameters to "clean up" the address, and single-page apps change the address as people navigate. If this happens before the analytics code sends the first page view, it no longer sees the parameters. The order has to be right: measure first, then change the address. Or simply leave campaign parameters in the address.

4. Parameters in the wrong place

Parameters belong before the #, never after it:

https://www.lindenholz.example/autumn?utm_source=newsletter&utm_medium=email&utm_campaign=autumn#offer

The browser does not send anything after the # to the server, and not every analytics tool reads it. Matomo does read campaign parameters there, but you should not rely on it.

Just as common are a second question mark instead of &, spaces or special characters without encoding, and links cut off while copying. The free campaign link checker finds such errors in seconds. It also shows how GA4 and Matomo read the link.

Newsletter tools, link shorteners and security filters in email inboxes route clicks through addresses of their own. Usually the parameters survive, but you cannot rely on it. Some newsletter tools also add UTM parameters themselves. Decide whether the tool sets the values or you do, not both. Before every send, send a test to yourself and click the link there.

  1. Open the link in a private window, like a new visitor.
  2. After the page loads, look at the address bar: are all parameters still there, with the right values?
  3. Open the browser's developer tools, tab "Network", and reload the page. Every redirect is listed there with a status such as 301 or 302. Its target must still carry the parameters.
  4. Check that the visit arrives with its campaign: in Matomo in the Visits Log, in GA4 in the Realtime report. The article Campaign tracking in Matomo describes the test in Matomo under "The 60-second test".

Test every variant visitors really use: desktop and phone, with and without consent, and for newsletters the link from the real test email.

Feinwerk Campaigns

Feinwerk Campaigns opens every link itself and follows the whole redirect chain. The check reports whether the tracking parameters are still attached at the end. It also opens the landing page in a real browser and reports whether Matomo counts or waits for consent. Lost parameters show up before the launch instead of after the analysis. More on the features page and on the pilot page.

Was this page helpful?