Before we address the issues, we need to first explain how the Googlebot crawls JS websites. The Googlebot does several things when it makes first contact with a website, but it does two main things that concern us the most:
- Googlebot starts with an initial request for the pre-DOM HTML (This is the website’s static HTML source code and most commonly used for HTML websites. You can view any website’s source code by viewing the page source in your browser.)
Once Googlebot has the rendered content, it treats it like the traditional HTML source. This process gives Google two HTML versions of the page:
- pre-DOM HTML Source
- post-DOM rendered HTML
Another issue that will cause Google bots to not crawl and understand JS websites is time. If too much time passes or something doesn’t go as intended, Googlebot will either turn to the pre-DOM HTML source of the page or leave the site without crawling it.
Common SEO Issues with JS Websites
1. Missing Page Meta Data and Crawl Controls
Googlebot will use the rendered version (post-DOM rendered HTML) but it may refer to the pre-DOM to fill in missing data. Missing information between the two versions can prove to be highly problematic and causation for URLs not to be indexed. We recommend both versions to contain all the necessary information: meta data, page titles, crawl controls, etc. If Googlebot can’t read the JS information from the post-DOM, the pre-DOM will be your backup. And most importantly, both the pre and post-DOM must contain identical data.
2. Inconsistent Versions
3. Clean URLs
Every page needs to have a unique indexable URL if you want it indexed by search engines. A pushState will not create a unique URL as the page needs to be returning a 200 OK server response.
4. Typical HTML Attributes
Continue using typical HTML attributes such as including links in href and images in src attributes. Doing so will help Google recognize internal linking structure and access internal links and images throughout the website.
Consider these issues carefully when considering JS based websites for your business. Improperly deploying a JS website without following and understanding HTML standards can lead to search engines not indexing your website or cause rankings to plummet.