Несколько избранных фрагментов FAQPage на одной странице

Мы хотим добавить избранные фрагменты в виде страницы часто задаваемых вопросов с использованием JSON- формат ЛД. С помощью ссылки «Просмотреть разметку» на странице FAQPage, приведенной на странице Google, мы можем получить приведенный ниже пример избранного фрагмента. Кажется, это означает, что все вопросы для страницы должны быть в одном теге <script>.

Мы проверили следующее с помощью Инструмента тестирования структурированных данных Google и Инструмент расширенных результатов и не дал никаких ошибок. Однако нет упоминания о том, что все это находится в одном теге script.

Вопрос

Если мы собираемся использовать FAQPage избранных фрагмента, какой правильный вариант нам нужно использовать (1 или 2)?

Что мы пробовали

Вариант 1. Содержит все вопросы в одном теге script:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }, {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
    }]
  }
</script>

Вариант 2. Каждый вопрос разделен на разные теги script:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": {
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"
    }
  }
}
</script>

person usernameabc    schedule 22.05.2019    source источник


Ответы (3)


Руководство Google по странице часто задаваемых вопросов говорит нам:

Страница часто задаваемых вопросов (FAQ) содержит список вопросов и ответов, относящихся к определенной теме.

Используйте FAQPage, только если на вашей странице есть список вопросов с ответами.

Также в этом руководстве есть следующий пример:

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }, {
    "@type": "Question",
    "name": "How long does it take to process a refund?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
    }
  }, {
    "@type": "Question",
    "name": "What is the policy for late/non-delivery of items ordered online?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href='https://example.com/orders/'>Click here</a> to complete the form with your order-related question(s).</p>"
    }
  }, {
    "@type": "Question",
    "name": "When will my credit card be charged?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
    }
  }, {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
    }]
  }

Таким образом, ответ на ваш вопрос может быть следующим: используйте первый из указанных вами вариантов и создайте полное соответствие ваших данных указанному гугл-гайду.

person nikant25    schedule 23.05.2019

Вы можете использовать столько элементов script сколько хотите, но вам нужно указать, что элементы FAQPage одинаковы. Вы делаете это, предоставляя им один и тот же URI (в @id).

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": {
    "@type": "Question",
    "name": "What is the return policy?"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?"
  }
}
</script>

Вместо того, чтобы повторять FAQPage в каждом элементе script, вы можете определить его только один раз и ссылаться на каждый вопрос (через его @id):

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": [
    {"@id": "/faq#1"},
    {"@id": "/faq#2"}
  ]
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Question",
  "@id": "/faq#1",
  "name": "What is the return policy?"
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Question",
  "@id": "/faq#2",
  "name": "Will I be charged sales tax for online orders?"
}
</script>

(Вместо этого вы можете использовать mainEntityOfPage, если не хотите перечислять все вопросы из FAQPage . Однако в документации Google это не упоминается. Другой альтернативой является использование @reverse.)


Вы не объяснили, почему хотите использовать несколько элементов script. Возможно, это сработает в вашем случае, если вы используете один элемент script, но с несколькими элементами верхнего уровня (используя @graph).

person unor    schedule 23.05.2019