ข้อมูลโรงแรมคือไฟล์ XML อย่างน้อย 1 ไฟล์ที่แสดงโรงแรมทั้งหมดที่คุณจะระบุข้อมูลราคา ตัวไฟล์ข้อมูลโรงแรมเองไม่มีข้อมูลราคาอยู่
องค์ประกอบรูทของข้อมูลโรงแรมคือองค์ประกอบ <listings>
ซึ่งมีองค์ประกอบ <listing>
ที่อธิบายที่พักของคุณ
คุณสร้างข้อมูลโรงแรมซึ่งเป็นส่วนหนึ่งของการใช้งานเริ่มต้น แล้วเพิ่มหรือนำโรงแรมออกโดยเป็นส่วนหนึ่งของการบำรุงรักษาตามปกติ
ตรวจสอบว่าไฟล์เป็นไปตามหลักเกณฑ์ไวยากรณ์
เช่น ใช้การเข้ารหัส UTF-8 และระบุสคีมาการเข้ารหัสนี้โดยรวมแอตทริบิวต์ encoding
ไว้ในแท็ก XML
หลังจากสร้างข้อมูลโรงแรมแล้ว ให้อัปโหลดข้อมูลไปยัง Google ด้วยตนเองโดยใช้ Hotel Center หรือโฮสต์ข้อมูลไว้ในเซิร์ฟเวอร์
ค้นหาและแก้ไขปัญหาเกี่ยวกับข้อมูล
หากต้องการค้นหาและแก้ไขปัญหาของข้อมูลในข้อมูลโรงแรม โปรดอ่านบทความต่อไปนี้
ข้อกำหนดของข้อมูล
ที่พักในข้อมูลโรงแรมต้องมีสิ่งต่อไปนี้จึงจะมีสิทธิ์ใช้ Google Hotel Ads
- ห้องที่แขกที่ชำระเงินเข้าพักได้
- มีสถานที่ตั้งจริงและสถานที่ตั้งตายตัวซึ่งเปิดให้สาธารณชนเข้าชม
- ผนังและท่อประปาคงที่
- ข้อกําหนดการเข้าพักขั้นต่ำต้องไม่เกิน 7 วัน
ตัวอย่างที่พบบ่อยของที่พักที่ไม่มีสิทธิ์ ได้แก่ การล่องเรือและอพาร์ตเมนต์เนื่องจากมักจะไม่เป็นไปตามเกณฑ์ Listing requirements
กระท่อมสำหรับตั้งแคมป์และสถานที่ตั้งแคมป์อื่นๆ ที่มีผนังยึดติดกับที่ ท่อประปา และระบบปรับอากาศ (รวมถึงเตาไม้หรือเครื่องทำความร้อนที่ใช้แก๊ส) จะมีสิทธิ์ใช้ ที่พักกลางแจ้งที่ไม่มีสิทธิ์ ได้แก่
- จุดตั้งแคมป์ที่แขกพักในเต็นท์
- ที่จอดรถบ้านที่แขกนำรถบ้านมาเอง
<listings>
<listings>
เป็นองค์ประกอบรูทของข้อมูลโรงแรม และมีองค์ประกอบ <language>
และ <listing>
อย่างน้อย 1 รายการ
องค์ประกอบ <listings>
จะปรากฏในตำแหน่งต่อไปนี้ในลำดับชั้น XML ของข้อมูลโรงแรม
+ <listings>
+ <language>
+ <datum>
+ <listing>
ไวยากรณ์
องค์ประกอบ <listings>
ใช้ไวยากรณ์ต่อไปนี้
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="xsi"
xsi:noNamespaceSchemaLocation="schema_xsd">
<language> language_code</language>
<datum> datum_code </datum>
<listing> listing</listing>
...
</listings>
Attributes
องค์ประกอบ <listings>
มีแอตทริบิวต์ต่อไปนี้
แอตทริบิวต์ | จำเป็นหรือไม่ | คำอธิบาย |
---|---|---|
xmlns:xsi |
จำเป็น | ตั้งค่าเป็น http://www.w3.org/2001/XMLSchema-instance |
xsi:noNamespaceSchemaLocation |
จำเป็น | ตั้งค่าเป็น http://www.gstatic.com/localfeed/local_feed.xsd |
องค์ประกอบลูก
องค์ประกอบ <listings>
มีองค์ประกอบย่อยต่อไปนี้
องค์ประกอบย่อย | จำเป็นหรือไม่ | ประเภท | คำอธิบาย |
---|---|---|---|
<language> | Required | string | ภาษาที่ใช้เขียนฟีด ตั้งค่าขององค์ประกอบนี้เป็น
รหัสภาษาแบบ 2 ตัวอักษร เช่น en สำหรับภาษาอังกฤษ |
<datum> | Optional | enum | องค์ประกอบนี้ระบุข้อมูลทางภูมิศาสตร์หรือโมเดลอ้างอิงสำหรับพิกัดละติจูด/ลองจิจูดที่ให้ไว้ในฟีด หากไม่ได้ระบุค่ามูลฐาน ค่าเริ่มต้นขององค์ประกอบนี้คือ WGS84 ซึ่งอุปกรณ์ GPS รุ่นใหม่ส่วนใหญ่จะใช้ ข้อมูลมาจากโตเกียวมีไว้สำหรับที่อยู่ในญี่ปุ่นเท่านั้น
ค่าที่ถูกต้องสำหรับองค์ประกอบนี้คือ
WGS84 อย่าใส่องค์ประกอบ <datum> ในข้อมูลโรงแรม
|
<listing> | Required | <listing> |
อย่างน้อย 1 รายการที่อธิบายถึงแต่ละโรงแรมในฟีด โปรดทราบว่าแต่ละโรงแรมในข้อมูลต้องมีรหัสที่ไม่ซ้ำกันสำหรับเว็บไซต์ของคุณ และไม่ควรใช้รหัสนี้ซ้ำ |
ตัวอย่าง
ที่อยู่แบบมีโครงสร้าง
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีที่อยู่แบบมีโครงสร้าง
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address format="simple">
<component name="addr1">6 Acacia Ave</component>
<component name="addr2">Floor 5</component>
<component name="city">London</component>
<component name="province">Greater London</component>
<component name="postal_code">SW1W 9TQ</component>
</address>
<country>GB</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
ที่อยู่รูปแบบอิสระ
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีที่อยู่รูปแบบอิสระ
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address>6 Elm Ave Unit 3, Boston, MA, 02472</address>
<country>US</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
เนื้อหาที่ไม่บังคับ
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีข้อมูล <content>
ที่ไม่บังคับ
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<id>123456</id>
<name>My Apartment</name>
<address format="simple">
<component name="addr1">1 Sandstone Building</component>
<component name="city">Los Angeles</component>
<component name="postal_code">90210</component>
<component name="province">CA</component>
</address>
<country>US</country>
<latitude>40.730610</latitude>
<longitude>-73.935242</longitude>
<phone type="main">12345678</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>
<text type="description">
<link>https://examplelisting.com/listings/12345</link>
<title>3 bedrooms with ocean views</title>
<body>Stay in this newly renovated 3BR house with ocean views.</body>
<date month="7" day="23" year="2023"/>
</text>
<review type="editorial">
<link>https://example.com/reviews/42</link>
<title>A little piece of heaven</title>
<author>EXAMPLE.COM</author>
<rating>8</rating>
<body>This place is really good.</body>
</review>
<review type="user">
<link>https://exampleperson.org/reviews/82</link>
<author>Susan von Trapp</author>
<rating>6</rating>
<body>Not a bad place, but I prefer to be closer to the beach.</body>
<date day="6" month="7" year="2023"/>
<servicedate day="16" month="6" year="2023"/>
</review>
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="rating">8.2</client_attr>
<client_attr name="num_reviews">14</client_attr>
</attributes>
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main hotel picture</title>
</image>
</content>
</listing>
...
</listings>
<listing>
คำจำกัดความโรงแรมภายในองค์ประกอบ <listings>
ของข้อมูลโรงแรม
องค์ประกอบ <listing>
จะปรากฏในตำแหน่งต่อไปนี้ในลำดับชั้น XML ของฟีดข้อมูลโรงแรม
+ <listings>
+ <language>
+ <listing>
ไวยากรณ์
องค์ประกอบ <listing>
ใช้ไวยากรณ์ต่อไปนี้
<?xml version="1.0" encoding="UTF-8"?>
<listings ... >
<listing>
<!-- Specify <listing>'s child elements in the order shown below. -->
<id>hotel_ID</id>
<name>hotel_name</name>
<address>
<component name="addr1">street_address_1</component>
<component name="addr2">street_address_2</component>
<component name="city">city_name</component>
<component name="province">province_name</component>
<component name="postal_code">postal_code</component>
</address>
<!-- You can also define an address freeform, although this is not recommended: -->
<!-- <address>freeform_address</address> -->
<country>country_code</country>
<latitude>hotel_latitude</latitude>
<longitude>hotel_longitude</longitude>
<phone type="[fax|main|mobile|tdd|tollfree]">phone_number</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>content</content>
</listing>
</listings>
Attributes
องค์ประกอบ <listing>
ไม่มีแอตทริบิวต์
องค์ประกอบลูก
องค์ประกอบ <listing>
มีองค์ประกอบย่อยต่อไปนี้
องค์ประกอบย่อย | จำเป็นหรือไม่ | ประเภท | คำอธิบาย |
---|---|---|---|
<id> | Required | string | ตัวระบุที่ไม่ซ้ำกันสําหรับโรงแรม
หมายเหตุ: ค่านี้ต้องไม่ซ้ำกับเว็บไซต์ของผู้อื่นตลอดเวลา อย่าใช้รหัสซ้ำ เพราะอาจทําให้เกิดปัญหาเมื่อพยายามแก้ปัญหาการจับคู่ที่พัก |
<name> | Required | string | ชื่อโรงแรม ดังตัวอย่างต่อไปนี้
<name>Belgrave House</name> |
<address> | Required | Object or string | สถานที่ตั้งจริงของโรงแรม องค์ประกอบนี้ใช้แอตทริบิวต์ คุณต้องระบุที่อยู่ เมือง รัฐหรือภูมิภาค และรหัสไปรษณีย์ของโรงแรมเป็นอย่างน้อย ใช้องค์ประกอบย่อย
เช่น <address format="simple"> <component name="addr1">6 Acacia Ave</component> <component name="addr2">Floor 5</component> <component name="city">London</component> <component name="province">Greater London</component> <component name="postal_code">SW1W 9TQ</component> </address> หรือคุณจะระบุที่อยู่ "รูปแบบอิสระ" ก็ได้ แต่เราไม่แนะนำวิธีนี้ เช่น <address>6 Elm Ave Unit 3, Boston, MA, 02472</address> โปรดทราบว่าตู้ ปณ. หรือที่อยู่ทางไปรษณีย์อื่นๆ สำหรับส่งจดหมายเท่านั้นไม่ถือว่าเป็นที่อยู่จริง |
<country> | Required | string | ประเทศที่ข้อมูลนี้ตั้งอยู่ ค่าต้องเป็นรหัสประเทศ 2 ตัวอักษร
เช่น สหรัฐอเมริกาคือ "US" และแคนาดาคือ "CA" ดังตัวอย่างต่อไปนี้
<country>US</country> |
<latitude> | Required* | float | ละติจูดที่ตรงกับสถานที่ตั้งของโรงแรม เช่น <latitude>37.423738</latitude> คุณสร้างค่านี้ได้ด้วยเครื่องมือการเข้ารหัสพิกัดภูมิศาสตร์เช่น Google Maps API |
<longitude> | Required* | float | ลองจิจูดที่ตรงกับสถานที่ตั้งของโรงแรม เช่น <longitude>-122.090101</longitude> คุณสร้างค่านี้ได้ด้วยเครื่องมือการเข้ารหัสพิกัดภูมิศาสตร์เช่น Google Maps API |
<location_precision> | Optional | integer | ความแม่นยำของตำแหน่งที่พักที่ส่งเป็นหน่วยเมตรเมื่อละติจูดและลองจิจูดของที่พักมีการปรับให้ยากต่อการอ่าน (Obfuscate) ศูนย์ (0) หมายถึงไม่มีการปรับให้ยากต่อการอ่าน (Obfuscation) และเป็นตำแหน่งที่ถูกต้อง หมายเหตุ: องค์ประกอบนี้ใช้กับที่พักให้เช่าเท่านั้น |
<phone> | Required* | string | หมายเลขติดต่อของโรงแรมอย่างน้อย 1 รายการ หากข้อมูลคือสาขาธุรกิจ โปรดระบุหมายเลขโทรศัพท์เฉพาะของสาขา (ไม่ใช่หมายเลขโทรศัพท์ของสำนักงานใหญ่ส่วนกลาง) แอตทริบิวต์
เช่น <!-- Singapore (country code +65) --> <phone type="main">+65 6722-2323</phone> <!-- U.S. (country code +1) --> <phone type="fax">+1 408-555-1111</phone> อย่างน้อยที่สุด คุณควรระบุประเภท |
<category> | Optional | string | ประเภทของที่พัก เช่น โรงแรม พาร์ทเนอร์อาจใช้หมวดหมู่ภายในใดก็ได้ที่มีเพื่ออธิบายถึงที่พัก เช่น "โรงแรมเพื่อธุรกิจ" "รีสอร์ต" "โมเทล" และสิ่งที่คล้ายกัน |
<content> |
Optional | <content> |
รายละเอียดที่ไม่บังคับที่ใช้สำหรับข้อมูล เช่น คำอธิบาย คะแนน และฟีเจอร์ของที่พัก |
* ต้องระบุหมายเลขโทรศัพท์หรือละติจูด/ลองจิจูด เราขอแนะนำให้คุณกำหนดทั้ง 2 อย่าง
ตัวอย่าง
ที่อยู่แบบมีโครงสร้าง
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีที่อยู่แบบมีโครงสร้าง
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address format="simple">
<component name="addr1">6 Acacia Ave</component>
<component name="addr2">Floor 5</component>
<component name="city">London</component>
<component name="province">Greater London</component>
<component name="postal_code">SW1W 9TQ</component>
</address>
<country>GB</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
ที่อยู่รูปแบบอิสระ
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีที่อยู่รูปแบบอิสระ
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address>6 Elm Ave Unit 3, Boston, MA, 02472</address>
<country>US</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
เนื้อหาที่ไม่บังคับ
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีข้อมูล <content>
ที่ไม่บังคับ
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<id>123456</id>
<name>My Apartment</name>
<address format="simple">
<component name="addr1">1 Sandstone Building</component>
<component name="city">Los Angeles</component>
<component name="postal_code">90210</component>
<component name="province">CA</component>
</address>
<country>US</country>
<latitude>40.730610</latitude>
<longitude>-73.935242</longitude>
<phone type="main">12345678</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>
<text type="description">
<link>https://examplelisting.com/listings/12345</link>
<title>3 bedrooms with ocean views</title>
<body>Stay in this newly renovated 3BR house with ocean views.</body>
<date month="7" day="23" year="2023"/>
</text>
<review type="editorial">
<link>https://example.com/reviews/42</link>
<title>A little piece of heaven</title>
<author>EXAMPLE.COM</author>
<rating>8</rating>
<body>This place is really good.</body>
</review>
<review type="user">
<link>https://exampleperson.org/reviews/82</link>
<author>Susan von Trapp</author>
<rating>6</rating>
<body>Not a bad place, but I prefer to be closer to the beach.</body>
<date day="6" month="7" year="2023"/>
<servicedate day="16" month="6" year="2023"/>
</review>
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="rating">8.2</client_attr>
<client_attr name="num_reviews">14</client_attr>
</attributes>
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main hotel picture</title>
</image>
</content>
</listing>
...
</listings>
<content>
เพิ่มข้อมูลเกี่ยวกับที่พัก เช่น คะแนนและรีวิว สิ่งอำนวยความสะดวก และรายละเอียดอื่นๆ คุณจะใส่องค์ประกอบ <content>
หรือไม่ก็ได้ องค์ประกอบย่อยทั้งหมดภายใน <content>
เป็นองค์ประกอบที่ไม่บังคับ
องค์ประกอบ <content>
จะปรากฏในตำแหน่งต่อไปนี้ในลำดับชั้น XML ของฟีดข้อมูลโรงแรม
+ <listings>
+ <language>
+ <listing>
+ <content>
ไวยากรณ์
องค์ประกอบ <content>
ใช้ไวยากรณ์ต่อไปนี้
<?xml version="1.0" encoding="UTF-8"?>
<listings ... >
<listing>
<content>
<!-- Specify <text>'s child elements in the order shown below. -->
<text type="description">
<link>listing_link</link>
<title>listing_title</title>
<author>listing_author</author>
<body>listing_description</body>
<date month="MM" day="DD" year="YYYY"/>
</text>
<!-- 0 or more reviews: -->
<review type="[editorial|user]">
...
</review>
<!-- 0 or more attributes: -->
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="alternate_hotel_id">alternate_hotel_id</client_attr>
<client_attr name="custom_0">custom_attribute_0</client_attr>
<client_attr name="custom_1">custom_attribute_1</client_attr>
<client_attr name="custom_2">custom_attribute_2</client_attr>
<client_attr name="custom_3">custom_attribute_3</client_attr>
<client_attr name="custom_4">custom_attribute_4</client_attr>
<client_attr name="hotel_brand">hotel_brand</client_attr>
<client_attr name="num_reviews">number_of_reviews</client_attr>
<client_attr name="rating">aggregate_rating</client_attr>
</attributes>
<!-- a picture of the hotel or property-->
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main Hotel Picture</title>
</image>
</content>
</listing>
...
</listings>
Attributes
องค์ประกอบ <content>
ไม่มีแอตทริบิวต์
องค์ประกอบลูก
องค์ประกอบ <content>
มีองค์ประกอบย่อยต่อไปนี้
องค์ประกอบย่อย | จำเป็นหรือไม่ | ประเภท | คำอธิบาย |
---|---|---|---|
<text |
Optional | Object | หน้าเว็บที่เชื่อมโยงกับข้อมูลจากผู้ให้บริการ มีองค์ประกอบย่อยดังนี้
หมายเหตุ: องค์ประกอบเหล่านี้ต้องปรากฏตามลำดับด้านบน |
<review |
Optional | <review> |
มีรีวิวผู้ใช้หรือรีวิวบรรณาธิการของข้อมูล ข้อมูลของคุณจะมีรีวิวทั้ง 2 ประเภทกี่รายการก็ได้ คุณไม่จำเป็นต้องใส่รีวิวทั้งหมดสำหรับที่พักในองค์ประกอบ |
<attributes> | Optional | Object | มีองค์ประกอบย่อย <client_attr name="attribute_name">attribute_value<client_attr> ดูรายการและคำอธิบายขององค์ประกอบย่อยได้ที่ องค์ประกอบ หากมีองค์ประกอบย่อย |
<image> | Optional | Object | แท็กซ้ำ มีข้อมูลรูปภาพโดยละเอียด |
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีองค์ประกอบ <content>
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<id>123456</id>
<name>My Apartment</name>
<address format="simple">
<component name="addr1">1 Sandstone Building</component>
<component name="city">Los Angeles</component>
<component name="postal_code">90210</component>
<component name="province">CA</component>
</address>
<country>US</country>
<latitude>40.730610</latitude>
<longitude>-73.935242</longitude>
<phone type="main">12345678</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>
<text type="description">
<link>https://examplelisting.com/listings/12345</link>
<title>3 bedrooms with ocean views</title>
<body>Stay in this newly renovated 3BR house with ocean views.</body>
<date month="7" day="23" year="2023"/>
</text>
<review type="editorial">
<link>https://example.com/reviews/42</link>
<title>A little piece of heaven</title>
<author>EXAMPLE.COM</author>
<rating>8</rating>
<body>This place is really good.</body>
</review>
<review type="user">
<link>https://exampleperson.org/reviews/82</link>
<author>Susan von Trapp</author>
<rating>6</rating>
<body>Not a bad place, but I prefer to be closer to the beach.</body>
<date day="6" month="7" year="2023"/>
<servicedate day="16" month="6" year="2023"/>
</review>
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="rating">8.2</client_attr>
<client_attr name="num_reviews">14</client_attr>
</attributes>
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main hotel picture</title>
</image>
</content>
</listing>
...
</listings>
<review>
รีวิวผู้ใช้หรือรีวิวบรรณาธิการ คุณไม่จำเป็นต้องใส่รีวิวทั้งหมดสำหรับรายชื่อในองค์ประกอบ <listing>
องค์ประกอบนี้มีไว้เพื่อให้คุณใส่รีวิวที่เลือกซึ่งบ่งบอกถึงฟีเจอร์หรือคุณภาพของข้อมูลนี้
องค์ประกอบ <review>
จะปรากฏในตำแหน่งต่อไปนี้ในลำดับชั้น XML ของฟีดข้อมูลโรงแรม
+ <listings>
+ <language>
+ <listing>
+ <content>
+ <review>
ไวยากรณ์
องค์ประกอบ <review>
ใช้ไวยากรณ์ต่อไปนี้
<?xml version="1.0" encoding="UTF-8"?>
<listings ... >
<listing>
<content>
...
<!-- Specify <review>'s child elements in the order shown below. -->
<review type="editorial">
<link>review_link</link>
<title>review_title</title> <!-- Title is for reviews of type "editorial" only -->
<author>review_author</author>
<rating>review_rating</rating>
<body>review_text</body>
<date>review_date</date>
<servicedate>review_servicedate</servicedate>
</review>
<review type="user">
<link>review_link</link>
<author>review_author</author>
<date month="MM" day="DD" year="YYYY"/> <!-- Date is for reviews of type "user" only -->
<servicedate month="MM" day="DD" year="YYYY"/> <!-- Service Date is for reviews of type "user" only -->
<rating>review_rating</rating>
<body>review_text</body>
</review>
</content>
</listing>
</listings>
Attributes
องค์ประกอบ <review>
มีแอตทริบิวต์ต่อไปนี้
แอตทริบิวต์ | จำเป็นหรือไม่ | คำอธิบาย |
---|---|---|
type | Required | ประเภทของรีวิว ตั้งค่าเป็นค่าใดค่าหนึ่งต่อไปนี้
|
องค์ประกอบลูก
องค์ประกอบ <review>
มีองค์ประกอบย่อยต่อไปนี้
องค์ประกอบย่อย | จำเป็นหรือไม่ | ประเภท | คำอธิบาย |
---|---|---|---|
<link> | Optional | string | ลิงก์ไปยังรีวิว รวม "http://" หรือ "https://" ในองค์ประกอบนี้ |
<title> | Optional | string | (รีวิวด้านบรรณาธิการเท่านั้น) ชื่อของรีวิว |
<author> | Optional | string | ผู้เขียนรีวิว เช่น "Susan von Trapp" ซึ่งอาจเป็นชื่อเว็บไซต์หรือสื่อเผยแพร่ที่รีวิวปรากฏขึ้น หากไม่ได้รับเครดิต |
<rating> | Optional | string | จำนวนลอยตัวตั้งแต่ 0 ถึง 10 ซึ่งแสดงคะแนนของรีวิว เช่น "8.9" |
<body> | Optional | string | ข้อความของรีวิว องค์ประกอบนี้ไม่ควรมี HTML |
<date month="MM" day="DD" year="YYYY"/> | Optional | Object | (รีวิวของผู้ใช้เท่านั้น) วันที่ของรีวิวซึ่งระบุด้วยแอตทริบิวต์ต่อไปนี้ขององค์ประกอบนี้
ตัวอย่างเช่น 7 มิถุนายน 2023 จะเป็นดังนี้ <date month="6" day="7" year="2023"/> |
<servicedate month="MM" day="DD" year="YYYY"/> | Optional | Object | (รีวิวของผู้ใช้เท่านั้น) วันที่ที่ผู้รีวิวเข้าชมข้อมูลที่ได้รับการรีวิว รูปแบบจะเหมือนกับ <date> ด้านบน
ตัวอย่างเช่น 7 มิถุนายน 2023 จะเป็นดังนี้ <servicedate month="6" day="7" year="2023"/> ระบบอาจไม่แสดงรีวิวที่ไม่ใส่เดือนและปีของ <servicedate> เป็นอย่างน้อย โดยไม่จำเป็นต้องระบุวัน |
โปรดทราบว่า <title>
จะเป็นองค์ประกอบย่อยที่ถูกต้องของ <review>
ก็ต่อเมื่อ type
ของรีวิวคือ editorial
และ <date>
จะใช้ได้ก็ต่อเมื่อ type
คือ user
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนพร้อมข้อมูลที่มีรีวิวจากบรรณาธิการและผู้ใช้
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<id>123456</id>
<name>My Apartment</name>
<address format="simple">
<component name="addr1">1 Sandstone Building</component>
<component name="city">Los Angeles</component>
<component name="postal_code">90210</component>
<component name="province">CA</component>
</address>
<country>US</country>
<latitude>40.730610</latitude>
<longitude>-73.935242</longitude>
<phone type="main">12345678</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>
<text type="description">
<link>https://examplelisting.com/listings/12345</link>
<title>3 bedrooms with ocean views</title>
<body>Stay in this newly renovated 3BR house with ocean views.</body>
<date month="7" day="23" year="2023"/>
</text>
<review type="editorial">
<link>https://example.com/reviews/42</link>
<title>A little piece of heaven</title>
<author>EXAMPLE.COM</author>
<rating>8</rating>
<body>This place is really good.</body>
</review>
<review type="user">
<link>https://exampleperson.org/reviews/82</link>
<author>Susan von Trapp</author>
<rating>6</rating>
<body>Not a bad place, but I prefer to be closer to the beach.</body>
<date day="6" month="7" year="2023"/>
<servicedate day="16" month="6" year="2023"/>
</review>
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="rating">8.2</client_attr>
<client_attr name="num_reviews">14</client_attr>
</attributes>
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main hotel picture</title>
</image>
</content>
</listing>
...
</listings>
<attributes>
แท็ก <attributes>
ใช้เพื่ออธิบายสิ่งอำนวยความสะดวกของที่พัก รวมถึงจัดประเภทคะแนนและรีวิวของที่พักได้
+ <listings>
+ <language>
+ <listing>
+ <content>
+ <review>
+ <attributes>
องค์ประกอบลูก
องค์ประกอบย่อย | จำเป็นหรือไม่ | คำอธิบาย | |
---|---|---|---|
<website> | Optional | เว็บไซต์หลักของโรงแรม หากมี จะต้องวางตำแหน่งไว้ก่อนองค์ประกอบแรกของ <client_attr> ตัวอย่าง:
<website>https://hotel.example.com</website> |
|
<client_attr name="attribute_name"> | Optional | ลักษณะเพิ่มเติมหรือ "แอตทริบิวต์" ของที่พักที่ระบุได้โดยใช้
attribute_name หรือ
attribute_name ที่รองรับสำหรับที่พักให้เช่า
|
ค่าสำหรับตัวยึดตำแหน่งค่าแอตทริบิวต์_name
ตารางต่อไปนี้แสดงค่าที่ถูกต้องสำหรับ attribute_name ในองค์ประกอบ <client_attr name="attribute_name">
ค่าสำหรับ attribute_name |
คำอธิบาย | ค่าเนื้อหาที่ถูกต้อง |
---|---|---|
alternate_hotel_id | ตัวระบุทางเลือกสําหรับที่พัก การมีรหัสแยกต่างหากจะเป็นประโยชน์ในกรณีที่คุณอาจต้องใช้ตัวระบุที่พักรายการหนึ่งสำหรับข้อมูลฟีดและใช้ตัวระบุที่พักอีกรายการหนึ่งสำหรับเครื่องมือการจอง | ค่าสตริงใดก็ได้ |
custom_[0-4] | แอตทริบิวต์ที่กำหนดเองประเภทสตริง ซึ่งจะไม่แสดงให้ผู้ใช้เห็น | ค่าสตริงใดก็ได้ |
hotel_brand | แบรนด์ของโรงแรม เช่น "Marriott" หรือ "Hilton" ชื่อนี้จะไม่แสดงต่อผู้ใช้ แต่จะใช้เพื่อจัดกลุ่มโรงแรมได้ | ค่าสตริงใดก็ได้ |
lodging | การแทนช่องทั้งหมดที่เข้ารหัสซึ่งมีอยู่ใน Lodging โปรโต |
สตริงที่เข้ารหัส Base64 ของโปรโตคอล Lodging ที่เข้ารหัส |
num_reviews | จำนวนรีวิวของโรงแรม | จำนวนเต็มที่ไม่เป็นลบ |
rating | จำนวนลอยตัวที่แสดงคะแนนที่พักโดยรวม | ตัวเลขนี้มักอยู่ในช่วง 0-5, 0-10 หรือ 0-100 แต่คุณจะใช้ช่วงใดก็ได้ที่แสดงระบบการจัดประเภทของคุณ |
ค่าสำหรับตัวยึดตำแหน่งattribute_nameสำหรับที่พักให้เช่า
โปรดดูแอตทริบิวต์เฉพาะสำหรับที่พักให้เช่าและตัวอย่าง XML
<image>
+ <listings>
+ <language>
+ <listing>
+ <content>
+ <review>
+ <attributes>
+ <image>
รูปภาพจะใช้เพื่อแสดงที่พักในรหัสโรงแรม รูปภาพทั้งหมดที่ใช้ต้องเป็นไปตามหลักเกณฑ์ต่อไปนี้
- สัดส่วนภาพที่แนะนำสำหรับรูปภาพคือ 4:3
- โปรแกรมรวบรวมข้อมูลรูปภาพ Googlebot ต้องเข้าถึง URL ของรูปภาพได้
หากเว็บไซต์มี robots.txt อยู่ที่ระดับรูท ให้ตรวจสอบว่าไฟล์มี 1 ใน 2 ตัวเลือกต่อไปนี้
อนุญาตให้โปรแกรมรวบรวมข้อมูล Googlebot รวบรวมข้อมูลเนื้อหาและรูปภาพในเว็บไซต์ของคุณ
- user-agent: Googlebot
- Allow: /
อนุญาตให้โปรแกรมรวบรวมข้อมูลรูปภาพ Googlebot รวบรวมข้อมูลรูปภาพในเว็บไซต์ของคุณ
- User-agent: Googlebot-Image
- Allow: /
ไม่อนุญาตให้ใช้ภาพหน้าจอของรูปภาพหรือเว็บไซต์ รูปภาพต้องเป็นรูปถ่าย ต้นฉบับหรือรูปถ่ายจริง
Attributes
"ad"
หากรูปภาพเป็นโฆษณา"menu"
หากรูปภาพเป็นเมนูร้านอาหาร"photo"
หากรูปภาพเป็นรูปภาพของธุรกิจ
ชื่อแอตทริบิวต์ | จำเป็นหรือไม่ | รูปแบบ | คำอธิบาย |
---|---|---|---|
type | Required | Text | รูปภาพต้องเป็นอย่างใดอย่างหนึ่งต่อไปนี้ |
url | Required | Text | URL ของรูปภาพขนาดเต็ม ใช้แอตทริบิวต์ URL เพื่อระบุรูปภาพที่จะใช้ในหน้านั้น |
width | Required | A non-negative integer | ความกว้างของรูปภาพเป็นพิกเซล (แนะนำให้มีขนาดใหญ่กว่า 720 พิกเซล) |
height | Required | A non-negative integer | ความสูงของรูปภาพเป็นพิกเซล (แนะนำให้มีขนาดใหญ่กว่า 720 พิกเซล) |
องค์ประกอบลูก
องค์ประกอบย่อย | จำเป็นหรือไม่ | คำอธิบาย |
---|---|---|
<link> | ขอแล้ว แต่ต้องระบุสำหรับข้อมูลรูปภาพในพื้นที่ | แท็กนี้มี URL ที่ถูกต้องและเป็นปัจจุบันของหน้าในเว็บไซต์ซึ่งมีรูปภาพที่เกี่ยวข้องอยู่ แต่จะไม่มี URL ของรูปภาพ
เช่น<link><http://www.example.com/magic_pizza/></link> |
<title> | ส่งคำขอแล้ว | แท็กนี้มีชื่อของรูปภาพ ตัวอย่าง:
<title>"Luxury Apartment"</title> |
<author> | ไม่จำเป็น | ชื่อผู้เขียนเนื้อหา ค่าอาจเป็นชื่อผู้ใช้หรือชื่อเต็มในรูปแบบ "ชื่อ นามสกุล" |
<date> | จำเป็น | แท็กนี้จะระบุวันที่สร้างรายการเนื้อหา คุณต้องป้อนปี เดือน และวันตามตัวอย่างต่อไปนี้ <date month="6" day="7" year="2023"/> |
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงข้อมูลโรงแรมบางส่วนที่มีแท็กรูปภาพ
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<content>
<review>
</review>
<attributes>
</attributes>
<image type="photo" url="https://image_url" width="400" height="300">
<link>https://image_url</link>
<title>Apartment at Sandstone</title>
<author>Jessica Landlord</author>
<date month="6" day="7" year="2023"/>
</image>
</content>
</listing>
...
</listings>
หลักเกณฑ์ไวยากรณ์
เมื่อสร้างข้อมูลโรงแรมแบบ XML ให้ใช้หลักเกณฑ์ต่อไปนี้
ตรวจสอบความถูกต้องของไฟล์ XML ข้อมูลโรงแรมด้วยสคีมา XSD ของ Google
ใช้การเข้ารหัส UTF-8 ระบุสคีมาการเข้ารหัสนี้โดยรวมแอตทริบิวต์
encoding
ในแท็ก XML ดังที่แสดงในตัวอย่างด้านล่างคุณระบุค่าของข้อมูลในฟีดได้ในส่วน
CDATA
หากใช้ส่วนCDATA
โปรดอย่ากำหนดสัญลักษณ์พิเศษเป็นอักขระหลีกใช้รหัสยกเว้นสำหรับค่าข้อมูลที่ไม่ได้อยู่ในส่วน
CDATA
รวมถึง URL คุณจะใช้รหัสเอนทิตีหรือรหัสอักขระเพื่อแสดงอักขระพิเศษเหล่านี้ได้ ตารางต่อไปนี้แสดงรายการรหัสเอนทิตีและรหัสอักขระทั่วไปที่คุณสามารถใช้ได้อักขระ เอนทิตี รหัสอักขระ เครื่องหมายและ (&) & & เครื่องหมายคำพูดเดี่ยว (') ' ' เครื่องหมายคำพูดคู่ (") " " เครื่องหมายมากกว่า (>) > > เครื่องหมายน้อยกว่า (<) < < ละเว้นองค์ประกอบ XML ที่ไม่มีข้อมูล เช่น หากคุณไม่มีละติจูดและลองจิจูดของโรงแรม คุณไม่ควรใส่องค์ประกอบ
<latitude/>
และ<longitude/>
ที่ว่างเปล่าอย่าใช้ HTML ในองค์ประกอบ XML ไม่ว่าในกรณีใดๆ (แม้ว่าจะมีการกำหนดเป็นอักขระหลีก)
คุณใช้ XSD ของฟีดในเครื่อง http://www.gstatic.com/localfeed/local_feed.xsd เพื่อตรวจสอบฟีดก่อนที่จะอัปโหลดได้
หากต้องการใช้ความคิดเห็นในฟีด ให้รวมความคิดเห็นไว้ในแท็ก
<!--
และ-->
ตามตัวอย่างต่อไปนี้<!-- This is a comment -->
โปรดตรวจสอบว่าปิดองค์ประกอบ
<date>
ของผู้ใช้<review>
แล้ว เช่น<date day="2" month="12" year="2017"/>