What would cause the UTM string to be re-arranged when hitting a webpage?
In MKTO our utm string looks like this when added to emails:
?utm_source=mkto&utm_medium=Email&utm_campaign=XXX
But when clicking through the link (in some cases) it shows up like this on the webpage:
?utm_medium=Email&utm_campaign=XXX&utm_source=mkto
Anyone have any idea what might be causing this? I am just curious. We've recently changed web platforms and since then have encountered that issue with some pages but not all of them.
PS. I realize this is not really a MKTO question but it is somewhat related so I hope someone will still answer ๐
Solved! Go to Solution.
Please link to your page so we can look further.
Query parameters are ordered. That is, apples=yes&oranges=no
is different from oranges=no&apples=yes
. However, the order rarely matters in practice, as code just seeks the value of apples
regardless if it came first or second. (Yes, there are major exceptions, but theyโre outside the realm of UTM parameters.)
I suspect you have code that parses the query string, inspects each UTM param in a hard-coded internal order, and rewrites it. Confusing but not unprecedented.
@NadineRegan I'd check to see if there is some sort of redirect rule on your new platform. There may be a RegEx script that is reordering your UTM strings. (Disclaimer: I am no expert on this, just did a quick search and found this Reddit thread)
It was indeed a redirect issue, almost not noticeable (one letter changed in the new URL path).
@NadineRegan Is it consistent for certain users or links? Or is it random and inconsistent?
Please link to your page so we can look further.
Query parameters are ordered. That is, apples=yes&oranges=no
is different from oranges=no&apples=yes
. However, the order rarely matters in practice, as code just seeks the value of apples
regardless if it came first or second. (Yes, there are major exceptions, but theyโre outside the realm of UTM parameters.)
I suspect you have code that parses the query string, inspects each UTM param in a hard-coded internal order, and rewrites it. Confusing but not unprecedented.
Hi Sanford,
just as I was ready to provide you with a link to our page I realized that the URL path slighly changed (e.g. guide vs. guides) which seemed to have caused the problem as part of some re-direct we had in place.
Tip for anyone who might see this in the future: Make sure your web team is aware that even the slightest changes to URLs can cause major headaches for someone else. ๐คฃ
Yep, itโs usually something like that. Either query parameters are re-added in a hard-coded order (as I noted above) or theyโre re-added in alphabetical order.