Lazy Loading of products on an E-Commerce Website - Options Needed
-
Hi Moz Fans.
We are in the process of re-designing our product pages and we need to improve the page load speed.
Our developers have suggested that we load the associated products on the page using Lazy Loading, While I understand this will certainly have a positive impact on the page load speed I am concerned on the SEO impact.
We can have upwards of 50 associated products on a page so need a solution.
So far I have found the following solution online which uses Lazy Loading and Escaped Fragments - The concern here is from serving an alternate version to search engines.
The solution was developed by Google not only for lazy loading, but for indexing AJAX contents in general.
Here's the official page: Making AJAX Applications Crawlable.The documentation is simple and clear, but in a few words the solution is to use slightly modified URL fragments.
A fragment is the last part of the URL, prefixed by #. Fragments are not propagated to the server, they are used only on the client side to tell the browser to show something, usually to move to a in-page bookmark.
If instead of using # as the prefix, you use #!, this instructs Google to ask the server for a special version of your page using an ugly URL. When the server receives this ugly request, it's your responsibility to send back a static version of the page that renders an HTML snapshot (the not indexed image in our case).It seems complicated but it is not, let's use our gallery as an example.
- Every gallery thumbnail has to have an hyperlink like:
http://www.idea-r.it/...#!blogimage=<image-number></image-number>
- When the crawler will find this markup will change it to
http://www.idea-r.it/...?_escaped_fragment_=blogimage=<image-number></image-number>
Let's take a look at what you have to answer on the server side to provide a valid HTML snapshot.
My implementation uses ASP.NET, but any server technology will be good.var fragment = Request.QueryString[``"_escaped_fragment_"``];``if
(!String.IsNullOrEmpty(fragment))``{``var escapedParams = fragment.Split(``new``[] { ``'='
});``if
(escapedParams.Length == 2)``{``var imageToDisplay = escapedParams[1];``// Render the page with the gallery showing ``// the requested image (statically!)``...``}``}
What's rendered is an HTML snapshot, that is a static version of the gallery already positioned on the requested image (server side).
To make it perfect we have to give the user a chance to bookmark the current gallery image.
90% comes for free, we have only to parse the fragment on the client side and show the requested imageif
(window.location.hash)``{``// NOTE: remove initial #``var
fragmentParams = window.location.hash.substring(1).split(``'='``);``var
imageToDisplay = fragmentParams[1]``// Render the page with the gallery showing the requested image (dynamically!)``...``}
The other option would be to look at a recommendation engine to show a small selection of related products instead. This would cut the total number of related products down. The concern with this one is we are removing a massive chunk of content from he existing pages, Some is not the most relevant but its content.
Any advice and discussion welcome
- Every gallery thumbnail has to have an hyperlink like:
-
Ok, cool. To reiterate - with escaped_fragment you are just serving the same content in a tweaked format and Google recommend it rather than frown upon it. Good to be sure though.
See you at SearchLove!
-
Hi Tom, Thank you for the response,
The concern about serving an alt version is that it would be frowned up from a SEO perspective and may lead to a form of penalty.
I agree that escaped_fragment would be the best approach and just wanted to satisfy my own concerns before I get them working on this.
Thank you and see you at Search Love
-
Hi,
I am not sure I follow your concerns around serving an alternative version of the page to search engines - is that concern based on concerns it will be frowned upon or technical concerns?
Using the escaped_fragment methodology would work for your purposes, and would be the best approach. If you have technical concerns around creating the HTML snapshots you could look at a service such as https://prerender.io/ which helps manage this process.
If that doesn't answer your question, please give more information so we can understand more specifically where you concerns are.
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
-
Google webcache of product page redirects back to product page
Hi all– I've legitimately never seen this before, in any circumstance. I just went to check the google webcache of a product page on our site (was just grabbing the last indexation date) and was immediately redirected away from google's cached version BACK to the site's standard product page. I ran a status check on the product page itself and it was 200, then ran a status check on the webcache version and sure enough, it registered as redirected. It looks like this is happening for ALL indexed product pages across the site (several thousand), and though organic traffic has not been affected it is starting to worry me a little bit. Has anyone ever encountered this situation before? Why would a google webcache possibly have any reason to redirect? Is there anything to be done on our side? Thanks as always for the help and opinions, y'all!
Intermediate & Advanced SEO | | TukTown1 -
Product page as homepage
Hello, Is it ok that to use the homepage of website as a product page directly where you present all your products on your homepage or can it penalise you to do that ? and in that case, is it better to have a homepage that you don't rank and create a subpage for your product page. Thank you,
Intermediate & Advanced SEO | | seoanalytics1 -
Single topic website or as part of a multiple topic website?
I have content sitting on a site here - https://www.pfizerpro.co.uk/product/xeljanz/rheumatoid-arthritis - domain authority 25 page authority 18 - the pages went live three months ago and the website was launched 18 months. We now have the option to use a brand new domain www.xeljanz.co.uk Which is the better option to stick with the www.pfizerpro.co.uk as it is a larger multiple topic site that should attract more links or to start a new single topic site which google may view as the better source as it is dedicated to the topic? Thanks
Intermediate & Advanced SEO | | Kate_team_DM0 -
Please Help me! I need advice for my website
I have 2 Domains with the same name vps nine and vpsn ine with same content. How to solve that problem? Do I need to change the content from my main website. My Hosting is having different plans, but with the same features. So many pages were having the same content, and it is not possible to change the content, what is the solution for that? Please let me know how to solve that issue?
Intermediate & Advanced SEO | | Alexa.Hill0 -
Website Does not index in any page?
I created a website www.astrologersktantrik.com 4 days ago and fetch it with google but still my website does not index on google as the keywords I use is with low competition but still my website does not appear on any keywords?
Intermediate & Advanced SEO | | ramansaab0 -
Cons and pros of changing your e-commerce store domain name?
We have an online toy store, the domain is old over 10 years and we have some traffic, we are considering to change our domain name. There are two reasons why. First of all, we expand our product category, before we were only a puzzle store now we sell almost any kind of toy. And at this point, our current domain, PuzzleZoo.com is not representing our capacity. We also have toyzoo.com domain registered, that is also an old domain but there has been no activity with that domain. Our concern is, how do we avoid to lose ranking and keyword authority, are we going to start from the ground? What are the correct procedures to follow during this switch if we prefer to switch? As an alternative scenario, if we decide to keep both and open another e-store with toyzoo domain name and continue operating PuzzleZoo.com, with same products, will taht be a duplicate issue? If it is what are the consequences? (Just to add a note here, our PuzzleZoo is also a small brick and mortar store chain in CA and TX) ToyZoo will only be an online store. Even in this case at the eyes of Google, are we going to have a duplicate store that can potentially be penalized or PuzzleZoo being a brick and mortar store chain might help us to avoid being penalized? Should we switch the domain and redirect PuzzleZoo to ToyZoo, should we keep them both and running separately? We need to give a decision and I was wondering if there are any expert here that can give us a good intelligent advise on which path to go?
Intermediate & Advanced SEO | | PuzzleZoo0 -
Canonical Issue need hep
Hi Is my site has any issue with duplicate pages within the site , have i define my canonical tag properly , can any one advise please help. childrensfunkyfurniture.com
Intermediate & Advanced SEO | | conversiontactics0 -
Did adding product videos cause my products to lose #1 position?
I work on an e-commerce site and for many of the products we sell, we rank #1 for "product name + item number" related searches. We decided to add product videos to some of our products in the hopes of getting an additional listing in the SERP's (regular listing + video listing in universal video results) Instead.. What we've noticed is that sometimes we are not getting 2 listings but just a regular listing with a video thumbnail that ranks somewhere on the middle of the first page. The video thumbnail is great.. but I'd rather the #1 position. I don't think Google likes to show video results as the #1 position for obvious product searches. What do you think? Did we lose our #1 position because of adding the videos to our product pages? Any advice or similar experiences? ~~ Additional information: On some of those queries, Google had decided to ignore our video and we have maintained our #1 ranking. Thanks!
Intermediate & Advanced SEO | | WebstaurantStore.com0