ฟีดจุดที่น่าสนใจ (POI)

หน้านี้แสดงรายละเอียดข้อกำหนดทางเทคนิคสำหรับฟีดจุดที่น่าสนใจ (POI) ซึ่งรวมถึงสรุปช่องที่ต้องระบุ คำจำกัดความของสคีมาที่ครอบคลุม และตัวอย่าง JSON เพื่อเป็นแนวทางในการติดตั้งใช้งาน

ข้อกำหนดฟีด

ส่วนนี้อธิบายข้อกำหนดและคำจำกัดความสำหรับฟีด POI

ข้อกำหนดของช่อง

ชื่อช่อง ข้อกำหนด คำอธิบาย
poi_id ต้องระบุ สตริงที่พาร์ทเนอร์สร้างขึ้นเพื่อระบุจุดที่น่าสนใจ (พร็อพเพอร์ตี้)
name ต้องระบุ ชื่อของ POI ระบบจะใช้ชื่อนี้เป็นชื่อที่แสดงของพร็อพเพอร์ตี้ในหน่วยรวบรวม
telephone สิ่งที่แนะนำให้มี หมายเลขโทรศัพท์ติดต่อของ POI รวมถึงรหัสประเทศและรหัสพื้นที่ เช่น +14567891234
url สิ่งที่แนะนำให้มี URL ของเว็บไซต์สาธารณะของ POI หมายเหตุ: ระบบจะใช้ URL นี้เพื่อวัตถุประสงค์ในการจับคู่เท่านั้น ไม่ใช้เพื่อแสดง
location ต้องระบุ (ที่อยู่)
สิ่งที่แนะนำให้มี (ละติจูด/ลองจิจูด)
สถานที่ตั้งของ POI
ต้องระบุ: ที่อยู่และช่องที่เกี่ยวข้องเพื่อให้จับคู่พร็อพเพอร์ตี้ได้อย่างถูกต้อง
สิ่งที่แนะนำให้มี: ละติจูดและลองจิจูด หากระบุ Google จะใช้ละติจูด/ลองจิจูดในการแสดงหมุดของพร็อพเพอร์ตี้ในแผนที่หน่วยรวบรวม
images แนะนำอย่างยิ่ง (รูปภาพ 1 รูป)
สิ่งที่แนะนำให้มี (หลายรูป)
รูปภาพของ POI รูปภาพมีความสำคัญในการแสดงพร็อพเพอร์ตี้ เราขอแนะนำอย่างยิ่งให้เพิ่มรูปภาพอย่างน้อย 1 รูป คุณระบุรูปภาพได้หลายรูป โดยระบุได้สูงสุด 5 รูป เมื่อระบุรูปภาพหลายรูป ระบบจะใช้รูปภาพตามลำดับที่ระบุ (ในกรณีที่ใช้รูปภาพไม่ได้)

ระบบจะตรวจสอบรูปภาพเพื่อให้แน่ใจว่ารูปภาพไม่ละเมิดนโยบายการค้นหาที่ปลอดภัยของ Google
rating สิ่งที่แนะนำให้มี คะแนนเฉลี่ยของพร็อพเพอร์ตี้
num_ratings สิ่งที่แนะนำให้มี จำนวนคะแนนที่ส่งเข้ามาสำหรับช่อง rating
rating_scale สิ่งที่แนะนำให้มี สเกลการให้คะแนนที่ใช้สำหรับช่อง rating หากคะแนนสูงสุดคือ 5 แสดงว่า rating_scale คือ 5
category สิ่งที่แนะนำให้มี แสดงหมวดหมู่ของพร็อพเพอร์ตี้
hotel_data สิ่งที่แนะนำให้มี ช่องเฉพาะของโรงแรม ดูรายละเอียดได้ที่คำจำกัดความของ HotelData
hotel_star_class สิ่งที่แนะนำให้มี ค่าดาวระดับโรงแรมอย่างเป็นทางการ ค่านี้ควรเป็นจำนวนเต็มระหว่าง 1 ถึง 5
brand_ids สิ่งที่แนะนำให้มี แบรนด์ที่แสดงโรงแรมนี้ได้ หากช่องนี้ว่างเปล่า ระบบจะแสดงโรงแรมภายใต้แบรนด์ใดก็ได้ที่เชื่อมโยงกับฟีด
description สิ่งที่แนะนำให้มี คำอธิบายพร็อพเพอร์ตี้โดยละเอียด
display_address สิ่งที่แนะนำให้มี ที่อยู่ที่แสดงใน UI

