การอ้างอิง XML ของข้อมูลโรงแรม

ข้อมูลโรงแรมคือไฟล์ 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
  • wgs84
  • TOKYO
  • tokyo
หมายเหตุ: หากต้องการใช้ค่าเริ่มต้น 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, 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

ตําแหน่งที่ตั้งจริงของโรงแรม

องค์ประกอบนี้ใช้แอตทริบิวต์ format อย่างเดียว ซึ่งคุณต้องตั้งค่าเป็น simple

คุณต้องระบุที่อยู่ เมือง รัฐ หรือภูมิภาค และรหัสไปรษณีย์ของโรงแรมเป็นอย่างน้อย ใช้องค์ประกอบย่อย <component> เพื่ออธิบายแต่ละส่วนของที่อยู่ดังต่อไปนี้

  • addr1: ที่อยู่หลักของโรงแรม
  • addr2: ที่อยู่สำรอง หากจำเป็น
  • addr3: ส่วนที่ 3 ของที่อยู่ หากจำเป็น
  • city: ชื่อเมืองที่โรงแรมตั้งอยู่
  • province: ชื่อรัฐ ภูมิภาค หรือจังหวัดที่โรงแรมตั้งอยู่
  • postal_code: รหัสไปรษณีย์ของโรงแรม

เช่น

<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, 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 ความแม่นยำของตำแหน่งที่พักที่ส่งเป็นหน่วยเมตรเมื่อละติจูดและลองจิจูดของที่พักมีความสับสน ศูนย์ (0) หมายความว่าไม่มีการสร้างความสับสนและเป็นตำแหน่งที่ถูกต้อง หมายเหตุ: องค์ประกอบนี้ใช้กับที่พักให้เช่าเท่านั้น
<phone> Required* string

หมายเลขติดต่อของโรงแรมอย่างน้อย 1 รายการ หากรายชื่อนี้เป็นสาขาหนึ่งของธุรกิจ โปรดระบุหมายเลขโทรศัพท์เฉพาะของสาขา (ไม่ใช่หมายเลขโทรศัพท์ของสำนักงานใหญ่ส่วนกลาง)

แอตทริบิวต์ type อาจเป็นค่าใดค่าหนึ่งต่อไปนี้

  • fax: หมายเลขโทรศัพท์เครื่องโทรสาร
  • main: หมายเลขโทรศัพท์หลัก
  • mobile: หมายเลขโทรศัพท์มือถือ
  • tdd: หมายเลขโทรศัพท์ของอุปกรณ์โทรคมนาคมสําหรับคนหูหนวก (TDD)
  • tollfree: หมายเลขโทรศัพท์โทรฟรี

เช่น

<!-- Singapore (country code +65) -->
<phone type="main">+65 6722-2323</phone>
<!-- U.S. (country code +1) -->
<phone type="fax">+1 408-555-1111</phone>

คุณควรระบุประเภท main เป็นอย่างน้อย

<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, 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 type="description"> Optional Object

หน้าเว็บที่เชื่อมโยงกับข้อมูลจากผู้ให้บริการ มีองค์ประกอบย่อยต่อไปนี้

  • <link>: ลิงก์ไปยังคำอธิบาย รวม "http://" หรือ
    "https://" ในองค์ประกอบนี้ (ไม่บังคับ)
  • <title>: ชื่อคำอธิบาย (ไม่บังคับ)
  • <author>: ผู้เขียนคำอธิบาย (ไม่บังคับ)
  • <body>: เนื้อหาของคำอธิบาย (ต้องระบุ)
  • <date>: วันที่ของคำอธิบาย (ไม่บังคับ)
  • หมายเหตุ: องค์ประกอบเหล่านี้ต้องปรากฏตามลำดับด้านบน

<review type="[editorial|user]"> Optional <review>

มีรีวิวผู้ใช้หรือรีวิวบรรณาธิการของข้อมูล โดยจะมีทั้งรีวิวในข้อมูลธุรกิจนั้นกี่รายการก็ได้

คุณไม่จำเป็นต้องใส่รีวิวทั้งหมดสำหรับที่พักในองค์ประกอบ <listing> องค์ประกอบนี้มีไว้เพื่อให้คุณใส่รีวิวที่เลือกซึ่งแสดงจุดเด่นหรือคุณภาพของข้อมูล

<attributes> Optional Object

มีองค์ประกอบย่อย <client_attr> 0 รายการขึ้นไปที่มีรายละเอียดเกี่ยวกับที่พัก องค์ประกอบย่อยใช้ไวยากรณ์ต่อไปนี้

<client_attr name="attribute_name">attribute_value<client_attr>

สำหรับรายการและคำอธิบายขององค์ประกอบย่อย โปรดดู <attributes>

องค์ประกอบ <client_attr> ทั้งหมดเป็นค่าที่ไม่บังคับ

หากมีองค์ประกอบย่อย <website> จะต้องอยู่ก่อนองค์ประกอบ <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 ประเภทของรีวิว ตั้งค่าเป็นค่าใดค่าหนึ่งต่อไปนี้
  • editorial: รีวิวโดยเว็บไซต์หรือหน่วยงานตรวจสอบอื่นๆ
  • user: รีวิวโดยผู้ใช้ปลายทาง

องค์ประกอบลูก

องค์ประกอบ <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 (รีวิวของผู้ใช้เท่านั้น) วันที่ของรีวิวซึ่งคุณระบุด้วยแอตทริบิวต์ต่อไปนี้ขององค์ประกอบนี้
  • day: วันของเดือน เช่น "7"
  • month: เดือน โดยที่ 1 = มกราคม ... 12 = ธันวาคม
  • year: ปีแบบ 4 หลัก เช่น "2023"

ตัวอย่างเช่น 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 ที่รองรับสำหรับที่พักให้เช่า

ค่าสำหรับตัวยึดตำแหน่ง attribute_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 ตัวเลือกต่อไปนี้ตามที่แสดงด้านล่าง

    1. อนุญาตให้โปรแกรมรวบรวมข้อมูล Googlebot รวบรวมข้อมูลเนื้อหาและรูปภาพในเว็บไซต์ของคุณ

      • user-agent: Googlebot
      • Allow: /
    2. อนุญาตให้โปรแกรมรวบรวมข้อมูลรูปภาพ 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 คุณจะใช้รหัสเอนทิตีหรือรหัสอักขระเพื่อแสดงอักขระพิเศษเหล่านี้ก็ได้ ตารางต่อไปนี้แสดงรายการเอนทิตีและรหัสอักขระทั่วไปที่คุณใช้ได้

    อักขระ เอนทิตี รหัสอักขระ
    เครื่องหมายและ (&) &amp; &#38;
    เครื่องหมายคำพูดเดี่ยว (') &apos; &#39;
    เครื่องหมายคำพูดคู่ (") &quot; &#34;
    เครื่องหมายมากกว่า (>) &gt; &#62;
    เครื่องหมายน้อยกว่า (<) &lt; &#60;
  • ละเว้นองค์ประกอบ 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"/>