Altering Breadcrumbs based on User Path to Product URL
-
Hi,
Our products are listed in multiple categories, and as the URLs are path dependent (example.com/fruit/apples/granny-smith/, example.com/fruit/green-fruit/granny-smith/ and so forth) we canonicalise to the 'default' URL (in this case example.com/fruit/apples/granny-smith/).
For mainly crawling bandwidth issues I'm looking to change all product URL's to path neutral so there is only ever one URL per product (example.com/granny-smith/), but still list the product in multiple categories.
If a user comes directly to example.com/granny-smith/ then the breadcrumbs will use the default path "Fruit > Apples", however if the user navigated to the product via another category then I'd like the breadcrumbs to reflect this. I'm not worried about cloaking as it's not based on user-agent and it's very logical why it's being done so I don't expect a penalty.
My question is - how do you recommend this is achieved from a technical standpoint? Many sites use path neutral product URL's (Ikea, PCWorld etc) but none alter the breadcrumbs depending upon path.
Our site is mostly behind a CDN so it has to be a client side solution. I currently view the options as:
- Store Path to product in a cookie and/or browsers local-cache
- Attach the Path details after a # in the URL and use Javascript to alter breadcrumbs onload with JQuery
- When a user clicks to a product from a listing page, use AJAX to pull in the product info but leave the rest of the page (including the breadcrumbs) as-is, updating the URL accordingly
Do you think any of these wouldn't work? Do you have a preference on which one is best? Is there another method you'd recommend?
We also have "Next/Previous" functionality (links to the previous and next product URLs) on the page so I suspect we'd need to attach the path after a # and make another round trip to the server onload to update the previous and next links.
Finally, does anyone know of any sites that do update the breadcrumbs depending upon path?
Thanks in advance for your time
FashionLux
-
Further update to this. Ran into a problem with option 3... this solution works really well when navigating the site internally, however a user landing on one of these URL's directly (bookmark, social share etc) would have a slow loading page as (for non-default product variations) the page will load after the 1st request, then a 2nd request to the server is needed to pull in the image via AJAX.
Loading the other images, stock information, prices, copy etc into an array and doing the work on the client side wasn't an option as the page would get too heavy. So option 3 ruled out.
Ultimately the goal was to reduce duplicate content of product pages and none of the 3 options above do this whilst not affecting page loading times. I did look to fall back on using canonical tags however I've just now found that Facebook are using this tag, so if a user wanted to share a 'red apple' when the canonical is 'green apple' - Facebook would show an image of the 'green apple'.... so at the moment that is ruled out also.
I'll start a new thread on product page duplicates and the best solution - but if anyone has any ideas then please do let me know.
Thanks
Dean
-
Thanks for the response Dana. Option 3 did feel like the best option and that is the one I'm choosing to go with.
Point 2 (with the hash) provides the desired result of Search Engines only seeing the clean URL as the parameters behind the hash will never be seen, but the browser will use them to power the breadcrumbs. In the end it was a toss-up between 2 & 3 but 3 is the most maintainable and quickest for users.
Thanks again
Dean
-
Dean,
This is a great, great question and I am eager to find out what my fellow technical SEOs think because I have faced very similar situations on one of my sites. Thanks for asking this question.
My gut instinct is to select #3 of your options. But not really being a developer, it's hard for me to articulate as to why I think this is the best option. I am really only thinking of it from a user-end standpoint in that I want to know where, in the hierarchy of the site this page lives so that if I need to find it again, I can.
I disagree with your option #2 from an SEO standpoint because anything after a "#" or hashtag in a URL is ignored by search engines....so putting it there isn't going to benefit your SEO in any way.
Interested to hear what others think,
Dana
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
International Country URL Structure
Hey Guys, We have a www.site.com (gTLD) site, the primary market in Australia. We want to expand to US and UK. For the homepage, we are looking to create 3 new subfolders which are: site.com/au/ site.com/uk/ site.com/us/ Then if someone visits the site.com redirect based on their ip address to to the correct location. We are also looking to setup hreflang tags between the 3 sub-folders and set geo-location targeting in google search console at sub-folder level. Just wondering if this setup sounds ok for international SEO? Cheers.
Intermediate & Advanced SEO | | pladcarl90 -
Breadcrumbs and internal links
Hello, I use to move up my site structure with links in content. I have now installed breadcrumbs, is it is useful to still keep the links in content or isn't there a need to duplicate those links ? and are the breadcrumbs links enough. Thank you,
Intermediate & Advanced SEO | | seoanalytics1 -
Long product urls ecommerce store
Hi we have a site in the mens fashion space who have long product urls which look like this: https://www.domain.com/catalog/product/view/id/13700/s/the-mate-tee-grey-marle-upm618g/category/120/ The site is on Magento. Are there any serious SEO negatives of having such a long product url and including irrelevant information in the url like product/view/id/13700/s/ & /category/120/ in the URL. Or are the benefits of changing them to more URL friendly product urls like: https://www.domain.com/the-mate-tee-grey-marle-upm/ Minimal? Cheers.
Intermediate & Advanced SEO | | wozniak650 -
What is the best URL structure for categories?
A client's site currently uses the URL structure: www.website.com/�tegory%/%postname% Which I think is optimised fairly well, as the categories are keywords being targeted. However, as they are using a category hierarchy, often times the URL looks like this: www.website.com/parent-category/child-category/some-post-titles-are-quite-long-as-they-are-long-tail-terms Best practise often dictates (such as point 3 in this Moz article) that shorter URLs are better for several reasons. So I'm left with a few options: Remove the category from the URL Flatten the category hierarchy Shorten post titles two a word or two - which would hurt my long tail search term traffic. Leave it as it is What do we think is the best route to take? Thanks in advance!
Intermediate & Advanced SEO | | underscorelive0 -
301 redirect with /? in URL
For a Wordpress site that has the ending / in the URL with a ? after it... how can you do a 301 redirect to strip off anything after the / For example how to take this URL domain.com/article-name/?utm_source=feedburner and 301 to this URL domain.com/article-name/ Thank you for the help
Intermediate & Advanced SEO | | COEDMediaGroup0 -
Where to put a page ID in a URL?
Hello, My company is going to change URLs to example.com/category or example.com/product. When we will change the URLs to product or category pages somehow we have to check whether the requested page is from category table in DB or from products table (this gives much speed to page load time). So we have to choose how to make the different product and category pages.
Intermediate & Advanced SEO | | komeksimas
Programmers said that we need to insert id to URL. So the question is: Which is the better way to place an id to an URL? example.com/product-name?id=111 example.com/product-name/111 example.com/product_name-111 Or maybe we should use some other punctuation mark to separate id from product name? p.s. I have read Dynamic URLs vs. static URLs by Google and it still didn't answered which is the best for all of the pages. Somehow others solve this problem by typing only the names to the URL, but could anyone tell what that technology should be?0 -
Indexed non existent pages, problem appeared after we 301d the url/index to the url.
I recently read that if a site has 2 pages that are live such as: http://www.url.com/index and http://www.url.com/ will come up as duplicate if they are both live... I read that it's best to 301 redirect the http://www.url.com/index and http://www.url.com/. I read that this helps avoid duplicate content and keep all the link juice on one page. We did the 301 for one of our clients and we got about 20,000 errors that did not exist. The errors are of pages that are indexed but do not exist on the server. We are assuming that these indexed (nonexistent) pages are somehow linked to the http://www.url.com/index The links are showing 200 OK. We took off the 301 redirect from the http://www.url.com/index page however now we still have 2 exaact pages, www.url.com/index and http://www.url.com/. What is the best way to solve this issue?
Intermediate & Advanced SEO | | Bryan_Loconto0 -
Effect of URL change on Website
Hello we are developers and we have just created a new webpage for a client of us. The problem is that we can not replace the old one by the new one, cause our client has developed over 15 satellite pages that calls directly to the code of the old page. If we completly remove the old page we will make those 15 pages go down. Those pages are working over domains specially register for SEO reasons. For example Main page is www.euroair.es Satellite page is www.aireacondicionadodaikin.com Satellite page has pretty good ranking for search term "aire acondicionado daikin" As I told you, we have a new page but we can not make the page work over root domain. So we thought we could make it work over www.euroair.es/es, and make a redirection 301 of homepage and another important inner pages. We chose "/es" folder because it seems like a language folder, but we are not very sure of the effects of pages working on that folder instead of working on root directory. What do you think? Is this matter important or doesn't? Thanks
Intermediate & Advanced SEO | | teconsite.com0