หลักเกณฑ์เกี่ยวกับรูปภาพ

รูปภาพทั้งหมดที่เพิ่มลงในฟีดต้องเป็นไปตามหลักเกณฑ์ต่อไปนี้

  • รูปแบบ: ต้องเป็น JPEG, PNG หรือ WebP
  • ขนาดไฟล์สูงสุด: ไม่เกิน 30 MB ต่อรูปภาพ
  • ขนาดสูงสุด: รวมไม่เกิน 75 เมกะพิกเซล (ความกว้าง x ความสูง < 75,000,000)
  • ประเภท URL: เส้นทางโดยตรงไปยังชิ้นงานรูปภาพ (เช่น ลงท้ายด้วย .jpg)
  • สิทธิ์: ตรวจสอบว่าเซิร์ฟเวอร์โฮสต์อนุญาตให้เข้าถึง Googlebot หรือโปรแกรมรวบรวมข้อมูล และไม่มี robots.txt ที่บล็อกไดเรกทอรีรูปภาพ

การรองรับหลายภาษา

ฟีดจุดที่น่าสนใจรองรับการระบุเนื้อหาที่แปลเป็นภาษาท้องถิ่นสำหรับบางช่อง ช่องต่อไปนี้มีประเภทเป็น Text และรองรับการแปลเป็นภาษาท้องถิ่น

  • name
  • description
  • display_address

หากต้องการระบุเนื้อหาในหลายภาษา คุณต้องระบุ default_locale ในช่องและระบุสตริงที่แปลเป็นภาษาท้องถิ่นในรายการ localizations ระบุการแปลเป็นภาษาท้องถิ่นทั้งหมดสำหรับพร็อพเพอร์ตี้ในรายการ POI รายการเดียว อย่าแยกพร็อพเพอร์ตี้เดียวออกเป็นไฟล์ JSON หลายภาษา

ตัวอย่าง

"name": {
  "localizations": [
    {
      "locale": "en",
      "text": "Banana Hotel"
    },
    {
      "locale": "es",
      "text": "Hotel Plátano"
    }
  ],
  "default_locale": "en"
}

หลักเกณฑ์การสร้างแพ็กเกจไฟล์

โปรดปฏิบัติตามข้อกำหนดการสร้างแพ็กเกจต่อไปนี้เพื่อให้ระบบนำเข้าข้อมูลได้สำเร็จ

  • ไฟล์เก็บถาวร JSON แบบรวมไฟล์เดียว (ต้องระบุ): รวมบันทึกพร็อพเพอร์ตี้ทั้งหมด ไว้ในไฟล์ JSON ไฟล์เดียว เราขอแนะนำให้บีบอัดเป็นไฟล์เก็บถาวร GZIP ไฟล์เดียว แล้วอัปโหลด
  • คำเตือนเกี่ยวกับรูปแบบที่ไม่แนะนำ: อย่าใช้ไฟล์ 1 ไฟล์ต่อพร็อพเพอร์ตี้ หรือ ใช้หลายไฟล์ที่แยกตามประเทศในไฟล์เก็บถาวรเดียวกัน ระบบไม่รองรับแนวทางนี้และจะทำให้การแยกไฟล์ล้มเหลว

คำจำกัดความ

คำจำกัดความของ VssPoiFeed

// Represents a Point of Interest (POI) data feed provided by a partner.
export message VssPoiFeed {
  // The POIs in the feed.
  repeated VssPoi data = 1;
}

คำจำกัดความของ VssPoi

// Represents a single Point of Interest (POI) entity e.g. a hotel or
// restaurant.
export message VssPoi {
  // Required. A string generated by the partner that identifies a POI.
  string poi_id = 1;

  // The entity name, telephone, url and location are used to support
  // matching partner inventory with entities already present on Google.

  // Required. The name of the POI.
  Text name = 2;

  // The contact telephone number of the POI including its country and
  // area codes, e.g. +14567891234.
  string telephone = 3 [(datapol.semantic_type) = ST_PHONE_NUMBER];

  // The url of the POI's public website.
  // Note: This will be used just for matching purposes, not for display.
  string url = 4;

  // Required. The location of the POI.
  GeoCoordinates location = 5;

  // The address displayed on the UI.
  Text display_address = 17;

  // Images of the POI.
  // Max number of images: 5.
  repeated Image images = 6;

  // Average rating for the POI.
  float rating = 12;

  // The number of contributing ratings for the `rating` field.
  int64 num_ratings = 13;

  // The rating scale used for the `rating` field. If max rating is 5, then
  // rating_scale is 5.
  int32 rating_scale = 14;

  // Represents the category of the POI.
  // It should match the `additional_data` oneof field below.
  export enum Category {

    UNKNOWN_CATEGORY = 0;
    HOTEL = 1;

    LOCAL = 4;
  }

  // Required. Represents the category of the POI.
  Category category = 9;

  // A description of the POI.
  Text description = 16;

  // Required. Category specific fields.
  // It should match the `category` field above.
  oneof additional_data {
    // Hotel specific fields.
    HotelData hotel_data = 10;


    // Local specific fields.
    LocalData local_data = 15;
  }

}

