Discussion
  • Entity SEO
  • JavaScript SEO
  • Structured Data

JSON-LD injected client-side in a headless setup: have you seen Google miss it, and how did you verify what it actually picked up?

Published 1 reply

Discussion starter: an entity SEO question, posted with an answer from Niraj Raut to open the thread. If you have dealt with this on a site, reply with what you saw, especially where it differs.

Disclosure: Niraj Raut, who posted this answer, runs the SEO consultancy linked at the end of it.

1 reply

  • admin
    Admin
    Original poster

    Google can read JSON-LD that JavaScript adds to the page, and its documentation is direct about it: “Google Search can understand and process structured data that’s available in the DOM when it renders the page”. So when client-side JSON-LD goes missing in a headless build, the useful question is not whether Google supports it, but whether Google’s render produced it at the moment Google rendered that page. The failures worth planning for happen at render time: a data call that fails or is blocked for Googlebot, a tag that waits for consent or interaction, a stale script bundle, or two blocks that disagree.

    The documented exception is commerce. On the same page, Google warns: “Dynamically-generated markup can make Shopping crawls less frequent and less reliable, which can be an issue for fast-changing content like product availability and price.” If a headless store injects price and availability on the client, that is the markup I would move into the server response first. For other types, client-side injection can work, but verify it with three views of the page rather than one tool.

    What Google documents, and what it leaves to you

    • Testing. Google recommends the Rich Results Test and says to use the URL input instead of the code input “because there are JavaScript limitations when using the code input (for example, CORS restrictions)”. Pasting a snippet into the code input tests something different from what Google crawls.
    • Types without a rich result. The test only reports types it supports. For the rest, Google’s guidance is: “If the rendered HTML contains the structured data, Google Search will be able to process it.” For those types, the rendered HTML is the check. FAQPage now sits in this group: FAQ rich results stopped appearing in May 2026 and Rich Results Test support was removed in June, so an absent FAQ report no longer tells you anything about detection.
    • Tag managers. Google describes injecting JSON-LD through a custom HTML tag in Google Tag Manager, and recommends not duplicating page information in the tag-inserted data, to avoid mismatches between the page and its structured data.
    • Rendering conditions. Pages with non-200 status codes might not be rendered, and Google caches resources aggressively and may ignore caching headers. An unhashed bundle can therefore produce last week’s markup on this week’s HTML.

    What Google does not publish is a fixed render timeout, so “the pricing API was slow” has no documented threshold. That gap is why the evidence has to come from your own pages.

    Where client-side JSON-LD goes missing in headless builds

    Failure point What happens during Google’s render How to confirm it
    Data call blocked or failing for Googlebot (robots.txt rule on the API path, bot management, rate limits, CORS) The script runs but gets no data, so it writes nothing or writes empty fields Failed resources and console messages in the live test; server or firewall logs for verified Googlebot requests to that endpoint
    Tag waits for consent or a click Google’s render does not click consent banners or buttons, so a tag waiting for either may never fire The tag’s trigger settings; rendered HTML from the live test
    Markup updated only on client-side route changes A direct load of a deep URL shows a default block, or none Test the deep URL directly, not by clicking through from the home page
    Stale script bundle Old schema shape or missing properties after a deploy A build marker on the script element (below)
    Server block from the CMS plus a client block from the app Two Product entities with different prices or identifiers Count application/ld+json blocks in the rendered HTML and compare their values
    Values chosen by visitor location or session Currency or price in the markup does not match what that market’s users see Compare the rendered markup with the visible price for each market; Googlebot’s requests may not come from the market you are checking
    Error status codes on the template Rendering might be skipped Status codes in logs and in the live test

    The consent row is easy to miss because it can pass manual checks: the person testing accepted the banner once and the browser remembers it. Test in a fresh profile, or read the rendered HTML Google produced, before assuming a tag fires for crawlers.

    How to verify what Google actually picked up

    Use three views per template, then scale up. Each view answers a different question.

    1. Raw response. Fetch the URL with curl and search for application/ld+json. If it is absent, every rich result on that template rests on a successful render.
    2. Live render. Run “Test live URL” in URL Inspection, or the Rich Results Test with the URL input. Check the rendered HTML for the block and its values, the detected items, resources that failed to load and console messages. The live test runs as Google-InspectionTool, so bot rules that treat it differently from Googlebot can make a live test pass while real crawls fail. There is also a per-property daily limit on live inspections, so treat it as a sampling tool.
    3. Indexed version. URL Inspection’s indexed result “describes any Search enhancements detected by Google on your URL the last time it was indexed”. That is the closest documented view of what Google stored, with the caveat that “Not all rich result types are supported by the tool yet.” If the live test detects items, the indexed result does not, and the last crawl date is after your deploy, that points to a difference between Google’s render at crawl time and your test.
    4. At scale. The URL Inspection API returns the same indexed-version rich result verdict per URL, so you can sample a few hundred URLs per template each day. Pair it with the rich result reports for the types your templates qualify for (Merchant listings, Product snippets and so on), comparing valid item counts with the number of indexed pages on each template. Then use the Search appearance filter in the Performance report to see whether detected markup produces rich results at all. Detection and display are separate decisions.
    5. Logs. Look for verified Googlebot requests to the API endpoints that feed the JSON-LD, and their status codes. Page crawls with no matching API calls, or API calls answered with 403 or 429, are strong candidates for the gaps you find.

    Build marker:

    Add attributes to each block, for example <script type="application/ld+json" data-origin="client" data-build="412">. Structured data parsers read only the script’s contents, but the attributes show up in rendered HTML, so one look at URL Inspection tells you which code path and which release produced the markup Google saw.

    Deciding what can stay client-side

    Markup Cost of a miss or a stale value Where I would render it
    Product and Offer (price, availability, shipping) Lost or wrong merchant listings; Google’s Shopping caveat applies Server, from the same data object that renders the visible price
    Types behind rich results that earn revenue (reviews, events, jobs, recipes) Lost enhancement until the next successful render Server if the rich result matters commercially; client-side only with monitoring
    BreadcrumbList, Organization, WebSite Low, and the values rarely change Either, once the indexed view confirms detection
    Anything another consumer needs (AI crawlers, social or feed scrapers) Invisible to consumers that do not execute JavaScript Server

    The last row is where client-side JSON-LD can cost you outside Google. Vercel’s December 2024 analysis of crawler traffic on nextjs.org and across its network found that “none of the major AI crawlers currently render JavaScript”, naming OpenAI’s and Anthropic’s crawlers, while Gemini (through Googlebot’s infrastructure) and AppleBot did render it. Crawler behaviour can change, so confirm it in your own logs, but a block that exists only after JavaScript runs should be treated as visible only to crawlers that render.

    In an SSR or static headless build, moving JSON-LD to the server is mostly moving code, not building a new data path: the data object that renders the visible content can render the script block in the same pass. That also removes the risk of the markup and the page disagreeing.

    A test that answers “is Google missing it?” for your templates

    If the markup matters and you want evidence rather than a rule of thumb, split one template:

    • Hypothesis: client-side injection lowers or delays detection on this template compared with server-rendered markup.
    • Groups: assign comparable pages by a hash of their ID, not by category, so crawl frequency and page type stay balanced. Group A gets server-rendered JSON-LD; group B keeps client-side injection.
    • Primary metrics: share of sampled URLs whose indexed URL Inspection result reports the expected items, and time from deploy to first detection, using each URL’s last crawl date.
    • Secondary metric: Search appearance impressions for the rich result type, split by group if the groups can be separated by URL pattern.
    • Duration: run until most sampled URLs in both groups show a crawl date after the deploy. For a template Google recrawls daily that can be days; for deep long-tail pages it can take much longer. Let the recrawl data set the end date, not a fixed number of weeks.
    • Decision: if group B matches group A on detection rate and speed, client-side is acceptable for that template. If B lags, or its gaps cluster on pages with slow or rate-limited API calls, fix the dependency or move the markup to the server.

    Hypothetical example:

    A headless store server-renders product pages, but a separate script injects Product JSON-LD after fetching the price from a pricing API that sits behind a bot-management rule. Live tests pass, because the rule lets Google-InspectionTool through without limits. During sales, Googlebot’s requests to the pricing API start receiving 429 responses. URL Inspection’s indexed results show product markup detected on some URLs and not others, with no pattern by category, and the logs line the gaps up with the rate-limited hours. The fix is not a better validator: it is rendering the JSON-LD on the server from the price data the page already uses.

    Where I would draw the line

    For Product and Offer markup, I would not wait for evidence of misses: Google’s own Shopping caveat is reason enough to render it on the server. For other types, client-side injection is acceptable while the indexed URL Inspection results for a sample of each template keep showing the markup as detected. The first time the live test and the indexed view disagree after a recrawl, treat it as a render dependency problem and move that markup into the server response.

    Need help with this on your own site?

    Niraj Raut works with businesses in Nepal, Australia, the UK, Europe and the US on technical SEO, ecommerce SEO, local SEO and AI search.

    See SEO services

Add a reply

Replies are open to approved members. Log in or apply to join.