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

ข้อมูลโรงแรมคือไฟล์ XML อย่างน้อย 1 ไฟล์ที่แสดงโรงแรมทั้งหมดที่คุณจะ ให้ข้อมูลราคา ตัวไฟล์ข้อมูลโรงแรมไม่มีการตั้งราคา

องค์ประกอบรูทของข้อมูลโรงแรมคือองค์ประกอบ <listings> ที่มี องค์ประกอบ <listing> ที่อธิบายที่พัก

คุณสร้างข้อมูลโรงแรมซึ่งเป็นส่วนหนึ่งของการใช้งานเริ่มต้น แล้วเพิ่มหรือนำโรงแรมออกโดยเป็นส่วนหนึ่งของการบำรุงรักษาตามปกติ

ตรวจสอบว่าไฟล์เป็นไปตามหลักเกณฑ์ไวยากรณ์ เช่น ใช้การเข้ารหัสแบบ UTF-8 และระบุสคีมาการเข้ารหัสนี้โดยใส่ แอตทริบิวต์ encoding ในแท็ก XML

หลังจากสร้างข้อมูลโรงแรมแล้ว คุณสามารถอัปโหลดข้อมูลไปยัง Google ด้วยตนเองโดยใช้โรงแรม ตรงกลางหรือโฮสต์ไว้ใน เซิร์ฟเวอร์

ค้นหาและแก้ไขปัญหาเกี่ยวกับข้อมูล

หากต้องการค้นหาและแก้ไขปัญหาของข้อมูลในข้อมูลโรงแรม โปรดอ่านบทความต่อไปนี้

ข้อกำหนดของข้อมูล

ที่พักในข้อมูลโรงแรมต้องมีลักษณะดังนี้จึงจะมีสิทธิ์ใช้ 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 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

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

องค์ประกอบนี้ใช้แอตทริบิวต์ 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 Unit 3, Boston, MA, 02472</address>

โปรดทราบว่า กล่องหรือที่อยู่ไปรษณีย์อื่นๆ เท่านั้นไม่ใช่ ที่อยู่จริงที่ถือเป็นที่อยู่จริง

<country> Required string ประเทศที่ข้อมูลนี้ตั้งอยู่ ค่าต้องเป็น รหัสประเทศแบบ 2 ตัวอักษร เช่น สหรัฐอเมริกาคือ "US" และแคนาดาคือ "CA" เช่น
<country>US</country>
<latitude> Required* float ละติจูดที่ตรงกับสถานที่ตั้งของโรงแรม สำหรับ ตัวอย่าง:
<latitude>37.423738</latitude>

คุณสามารถสร้างค่านี้ได้ด้วยเครื่องมือการเข้ารหัสพิกัดภูมิศาสตร์ เช่น Google แผนที่ API

<longitude> Required* float ลองจิจูดที่ตรงกับสถานที่ตั้งของโรงแรม สำหรับ ตัวอย่าง:
<longitude>-122.090101</longitude>

คุณสามารถสร้างค่านี้ได้ด้วยเครื่องมือการเข้ารหัสพิกัดภูมิศาสตร์ เช่น Google แผนที่ API

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

ค่าสำหรับตัวยึดตำแหน่งค่าแอตทริบิวต์_name

ตารางต่อไปนี้แสดงค่าที่ถูกต้องสำหรับ attribute_name ใน <client_attr name="attribute_name">

ค่าสำหรับ attribute_name คำอธิบาย ค่าเนื้อหาที่ถูกต้อง
alternate_hotel_id ตัวระบุทางเลือกสําหรับที่พัก การมีรหัสแยกกันก็มีประโยชน์ คุณอาจต้องการตัวระบุพร็อพเพอร์ตี้ 1 รายการสำหรับข้อมูลฟีดและ ตัวระบุที่พักอีกตัวหนึ่งสำหรับเครื่องมือการจองของคุณ ค่าสตริงใดก็ได้
custom_[0-4] แอตทริบิวต์ที่กำหนดเองประเภทสตริง ซึ่งจะไม่แสดงให้ผู้ใช้เห็น ค่าสตริงใดก็ได้
hotel_brand แบรนด์ของโรงแรม เช่น "Marriott" หรือ "Hilton" ชื่อนี้จะไม่แสดงต่อผู้ใช้ แต่สามารถใช้ในการจัดกลุ่มได้ โรงแรม ค่าสตริงใดก็ได้
lodging การนำเสนอฟิลด์ทั้งหมดที่เข้ารหัสได้ใน Lodging Proto สตริงที่เข้ารหัสฐาน 64 ของ เข้ารหัสแล้ว Lodging Proto
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 ที่ระดับราก ให้ตรวจสอบว่า หนึ่งใน 2 ตัวเลือกที่แสดงอยู่ด้านล่างนี้

    1. อนุญาตให้ Crawler ของ 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 ไม่ว่าในกรณีใดๆ (แม้ว่าจะ Escape)

  • คุณใช้ XSD ของฟีดในเครื่องได้เพื่อตรวจสอบฟีดก่อนที่จะอัปโหลด http://www.gstatic.com/localfeed/local_feed.xsd.

  • หากต้องการใช้ความคิดเห็นในฟีด ให้รวมความคิดเห็นไว้ในแท็ก <!-- และ --> ดังตัวอย่างต่อไปนี้

    <!-- This is a comment -->
    
  • โปรดตรวจสอบว่าคุณปิดองค์ประกอบ <date> ในบัญชีผู้ใช้แล้ว <review> เช่น

    <date day="2" month="12" year="2017"/>