Google Warns On Using JavaScript For Structured Data

Jun 20, 2024 - 7:51 am 0 by

3d Printer Google Logo

In the Google Merchant Center structured data documentation, it says that you should add structured data to the HTML source and that it "can't be generated after a page has been loaded using JavaScript." This does not mean Google cannot process the structured data on the page if generated using JavaScript, but rather that it makes it harder for Google to do so.

Here is a screenshot of that line:

Gmc Structured Data Js Warning

Jarno van Driel posted about this on LinkedIn and said, "Google Search Central documentation explains how to add structured data markup via JavaScript, yet Google Merchant Center documentation mentions markup shouldn't be added after a page has been loaded." He asked, Which of the docs is correct?

Ryan Levering from Google chimed in and said technically both are right and Google needs to adjust the wording on the doc. He said, "We are working at finding the right wording to explain this discrepancy currently." He also warned "against running off and re-implementing your websites," if it works now, leave it.

He then goes on to explain that Google Merchant Center crawlers can and do process structured data when generated with JavaScript but they have seen quality and inconsistency issues with these implementations, so they recommend you do not use it.

He wrote:

It's not that GMC crawler can't ever render JS, but rather that there are more often quality problems with the rendering and discrepancies when sites do things like have one price on raw HTML load and then update that with a strikethrough price on render. It gets tricky when the markup is loaded one way on page load and then changed or rendered on top via JS.

So if the HTML source rendered and said one thing and then the JavaScript changes that later, it can confuse Google in some cases.

In terms of the documentation, he said, "I think it was easier to write in GMC to just say that it should be in the original page load and we're re-examining that phrasing now. In general if you have that ability that's likely going to be more consistent with all our systems, but it would be untrue to say that you can never do this."

Four years ago, Google came up with its structured data using JavaScript documentation - as a reminder.

Forum discussion at LinkedIn.

Update: Ryan posted on LinkedIn in response to the title of this story:

Maybe not exactly the spin I was trying to put on it :)....I was mostly saying that GMC is currently worded a bit more harshly than it should be. GMC currently says "You can't do this" which is what Jarno pointed out and I was saying it's just a recommendation.


Popular Categories

The Pulse of the search community


Search Video Recaps

Google Volatility, Indexing Bugs, Google Ads Broad Match Default & YouTube SEO Tips - YouTube
Video Details More Videos Subscribe to Videos

Most Recent Articles

Search Forum Recap

Daily Search Forum Recap: July 15, 2024

Jul 15, 2024 - 10:00 am
Google Search Engine Optimization

Google To Host More Creator Meetings

Jul 15, 2024 - 7:51 am

Google Tests AI-Organized Local Search Results Page

Jul 15, 2024 - 7:41 am

Report: Google AI Overviews Barely Showing Reddit Or Quora Citations Anymore

Jul 15, 2024 - 7:31 am

Google May Be Rolling Out 3D/AR Images More Widely

Jul 15, 2024 - 7:21 am
Google Search Engine Optimization

Google: Removing Massive Disavow Lists Should Not Worry You

Jul 15, 2024 - 7:11 am
Previous Story: Most Google People Also Ask Responses Are Wikipedia