Any URL that uses a variant query parameter will have all other query parameters stripped. This is not happening due to a redirect as I can see in Chrome’s web inspector that the page’s status is a 200. Here’s a screengrab — https://share.getcloudapp.com/JruxdoZO
I’ve just checked the page’s status and I can see 200 as well. So, yeah this won’t be the problem.
To the third point – I’m sorry, I wrote a wrong sign I meant using anchor character (#) instead of ampersand (&) before the utm_source → …#utm_source=…
Maybe the problem might be also in the analytics you’re using? Are you using analytics.js or ga.js? Because by default, analytics.js will search for UTM parameters in both the query string and anchor of the current page’s URL, but ga.js won’t. If I’m not mistaken, you have to allow it in the analytics, see the screenshot and here is also the link.
> Maybe the problem might be also in the analytics you’re using? Are you using analytics.js or ga.js? Because by default, analytics.js will search for UTM parameters in both the query string and anchor of the current page’s URL, but ga.js won’t. If I’m not mistaken, you have to allow it in the analytics, see the screenshot and here is also the link.
Create info! I did not know this. However, unfortunately the param rewriting issue happens with any and all params (other than the variant param).
For example, this URL uses foo=bar and that will be removed too.
It’s strange that this rewriting only occurs when directly linking to a product that has variants. All other Shopify URLs seem to work fine. Do you think it’s a theme issue?
thanks for update and finding out out that this is happening only for product variants and also, for other pages.
Sure, the problem might be connected to theme. What could also work is this. If you have a product with a variant, you can see that the variant URL changes. If you choose size M, the variant URL xxxxxxx.com/collections/xxxxx?=123456789 is different to when choosing size L. So, the solution could be to remove the variants URL from the code. Then, I think you could use the UTMs parametr without problem because you would have only one default page. However, it has also a downsize – you won’t be able to share the URL with the specific variant and not sure if this wouldn’t mess up adding the products to cart. I found a thread in Shopify community, which discuss the variant URL. Maybe you could check it out? https://community.shopify.com/c/shopify-design/removing-product-variant-url-v/td-p/357768/page/2
The utm parameters are stripped because the page url includes the question mark and the equal sign and we don’t know what other sign to use.
Just to follow up on this. I believe I have resolved the issue. I have some code that requires a query param to exist in order to execute (and I thought this was not running because of the query param removal) but it turns out that this code executes before Shopify’s Javascript that re-writes the query params. So for us at least this is not an issue.
Really appreciate the assistance though. Thanks again!
We are having the same issue and unfortunately Shopify Support says that it is not their scope of work. Could you please detail how you solved the issue?
Well, we were lucky that the problem actually didn’t affect us. We have a code snippet installed in the Shopify site’s HTML. This code snippet requests a JS file and sends the query parameters along with that request. This request happens before Shopify’s code removes the query parameters so we were a bit lucky.
I do believe this is a Shopify issue and from their response to you it sounds like either don’t want to fix it, or don’t understand the problem.
Did this ever get resolved. I tried all the combinations suggested here but nothing worked. In all cases, the URLs would change to the base shopify url with the variant code at the end.
I tried:
removing the variant part of the url
Add & after variant and before the start of UTMs
Add # after variant and before the start of UTMs
We have the same problem adding a URL parameter for affiliation purposes. In some cases, generally, a product variant, the affiliation param, and the UTM params would just be wiped … This won’t give the script the time to register this parameters …
This sounds crazy that Shopify (or the app causing this problem) did not think about adding all the other parameters back after the Javascript URL cleanup.