คำจำกัดความของข้อความ

// Represents a text with localizations.
message Text {
  // Represents a localized string.
  message LocalizedString {
    // The text's language tag, such as "en", "en-US" or "sr-Latn".
    string locale = 1;

    // The text in the specified locale.
    string text = 2;
  }

  // The localized strings.
  repeated LocalizedString localizations = 1;

  // The locale to use as the default language it must be present in the
  // localizations.
  string default_locale = 2;
}

คำจำกัดความของ GeoCoordinates

// The Geo data of a location, including latitude, longitude, and address.
message GeoCoordinates {
  option (datapol.msg_semantic_type) = ST_LOCATION;

  // [-90, +90] degrees (inclusive).
  // Required if longitude is set, otherwise nice to have.
  double latitude = 1;

  // [-180, +180] degrees (inclusive).
  // Required if latitude is set, otherwise nice to have.
  double longitude = 2;

  // Required. Address for a location.
  oneof addresses {
    // Postal address of the location.
    PostalAddress address = 3;

  }
}

คำจำกัดความของ PostalAddress

// The postal address for the location.
message PostalAddress {
  option (datapol.msg_semantic_type) = ST_LOCATION;

  // Required. The country, using ISO 3166-1 alpha-2 country code, e.g. "US".
  string country = 1;

  // Required. The locality/city, e.g. "Mountain View".
  string locality = 2;

  // The region/state/province, e.g. "CA". This field is only required in
  // countries where region is commonly a part of the address. (optional)
  string region = 3;

  // Required. The postal code, e.g. "94043".
  string postal_code = 4;

  // Required. The street address, e.g. "1600 Amphitheatre Pkwy".
  string street_address = 5;
}

คำจำกัดความของรูปภาพ

// Represents an image of the Point of Interest (POI).
export message Image {
  // The url of the image. Google will crawl the media hosted at this URL.
  // Max length: 2000.
  string url = 1;

  // The alternative text to be used for accessibility.
  Text alt_text = 2;
}

คำจำกัดความของ HotelData

// Hotel specific feed data.
message HotelData {
  // The official hotel class star value.
  // Can be used in a label like "5-star hotel."
  // This value is expected to be an integer between 1 and 5.
  int32 hotel_star_class = 1;

  // The brands that can display this hotel.
  // If this field is empty, the hotel can be displayed under any of the
  // brands associated with the feed.
  repeated string brand_ids = 2 [(datapol.semantic_type) = ST_PARTNER_ID];
}

ตัวอย่าง

ฟีดจุดที่น่าสนใจ

ชื่อไฟล์: poi_1707240000.json

