Skip to Content

E-commerce brands: please don’t make these JavaScript mistakes

The best SEOs can climb the search ranks as smoothly as bighorn climb steep cliffs.

But the harsh truth is that most SEOs stumble when faced with highly technical website details… like JavasScript (JS).

As Justyna Jarosz points out, Google can’t index e-commerce websites with JavaScript blunders, which results in lower presence on the search engines – and lower revenue.

So if you’re running a custom website on JS for your store, make sure you don’t do this:

#1 – Page navigation through JavaScript. When they land on a page, Google’s crawlers will skim the page by following links on your website structure.

The problem is, JS based navigation often lets crawlers see only products on the first page.

For instance, Nike’s infinite scrolling product feed is actually indexing only a few visible products, while leaving out the rest.

One solution is providing bots with page navigation based on that will “lead them” to the next crawling page.

#2 – Generating links to product carousels. Product carousels can help with revenue, but if done excessively in JS, they can hamper your indexing.

Justyna found this out when she tested a popular product page that over-relied on JS to display product carousels – disabling JS made these sections invisible for bots.

If you’re unsure, check if your product carousel is indexed in the Search Console.

#3 – Blocking JavaScript files in robots.txt. Hey, it happens. Sometimes a number of your JS files may be disallowed in robots.txt, and Google can’t access them.

When this happens, Google will skip indexing your important resources… and consequently they won’t appear on SERP, or count towards your topical authority. Ouch.

Check robots.txt, and if there is a part of JS you don’t want bots to follow, disallow only that.

#4 – JavaScript removing content from the website. Unoptimized JS, such as clickable panels that open description boxes, etc., “block” users from accessing important content.

Don’t do this.

Instead, make sure you serve this information even when JavaScript is disabled so Google can locate them and understand it’s the part of the same entity.

Phew, that was technical. Make sure you consult a web developer and fine tune that JavaScript. It will make Google happy – and your rankings even happier!