I am used to seeing additional strings on our product URLs when the product is out of stock - or for some reason, a duplicate product page was made, but I have never seen this one - ?_pos=2&_sid=0ce38240f&_ss=r. Does anyone know why this is appearing and how to get rid of it? Thank you.
Hi, @Karen14
Elle here from Shopify!
Iâm not sure why the string would be appearing but happy to look into this for you! If you can provide more details it will be very helpful.
-
What path are you taking to get to these URLs? (Does the string appear when simply going to your store and selecting a product?)
-
Have you noticed any trends? Do only certain products display this string?
-
Can you provide some example URLs?
Thanks so much and looking forward to hearing from you!
Cheers,
Elle
Hi Elle - yes there is a trend and it is something I just noticed last week with one product URL and I was able (unknowingly) to duplicate it a couple of minutes ago. If you are going through the website and click on a product the URL appears properly, but if you do a search for the product and click on any product that is appearing the string is added to the URL. So the position of the product appears in the string - ?_pos=3. I have tried this numerous times (I am doing some redirects and when searching for the products I want I was able to see this). Nothing has been changed on the backend of the website as far as I know - and I have not seen this before (and I do a number of redirects weekly and search to find the correct product & URL).
URL - https://www.canuckhomebrewsupply.com/products/flav-extract-peanut-butter
If you do a search for âPeanut Butterâ and then click on the product the URL is - https://www.canuckhomebrewsupply.com/products/flav-extract-peanut-butter?_pos=2&_sid=0ce38240f&_ss=r
URL - https://www.canuckhomebrewsupply.com/products/cp-tap-handle-finial
If you do a search for âFinialâ and then click on the product the URL is - https://www.canuckhomebrewsupply.com/products/cp-tap-handle-finial?_pos=3&_sid=2f334c4b9&_ss=r
Thanks for your assistance.
Thank you for the additional context!
The âposâ part of the string is referring to the position the product appears in based on the search criteria.
For example: When you search âpeanut butterâ, three products appear. The first one will display pos 1 in the string since it was displayed first, the second one will display pos 2 in the string since it is displayed second, so on and so forth.
This is expected behaviour across all stores and I do not believe there is a way to remove this from the URL. May I ask why you wish to remove it from the URL? Is this negatively impacting your store somehow? Please let me know!
Thanks so much,
Elle
Hi Elle - Yes I knew why it was happening as I was able to duplicate it,
but I must say that this only started to happen Thurs. July 11, 2019. Never
before has the URL appeared this way when doing a search and then clicking
on the product. You or your tech team might ask âHow can she be sure that
is always hasnât been this way.â The reason I know it only started recently
is that when I do URL redirects I always search for the product, click on
it and then copy the entire URL after the /, and place it in the âRedirect
toâ box. I never have to remove any other part of the URL unless the
redirect is going to a product that is currently out of stock - then I have
to remove the ?variant=.
I may not be your typical Shopify user as I work in-house and I am able to
dedicate much of my work week to our website, so I would normally spend
about 20 hours a week editing, updating and adding new products. Spending
so much time on one website and recording what and where I do things makes
it easy for me to know what page, what I was doing and the date that I was
doing it.
To say it is negatively impacting our store, at this time I would say no
(however if the Googlebot happened to hit our store while the page with the
unusual URL string was open, then yes it could have a negative impact).
My biggest reason for wanting to get rid of the extra string in the URL is
for editing purposes. While it may not seem like a big deal to take an
extra second or two to grab a clean URL, when editing, redirecting and
checking stock the few extra seconds add up, and I hate wasting time. I see
absolutely no reason for the search position to be inserted into the URL,
it has no positive impact what so ever.
Thanks again - Karen
Hello @Elle hereâs how this is impacting my store for example.
Several days ago I noticed that on the search page our AJAX cart is no longer working. Looking into the code I found that the {{ product.url }} output has changed. AJAX pulls product variations directly on the Search page and it needs the URL of product.json so we need to call â/product/product-name?view=jsonâ however when adding additional strings in front of that the js request it no longer valid.
So I need to either change the scripts on all my stores or find a different way to get the product.url without the additional strings.
If that behavior changes on any other product.url output Iâm looking at major sitewide issues.
Could you elaborate on this workflow and the why of frequent redirects?
to clarify are you searching for products in the admin or the frontend?
If your changing product handles redirects should be created automatically
If your using the frontend to make decisions about data|actions in the admin consider making a utility theme or templates to facilitate this workflow if apps are out of the question.
(however if the Googlebot happened to hit our store while the page with the> unusual URL string was open, then yes it could have a negative impact).
Such pages|urls shouldnât be indexed in properly setup themes
I see absolutely no reason for the search position to be inserted into the URL,> it has no positive impact what so ever.
Analytics yours or shopifys, and apps, and browser extensions.
Could you elaborate on this workflow and the why of frequent redirects?
-the reason for frequent redirects is that some products are discontinued, and in order to keep a good UX I always redirect the page to an appropriate page. I also keep a good eye on the Google Search Console and fix any 404s. As you are probably aware, Google keeps things in their index almost indefinitely. They are still finding URLs from previous CMS, so those old URLs need to be redirected to the proper pages.
To clarify are you searching for products in the admin or the frontend?
- I am searching for products from the front end. We sell numerous products that are similar to each other, so being able to look at the products that are on the website makes it easier to make sure that product pages we are redirecting go to the correct page.
I find that the additional string being added to the URL is not needed. We also use the search feature to find products for our customers when they are unsure of what they may need for their setup. We only want to send them the URL for the product, not a URL that contains where it was found on a search page.
For future readers, if doing this make sure to check for backlinks for extra context when deciding where to redirect,
and either:
A) avoid redirecting to other products that may themselves end up discontinued and have MORE redirects
B) methodically check redirects to avoid discontinued redirect chains that will build up over time.
If your doing work often using the front end you probably start wanting to build theme utilities for yourself that only show with a specific logged in customer or a separate theme used in preview mode.
Like making the 1 click button to copy only the url handle to your clipboard,
https://clipboardjs.com/ for clipboard shenaingans
Or generate the admin redirect https://help.shopify.com/en/api/reference/online-store/redirect#create-2019-04
Example using jquery
<button onclick='jQuery.post("/admin/api/2019-04/redirects.json","redirect%5Bpath%5D=%2Fproducts%2Fproduct1&redirect%5Btarget%5D=%2Fproducts%2Fproduct2")' />
etc etc
Hi, @Karen14 !
I can certainly appreciate how this is impacting your day to day workflow.
@Georgi_Demirev , thank you for letting me know how this change has affected your store. Is the code within your theme something you added or was this built into the theme?
I will be bringing all of these details back to our developers for consideration and I will share any updates I receive here!
Cheers,
Elle
Thanks Elle for passing this info on to your Developers. While yes it does impact my day to day work, I think one of my biggest peeves would be that something was changed and Shopify customers were not notified of the change. I spent time trying to troubleshoot what the issue might be and then stumbled upon why it was happening when doing a search for a different product and clicking on it. Curious to know how many others that look after a Shopify store saw that the URL had an additional string and may have spent both time and money trying to get it corrected (when they do not have an in-house web person) when there was nothing they could do because Shopify changed the backend without telling anyone.
Hey @Elle , thanks for the reply and taking note to developers.
In fact this functionality has been built into the theme itself. What it does essentially is get the product information on-the-fly (variations+add to cart) and append it to the HTML, so a product with variations can be added to cart directly from the collection page.
The theme is called Woodmart, you can see their demo and the script in action here. I know theme code is not up to Shopify standards (not up to mine either), but unfortunately weâre stuck with it for the time being.
I absolutely understand where youâre coming from @Karen14 ! Your feedback is extremely valuable and ultimately helps us improve our platform. It looks like our Changelog was updated today to note the update here.
Also, please reach out to our support whenever you have an issue you need assistance with! Weâre available 24/7 and happy to help!
@Georgi_Demirev , thanks for providing that context! If youâre unhappy with the theme youâre currently using, Iâd be more than happy to help recommend an alternate theme based on the features youâre looking for. Just let me know.
Cheers,
Elle
Hi, all
A quick update about the change to our search parameters.
This update will allow us to improve search functionality in the longterm and at this time it is a permanent change.
Your feedback has been logged with our developers and is always appreciated.
If you have any other questions donât hesitate to get in touch with our support, weâre available 24/7.
Best,
Elle
Good morning Elle - while "This update will allow us to improve search functionality in the longterm and at this time it is a permanent change. " - that statement would appear to me that your dev. are testing and gathering information on how the search feature works, this is being done on live websites that are being paid for by your customers. I would think that if they want to test a feature it should be made perfectly clear to your paying customers that it is being done, prior to doing so, and that they should have the option of opting out of the tests and research. Of course, that is just my opinion.
Thanks for the update.
I notified too that change was made to Url into the search.
At first I thought something on my side did this or a plugin.
In fact that really annoying, we share URL to Customers all the time, via email, facebook, instagram or live chat.
I like to copy past clean URL, that do not look professional when you have big strange/weird url. Customers feels confortable when itâs flawless.
You say that a perma change, but some store do not have this. I check many Website to know If problem was affecting other store.
Fashionnova.com still have no url string added when searching on they Website.
Look like you didnt changed this for your big Customers. Of course you canât do that to store like fashionnova. Using only small store to test this featureâŚ
Really
I totally agree with you. Curious to know as well, as the products change position on a page, so would the âpositionâ of a product on the search. So⌠if you were to send the total URL with the additional string to a customer, would they see a different product(should another product now occupy that position)?
I think Shopify needs to rethink this new âsearch featureâ as it is not in any way useful to the average website user or whoever owns and updates the website.
This change breaks any liquid code that uses ?view= urls to point to a specific product template view.
We ran into this issue because our lightboxes use these kind of links, and the links were invalidated by having multiple question marks in them after this change. Our lightboxes all stopped working without any explanation, and it was quite a puzzle figuring out what had happened.
What before was as easy as:
{{ current_product.url | within: collection }}?view=quickview
now needs logic to make sure that the link doesnât break:
{% assign product_url = current_product.url | within: collection %}
{{ product_url }}{% if product_url contains '?' %}&{% else %}?{% endif %}view=quickview
We need to be able to trust that things we rely on in Shopify code arenât going to break without warning. Do I need to change all of my view links to use this logic just in case a decision like this is made again in the future?
This change may be for the better, and it may enable useful features in the future, but we should have been warned in advance. Iâm sure there are other stores out there that are having issues because of this change, and theyâre probably just as confused as I am as to what the cause is (that is, if theyâre even aware of the problem)
This seems to work OK (just had to do it on a store that uses an ajax quickview, which was breaking on the search results page because of the additional url strings). Change the following:
<a href="{{product.url}}"
to this:
{% assign newproducturl = product.url | split: '?' %}
<a href="{{newproducturl[0]}}"
So youâre basically exploding the url at the â?â and returning just the first part of the array (still also works on the normal collection urls).
Thank you for sharing your fix with us. Could you please tell me where it was in the backend that you changed the code? We are using the liquid theme and I think I have looked everywhere to see if I could find the <a href=â{{product.url}}â. The closest I have been able to find is {{item.url}}. I am not close to being an expert using Shopify - the backend coding was dumped on me when the person looking after that part of the website left. Thanks again - Karen.
