<head>
— it should go inside a <script>
element there. While the structured data can be placed in the <body>
, placing it in the <head>
optimises it for search engine crawling.placing it in the <head> optimises it for search engine crawlingDo you have any evidence? Crawlers parse whole page to extract the data. Semantic html is important to structure raw text while here ld-json already explictly marked no matter where it is placed. The real difference can make dynamically injected content with javascript which requires crawlers to run the browsers which is much more expensive operation.