W
W
weranda2018-02-14 11:51:18
Search Engine Optimization
weranda, 2018-02-14 11:51:18

Where and how to place microdata on a page in JSON-LD format?

For a number of reasons, I decided to convert the micro-markup to the JSON-LD format (I'm tired of the mess of additional tags on the page), but I can't figure out where to place the code on the page and whether it is possible to combine several formats in one script. I propose to consider accommodation options.
Input data: there are several blocks on the page (article, person, video, and others).
Option number 1
Place immediately above or below each script block.

the code
<div>
  <div class="foto">фото</div>
  <div class="position">должность</div>
  <div class="address">адрес</div>
  <div class="city">город</div>
</div>
<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Иннокентий",
  "jobTitle": "Депутат",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Москва",
    "addressRegion": "ЦФО"
  }
}
</script>
<!-- Далее идут блоки в таком же порядке: 
сначала HTML код блока и за ним — микроразметка-->

Option #2

Place all scripts separately at the bottom of the page.
the code
<div>блок персоны</div>
<div>блок видео</div>
<!-- тут много другого кода -->
<script type="application/ld+json">микроразметка блока персоны</script>
<script type="application/ld+json">микроразметка блока видео</script>

Option number 3

Place all scripts in one block at the top or bottom of the page.
the code
<div>блок персоны</div>
<div>блок видео</div>
<!-- тут много другого кода -->
<script type="application/ld+json">
  микроразметка блока персоны
  микроразметка блока видео
</script>

There can be many blocks for micromarking. According to the HTML structure, one block can be included in another (example: a block with a persona and a video is embedded in an article). The zib and gosh validators don't swear at any of the examples.
What do you recommend, what is the right way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Gvozdev, 2019-08-15
@arty23_03

Hey!
This is how EA.COM does it.
That is, you can describe all the entities that are on the page, you can in 1 script and 1 time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question