You open your site. Everything in place, prices load, filters work, the catalogue scrolls. Fine.
Now do something that takes ten seconds. Right click, view page source, and use Ctrl+F to search for a phrase from your own copy. Not the menu, a phrase from the substance.
In roughly half the audits I run, it is not there.
That does not mean the site is broken. It means the text is not in the page the server sends. It exists in your browser’s mind, once your browser has run the code. And whoever does not run code does not see it.
What Google does, in its own words
Let us not guess. Google’s documentation says it plainly: “Google processes JavaScript web apps in three main phases: 1. Crawling 2. Rendering 3. Indexing”.
The second is the critical one. The bot downloads the HTML first and puts the page in a queue for rendering. Later, “once Google’s resources allow, a headless Chromium renders the page and executes the JavaScript”. Headless Chromium is Chrome without a screen, running automatically. If the HTML that was downloaded was nearly empty, until the page’s turn comes there is nothing to index.
Read Google’s words in quotation marks again, because the whole matter hides in it. Once resources allow. The same page puts it even more bluntly: a page “may stay on this queue for a few seconds, but it can take longer than that”.
So the answer to “does Google see my JavaScript?” is not yes or no. It is yes, but not straight away, and with no guarantee as to when. For an article you wrote last year, fine. For a product page whose price changed this morning, less so.
And everybody else
Here the landscape changes, and it changes a great deal.
Vercel, the company behind Next.js, published a measurement from its own network, not an estimate, on 17/12/2024. It tracked crawler traffic for months on nextjs.org and across the Vercel network, and validated the findings on two further sites. The finding, verbatim:
“None of the major AI crawlers currently render JavaScript. This includes: OpenAI (OAI-SearchBot, ChatGPT-User, GPTBot), Anthropic (ClaudeBot), Meta (Meta-ExternalAgent), ByteDance (Bytespider), Perplexity (PerplexityBot).”
And a detail that makes it more interesting: the bots do fetch JavaScript files, in 11.50% of requests for ChatGPT and 23.84% for Claude. They simply do not execute them. In other words, they pay for the download and get nothing from it.
Two caveats, because this is how numbers should be written. First, the measurement carries a date, December 2024. One of these companies may have changed this since. If that happens, we will write about it. Second, it is a company measuring its own traffic, not an independent auditor. It remains the most substantial measurement I have found, and it is a great deal better than the dozens of undated reproductions of it in circulation.
The practical conclusion is one sentence: Google forgives you, the answer engines (AI) do not. Who exactly these crawlers are and what you allow them to do, we have discussed elsewhere.
The four that break most often
Links that are not links. Google writes it without room for misreading: it “can only discover your links if they are a HTML elements with an href attribute”. An element that merely reacts to a click (a div with an onclick), with no real address behind it, is a button, not a link. It works perfectly for the visitor and does not exist for any engine. It is the number one finding in every audit I run.
Content behind a click. Tabs, accordions and “show more” that fetch the text at the moment the user clicks. If the text arrives with a request after the click, it does not exist for anyone who does not click. And bots do not click.
Infinite scroll. The catalogue of 600 products that loads twenty at a time as you scroll down. Google’s documentation puts it in a few words: Google Search does not interact with your page. It does not click and it does not scroll. Whatever does not load on its own, it does not see. A catalogue of 600 products can exist for the engine as 20 products.
The fake 404. When /product-that-does-not-exist answers with status 200 (the server’s “all good”) and shows “not found” through JavaScript, the engine receives a 200 from the server while the page is an error page. Google usually works this out and records a soft 404, wasting crawl budget on addresses that do not exist in the meantime. Engines that do not render JavaScript do not even have that ability.
The fix, which is not to rewrite anything
One thing: have the server send finished HTML.
In modern frameworks this is called server side rendering or static generation, and most of the time it does not require rewriting the site. For older applications there is a way too, and it is part of our job. The purpose is always the same: by the time the request arrives, the text is already there.
The gain is not only with the engines. It is in speed too, because the visitor sees text before the JavaScript has downloaded and run, and that is measured in Core Web Vitals. Two problems, one job.
And so as not to be a hypocrite: this site is static. Every page exists in full before anybody asks for it. We did not do it for the answer engines; we did it because it is the simplest thing that works, and it happened to also be the right thing.
When none of this matters
I do not want you changing things for no reason.
Whatever sits behind a login is crawled by nobody. Dashboards, internal tools, the customer area, the basket, the checkout. There JavaScript does exactly the job it was built for and there is no issue at all.
The question applies only to what you want found: home page, services, products, categories, articles, store pages. If those exist in the HTML, let the rest be built however it likes.
What it means for you
If the phrase you searched for at the start of this article was there, you are fine and you can close the article. If it was not, nothing is on fire today, but you now know where to look first if some of your pages are slow to be indexed or if no answer engine mentions you when people ask about your line of work. The same argument explains what happens outside Google.
If the phrase was not there, or some of your pages are slow to be indexed, we look at it with you and give you our findings in writing. Send me the site address and two or three pages you care about through the contact form. This check is part of our SEO and GEO service.
The whole picture: this article covers one part of a larger subject. If you are after the whole of it, from beginning to end, it is in the guide to answer engines.