SEO, AdWords, affiliates, advertising, and promotions
ttps://www.example.com/products/product1?utm_source=facebook&utm_medium=paid_social&utm_campaign=modelvideo&utm_content=modelvideo&fbclid=xxxxxxxxxxxxxxxx
but automatically redirects to the variant URL > https://www.example.com/products/product1?variant=123456789
any solution to avoid this redirection? we want to track each campaign's activities and conversion.
Hi @Zyber_Limited,
Based on the example you sent:
https://www.example.com/products/product1?variant=123456789
This example page has already the question mark …./product1?variant…/
So using one more question mark won’t be working.
So I suggest using ampersand (&) instead, you might also need to include equal sign before the ampersand.
I recommend using this tool: https://ga-dev-tools.web.app/campaign-url-builder/
It will generate the url with the UTM parameter for you — you will see if you need to use the ampersand and the equal sign. Try this out.
Maybe this could help.
Just use this URL and it'll be fine:
Notice the & after the variant ID in the URL (bolded to show you).
Hi @Josh_Uebergang,
Happy to hear that's working. So, no equal sign was needed, just an ampersand. Great!
I'm struggling with this issue too and the suggested solutions do not work. Take this URL:
If I add a utm_medium=email like so:
The utm_medium parameter is stripped (I believe by JS) and I end up at the original URL:
This happens with _any_ added query param other than variant.
Does anyone know how I can resolve this?
Hi @KutokuTim,
it's weird that it isn't working. It can be also because of some redirects:
https://shop.heddels.com/products/bouldering-pants-caramel-fw20?variant=39575475978307
Which of these is redirect? Plus, what's your primary domain? Isn't there redirect?
And have you tried using hashtag (#) instead of the first ($)?
Hey @Niki_K , thanks for responding!
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
The site's Shopify domain is https://heddels.myshopify.com and this exhibits the same behaviour.
> And have you tried using hashtag (#) instead of the first ($)?
Can you clarify that? There are no $ signs in the URL.
Thanks!
Hi @KutokuTim,
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.
Thanks again, @Niki_K
> 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.
https://shop.heddels.com/products/bouldering-pants-caramel-fw20?variant=39575475978307&foo=bar
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?
EDIT
I also noticed this happens to other sites, for example — https://www.rogueterritory.com/collections/skinny-leg/products/sk-copper-selvedge-canvas?variant=330... — so it doesn't seem specific to our site.
Thanks!
Hi @KutokuTim,
thanks for update and finding out out that this is happening only for product variants and also, for other pages.
Hey @Niki_K
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!
Hi @KutokuTim,
okay! Great! Thanks for the update!
Hi @KutokuTim
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?
Many thanks in advance
Hi @LuisGomesHM
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.
Sorry I couldn't be more help.
@KutokuTim Would it be possible for you to share the code snippet that you are using to avoid the issue? Thank you in advance!
can you provide the code?
Hi everyone,
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
I am facing same issue
here is an example https://www.farpavilions.com/products/two-tone-white-washed-hand-carved-transitionall-arched-bookcas...
please correct the URL with UTMs so I can use in paid campaigns
Hi, seems your link is working now. I could see the utm when I clicked the link. Did you make any changes? If yes, can you please share if you don't mind? Thank you
Facing exactly the same issue and none `#` `?` or `&` are working. Is it because of some shopify app or a theme issue?
Hey there,
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.
If I take the example on this website :
The part "&test=test" is wiped of the URL!
Why is this happening? for what purpose? As the variant remains the same.
It's hard to think about using another character like "#" to fix the issue, as the whole system is based on query string (URL get params).
Anybody knows if this Javascript redirection is made by Shopify or an app ?
Thanks in advance
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024