{
  "data": [
    {
      "poi_id": "hotel_banana",
      "name": {
        "localizations": [
          {
            "locale": "en",
            "text": "Banana Hotel"
          }
        ],
        "default_locale": "en"
      },
      "telephone": "+16195550100",
      "url": "https://www.example-banana-hotel.com",
      "location": {
        "latitude": 32.7157,
        "longitude": -117.1611,
        "address": {
          "country": "US",
          "locality": "San Diego",
          "region": "CA",
          "postal_code": "92101",
          "street_address": "2845 W 7th St"
        }
      },
      "images": [
        {
          "url": "https://www.example.com/banana_hotel.jpg",
          "alt_text": {
             "localizations": [
               { "locale": "en", "text": "Banana Hotel Exterior" }
             ]
          }
        }
      ],
      "rating": 4.5,
      "category": "HOTEL",
      "hotel_data": {
        "hotel_star_class": 4,
        "brand_ids": ["brand_a", "brand_b"]
      }
    },
    {
      "poi_id": "hotel_kiwi",
      "name": {
        "localizations": [
          {
            "locale": "en",
            "text": "Kiwi Hotel"
          }
        ],
        "default_locale": "en"
      },
      "telephone": "+41445550100",
      "url": "https://www.example-kiwi-hotel.com",
      "location": {
        "latitude": 47.3769,
        "longitude": 8.5417,
        "address": {
          "country": "CH",
          "locality": "Zurich",
          "postal_code": "8001",
          "street_address": "Bahnhofstrasse 10"
        }
      },
      "images": [
        {
          "url": "https://www.example.com/kiwi_hotel.jpg",
          "alt_text": {
             "localizations": [
               { "locale": "en", "text": "Kiwi Hotel Lobby" }
             ]
          }
        }
      ],
      "rating": 4.0,
      "category": "HOTEL",
      "hotel_data": {
        "hotel_star_class": 3,
        "brand_ids": ["brand_c"]
      }
    },
    {
      "poi_id": "hotel_croissant",
      "name": {
        "localizations": [
          {
            "locale": "en",
            "text": "Croissant Hotel"
          }
        ],
        "default_locale": "en"
      },
      "telephone": "+41445550200",
      "url": "https://www.example-croissant-hotel.com",
      "location": {
        "latitude": 47.3686,
        "longitude": 8.5392,
        "address": {
          "country": "CH",
          "locality": "Zurich",
          "postal_code": "8002",
          "street_address": "Paradeplatz 1"
        }
      },
      "images": [
        {
          "url": "https://www.example.com/croissant_hotel.jpg",
          "alt_text": {
             "localizations": [
               { "locale": "en", "text": "Croissant Hotel View" }
             ]
          }
        }
      ],
      "rating": 5.0,
      "category": "HOTEL",
      "hotel_data": {
        "hotel_star_class": 5
      }
    },
    {
      "poi_id": "hotel_tiburon",
      "name": {
        "localizations": [
          {
            "locale": "en",
            "text": "Hotel Tiburon"
          }
        ],
        "default_locale": "en"
      },
      "telephone": "+15105550100",
      "url": "https://www.example-tiburon-hotel.com",
      "location": {
        "latitude": 37.7652,
        "longitude": -122.2416,
        "address": {
          "country": "US",
          "locality": "Alameda",
          "region": "CA",
          "postal_code": "94501",
          "street_address": "1100 Atlantic Ave"
        }
      },
      "images": [
        {
          "url": "https://www.example.com/tiburon_hotel.jpg",
          "alt_text": {
             "localizations": [
               { "locale": "en", "text": "Hotel Tiburon Pool" }
             ]
          }
        }
      ],
      "rating": 4.2,
      "category": "HOTEL",
      "hotel_data": {
        "hotel_star_class": 5,
        "brand_ids": ["brand_a"]
      }
    }
  ]
}

ฟีด POI หลายภาษา

ชื่อไฟล์: poi_multilingual.json

{
  "data": [
    {
      "poi_id": "hotel_banana_multilingual",
      "name": {
        "localizations": [
          {
            "locale": "en",
            "text": "Banana Hotel"
          },
          {
            "locale": "es",
            "text": "Hotel Plátano"
          },
          {
            "locale": "fr",
            "text": "Hôtel Banane"
          }
        ],
        "default_locale": "en"
      },
      "description": {
        "localizations": [
          {
            "locale": "en",
            "text": "A beautiful hotel shaped like a banana."
          },
          {
            "locale": "es",
            "text": "Un hermoso hotel con forma de plátano."
          },
          {
            "locale": "fr",
            "text": "Un bel hôtel en forme de banane."
          }
        ],
        "default_locale": "en"
      },
      "display_address": {
        "localizations": [
          {
            "locale": "en",
            "text": "123 Banana Way, Fruit City, CA 90000"
          },
          {
            "locale": "es",
            "text": "123 Vía Plátano, Ciudad Fruta, CA 90000"
          }
        ],
        "default_locale": "en"
      },
      "telephone": "+16195550100",
      "url": "https://www.example-banana-hotel.com",
      "location": {
        "latitude": 32.7157,
        "longitude": -117.1611,
        "address": {
          "country": "US",
          "locality": "Fruit City",
          "region": "CA",
          "postal_code": "90000",
          "street_address": "123 Banana Way"
        }
      },
      "images": [
        {
          "url": "https://www.example.com/banana_hotel.jpg",
          "alt_text": {
             "localizations": [
               { "locale": "en", "text": "Banana Hotel Exterior" },
               { "locale": "es", "text": "Exterior del Hotel Plátano" }
             ]
          }
        }
      ],
      "rating": 4.5,
      "category": "HOTEL",
      "hotel_data": {
        "hotel_star_class": 4,
        "brand_ids": ["brand_mango", "brand_apricot"]
      }
    }
  ]
}