软件应用 (SoftwareApplication
) 结构化数据
在网页的正文中标记软件应用信息,可以更好地在 Google 搜索结果中显示您的应用详情。
如何添加结构化数据
结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的运作方式。
下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab。
- 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据。
- 遵循指南。
- 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
- 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、
noindex
标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址。 - 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图。Search Console Sitemap API 可以帮助您自动执行此操作。
示例
下面是一个 JSON-LD 格式的软件应用示例:
<html> <head> <title>Angry Birds</title> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "SoftwareApplication", "name": "Angry Birds", "operatingSystem": "ANDROID", "applicationCategory": "GameApplication", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.6", "ratingCount": "8864" }, "offers": { "@type": "Offer", "price": "1.00", "priceCurrency": "USD" } } </script> </head> <body> </body> </html>
下面是一个 RDFa 格式的软件应用示例:
<div vocab="https://schema.org/" typeof="SoftwareApplication"> <span property="name">Angry Birds</span> - REQUIRES <span property="operatingSystem">ANDROID</span> TYPE: <span property="applicationCategory" content="GameApplication">Game</span> RATING: <div property="aggregateRating" typeof="AggregateRating"> <span property="ratingValue">4.6</span> ( <span property="ratingCount">8864</span> ratings ) </div> <div property="offers" typeof="Offer"> Price: $<span property="price">1.00</span> <meta property="priceCurrency" content="USD" /> </div> </div>
下面是一个微数据格式的软件应用示例:
<div itemscope itemtype="https://schema.org/SoftwareApplication"> <span itemprop="name">Angry Birds</span> - REQUIRES <span itemprop="operatingSystem">ANDROID</span> TYPE: <span itemprop="applicationCategory" content="GameApplication">Game</span> RATING: <div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> <span itemprop="ratingValue">4.6</span> ( <span itemprop="ratingCount">8864</span> ratings ) </div> <div itemprop="offers" itemscope itemtype="https://schema.org/Offer"> Price: $<span itemprop="price">1.00</span> <meta itemprop="priceCurrency" content="USD" /> </div> </div>
指南
要使您的应用能够显示为富媒体搜索结果,您必须遵循以下指南。
结构化数据类型定义
若要使您的内容能够显示为富媒体搜索结果,您必须为其添加必要属性。还有一些建议添加的属性,能帮助您添加更多与您的内容相关的信息,进而提供更好的用户体验。
SoftwareApplication
如需了解 SoftwareApplication
的完整定义,请访问 schema.org/SoftwareApplication。
Google 支持的属性如下:
必需的属性 | |||||
---|---|---|---|---|---|
name
|
应用的名称。 |
||||
offers.price
|
应用的销售优惠。对于开发者,
如果应用是免费提供的,请将 "offers": { "@type": "Offer", "price": "0" }
如果应用的价格大于 0,您必须添加 "offers": { "@type": "Offer", "price": "1.00", "priceCurrency": "USD" } |
||||
评分或评价 |
应用评分或评价。您必须添加以下属性之一:
|
建议添加的属性 | |
---|---|
applicationCategory
|
应用类型(例如, 支持的应用类型列表
|
operatingSystem
|
使用应用所需的操作系统(例如, |
应用子类型的扩展属性
对于移动应用和 Web 应用,Google 还支持 MobileApplication
和 WebApplication
。
对于只有 VideoGame
类型的软件应用,Google 不会显示富媒体搜索结果。
为了确保您的软件应用能够显示为富媒体搜索结果,请同时列出 VideoGame
类型与其他类型。例如:
{ "@context": "https://schema.org", "@type": ["VideoGame", "MobileApplication"], .... }
Troubleshooting
If you're having trouble implementing or debugging structured data, here are some resources that may help you.
- If you're using a content management system (CMS) or someone else is taking care of your site, ask them to help you. Make sure to forward any Search Console message that details the issue to them.
- Google does not guarantee that features that consume structured data will show up in search results. For a list of common reasons why Google may not show your content in a rich result, see the General Structured Data Guidelines.
- You might have an error in your structured data. Check the list of structured data errors and the Unparsable structured data report.
- If you received a structured data manual action against your page, the structured data on the page will be ignored (although the page can still appear in Google Search results). To fix structured data issues, use the Manual Actions report.
- Review the guidelines again to identify if your content isn't compliant with the guidelines. The problem can be caused by either spammy content or spammy markup usage. However, the issue may not be a syntax issue, and so the Rich Results Test won't be able to identify these issues.
- Troubleshoot missing rich results / drop in total rich results.
- Allow time for re-crawling and re-indexing. Remember that it may take several days after publishing a page for Google to find and crawl it. For general questions about crawling and indexing, check the Google Search crawling and indexing FAQ.
- Post a question in the Google Search Central forum.