民宿 (VacationRental
) 结构化数据
![Google 搜索中的民宿图示](https://developers.google.cn/static/search/docs/images/vacation-rental-rich-result.png?authuser=0&hl=sr)
如果您向民宿商家信息页面添加结构化数据,Google 搜索便能够以更丰富的方式显示商家信息。用户可以直接在搜索结果中查看商家信息,例如名称、说明、图片、位置、评分、评价等。
开始之前
本文中的说明适用于相应人士已与 Google 技术支持客户经理联系且有权访问 Hotel Center 的网站。如果您想要集成民宿商家信息,但 Google 尚未与您联系,请使用民宿意向调查表与我们联系。
此功能仅适用于符合特定资格条件的网站,并且需要执行额外步骤才能完成集成。如需详细了解如何在 Google 上列出您的民宿,请参阅集成入门指南。
如何添加结构化数据
结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的运作方式。
下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab。
- 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据。
- 遵循指南。
- 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
- 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、
noindex
标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址。 - 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图。Search Console Sitemap API 可以帮助您自动执行此操作。
示例
下面是一个 JSON-LD 格式的民宿商家信息简单示例。
<html> <head> <title>My Beautiful Vacation Rental</title> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "VacationRental", "additionalType": "HolidayVillageRental", "brand": { "@type": "Brand", "name": "brandIdName" }, "containsPlace": { "@type": "Accommodation", "additionalType": "EntirePlace", "bed": [{ "@type": "BedDetails", "numberOfBeds" : 1, "typeOfBed": "Queen" }, { "@type": "BedDetails", "numberOfBeds" : 2, "typeOfBed": "Single" }], "occupancy": { "@type": "QuantitativeValue", "value" : 2 }, "amenityFeature": [ { "@type": "LocationFeatureSpecification", "name": "ac", "value": true }, { "@type": "LocationFeatureSpecification", "name": "airportShuttle", "value": true }, { "@type": "LocationFeatureSpecification", "name": "balcony", "value": true }, { "@type": "LocationFeatureSpecification", "name": "beachAccess", "value": true }, { "@type": "LocationFeatureSpecification", "name": "childFriendly", "value": true } ], "floorSize": { "@type": "QuantitativeValue", "value" : 75, "unitCode": "MTK" }, "numberOfBathroomsTotal": 1, "numberOfBedrooms": 3, "numberOfRooms": 5 }, "identifier": "abc123", "latitude": "42.12345", "longitude": "101.12345", "name": "My Beautiful Vacation Rental", "address": { "addressCountry": "US", "addressLocality": "Mountain View", "addressRegion": "California", "postalCode": "94043", "streetAddress": "1600 Amphitheatre Pkwy, Unit 6E" }, "aggregateRating": { "ratingValue": 4.5, "ratingCount": 10, "reviewCount": 3, "bestRating": 5 }, "image": [ "https://example.com/mylisting/unit_image1.png", "https://example.com/mylisting/unit_image2.png", "https://example.com/mylisting/unit_image3.png", "https://example.com/mylisting/unit_image4.png", "https://example.com/mylisting/unit_image5.png", "https://example.com/mylisting/unit_image6.png", "https://example.com/mylisting/unit_image7.png", "https://example.com/mylisting/unit_image8.png" ], "checkinTime": "18:00:00+08:00", "checkoutTime": "11:00:00+08:00", "description": "A great Vacation Rental in the perfect neighborhood.", "knowsLanguage": ["en-US", "fr-FR"], "review": [{ "@type": "Review", "reviewRating": { "@type": "Rating", "ratingValue": 4, "bestRating": 5 }, "author": { "@type": "Person", "name": "Lillian Ruiz" }, "datePublished": "2024-12-01", "contentReferenceTime": "2024-11-17" }, { "@type": "Review", "reviewRating": { "@type": "Rating", "ratingValue": "5", "bestRating": "5" }, "author": { "@type": "Person", "name": "John S." }, "datePublished": "2024-10-01", "contentReferenceTime": "2024-09-28" } ] } </script> </head> <body></body> </html>
资格要求指南
民宿结构化数据必须遵循以下指南,才能在 Google 搜索中使用。
结构化数据类型定义
下表列出了使用 schema.org/VacationRental 标记民宿商家信息的属性和用法。为使您的结构化数据能够显示,您必须为其添加必需的属性。您还可添加建议的属性,以便添加与您的内容相关的更多信息,进而提供更好的用户体验。
VacationRental
如需了解 VacationRental
的完整定义,请访问 schema.org/VacationRental。
必需属性 | |
---|---|
containsPlace
|
民宿商家信息必须包含一个 Accommodation 以标记其他详细信息,例如床位、入住人数、客房数和 |
containsPlace.occupancy
|
有关民宿商家信息中允许入住人数上限的信息。 "occupancy": { "@type": "QuantitativeValue", "value" : 5 } |
containsPlace.occupancy.value
|
民宿商家信息中允许入住的人数值。 |
identifier
|
房源的唯一标识符。 其他指南:
|
image
|
重复 一张或多张商家信息图片。商家信息必须至少包含 8 张照片(以下每个类别至少 1 张照片):卧室、浴室和公共区域。 此外,还需遵循房源商家信息图片要求。 |
latitude (或 geo.latitude )
|
商家所在位置的纬度。精度必须至少为 5 位小数。 |
longitude (或 geo.longitude )
|
商家所在位置的经度。精度必须至少为 5 位小数。 |
name
|
民宿商家信息的名称。 |
建议的属性 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
additionalType
|
民宿商家信息的类型。以下是一些建议的值:
这些值的完整定义请参阅住宿商家类别。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address
|
民宿的完整实际位置。 提供民宿的街道地址、城市、州/省或地区以及邮政编码。如果适用,请提供单元号或公寓号。 请注意,邮政信箱或其他仅限邮寄的地址不属于完整的实际地址。 "address": { "addressCountry": "US", "addressLocality": "Mountain View", "addressRegion": "California", "postalCode": "94043", "streetAddress": "1600 Amphitheatre Pkwy, Apartment 4E" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address.addressCountry
|
民宿商家所属的国家/地区,使用两个字母的 ISO 3166-1 alpha-2 国家/地区代码。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address.addressLocality
|
民宿商家所在的城市。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address.addressRegion
|
商家信息中的州、地区或省的名称。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address.postalCode
|
民宿商家的邮政编码。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
address.streetAddress
|
民宿商家信息中的完整街道地址,包括单元号或公寓号(如适用)。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
aggregateRating
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
brand
|
与此房源相关的品牌 ID。如需详细了解如何将房源与品牌相关联,以及如何将品牌图标和显示名称与相应的品牌 ID 相关联,请参阅 Hotel Center 文档。 "brand": { "@type": "Brand", "name" : "brandIdName" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
checkinTime
|
房客最早入住住宿场所的时间,采用 ISO 8601 格式。 示例: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
checkoutTime
|
房客最晚入住住宿场所的时间,采用 ISO 8601 格式。 示例: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.additionalType
|
此住宿的客房类型。请使用以下某个值:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.amenityFeature
|
房源是否提供特定功能或酒店设施。布尔值示例遵循以下模式: "amenityFeature": { "@type": "LocationFeatureSpecification", "name" : "featureName", "value": true }布尔值 为
非布尔值 对于 非布尔值遵循以下模式: "amenityFeature": { "@type": "LocationFeatureSpecification", "name" : "featureName", "value": "detail" }
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.bed
|
重复 商家信息中的床位类型和数量信息。 "bed": [{ "@type": "BedDetails", "numberOfBeds" : 1, "typeOfBed": "Queen" }, { "@type": "BedDetails", "numberOfBeds" : 2, "typeOfBed": "Single" }] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.bed.numberOfBeds
|
商家信息中的床位数。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.bed.typeOfBed
|
商家信息中的床位类型。以下是一些建议的值:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.floorSize
|
住宿场所的大小。必须使用
"floorSize": { "@type": "QuantitativeValue", "value" : 75, "unitCode": "MTK" } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.numberOfBathroomsTotal
|
商家信息中的总浴室数。请遵循 RESO 中所述的房地产惯例,并使用浴室数量的简单总和。例如,如果房源有两个标准浴室和一个半套浴室,则浴室总数为 2.5。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.numberOfBedrooms
|
商家信息中的卧室总数。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
containsPlace.numberOfRooms
|
商家信息中的客房总数。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description
|
对房源的说明。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
knowsLanguage
|
屋主可以使用的语言。请使用符合 IETF BCP 47 标准的语言代码,例如 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
review
|
商家信息的一条或多条用户评价。请遵循评价摘要指南,并查看评价属性的必要属性和建议属性列表。 "review": { "@type": "Review", "reviewRating": { "@type": "Rating", "ratingValue": "4", "bestRating": "5" }, "datePublished": "2023-02-09" "author": { "@type": "Person", "name": "Lillian R" } } |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
review.contentReferenceTime
|
作者入住的开始日期。 |
使用 Search Console 监控富媒体搜索结果
Search Console 是一款工具,可帮助您监控网页在 Google 搜索结果中的显示效果。即使没有注册 Search Console,您的网页也可能会显示在 Google 搜索结果中,但注册 Search Console 能够帮助您了解 Google 如何查看您的网站并做出相应的改进。建议您在以下情况下查看 Search Console:
首次部署结构化数据后
等 Google 将网页编入索引后,请在相关的富媒体搜索结果状态报告中查看是否存在问题。 理想情况下,有效项目数量会增加,而无效项目数量不会增加。如果您发现结构化数据存在问题,请执行以下操作:
发布新模板或更新代码后
如果对网站进行重大更改,请监控结构化数据无效项目的增幅。- 如果您发现无效项目增多了,可能是因为您推出的某个新模板无法正常工作,或者您的网站以一种新的错误方式与现有模板交互。
- 如果您发现有效项目减少了(但无效项目的增加情况并不对应),可能是因为您的网页中未再嵌入结构化数据。请通过网址检查工具了解导致此问题的原因。
定期分析流量时
请使用效果报告分析您的 Google 搜索流量。数据将显示您的网页在 Google 搜索结果中显示为富媒体搜索结果的频率、用户点击该网页的频率以及网页在搜索结果中的平均排名。您还可以使用 Search Console API 自动提取这些结果。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.