I'm working on an e-Commerce project. I need to display the products on the category page with js (using vue.js). In my case, the browser sends the following html to the user:

<div class="product-list">
  <products-list-component :products="{{$products}}">

Where products-list-component is vue.js component. How should I do it correctly for SEO? Is there a way to implement the best seo practices without SSR?

  • This is like the 6th question about JavaScript rendering and SEO this week. Why is JS rendering so popular when it has such big SEO drawbacks? The short answer to this question is that you shouldn't render it with JS. Use a server side technology instead. Even if you use all the best practices with the JS Google will take months to index your JS rendered pages. – Stephen Ostermiller Mar 11 '19 at 1:31

To start with unless needed generate your site on the server side and send it to your client. One of the biggest mistakes made by webmasters is making their site too javascript dependent which can not only make it slower as it loads all of the needed javascript over slow mobile connections or non-broadband connections but also hard fails with a non-functional site if the end user has javascript disabled.

Having said that Google for many years now has been able to interpret a webpage for indexing purposes after javascript has been executed on it and is capable enough now to simulate behaviours such as scrolling (for infinite scroll loading) etc.

The thing to remember is to build your page for the end user not specifically for Google. Google's crawlers and indexers are fairly closely able to approximate how a regular end user will interact with your site and can get the same information as what the end user is capable of getting.

| improve this answer | |

Maybe a really custom solution with technical difficulties. But... try to use a cache-system. Once dynamically loaded store the rendered result as html in a cache. Use this cached-result as a placeholder (within your div above...) for the next visitor. Google will index your "old" content, but it is better than nothing!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.