Фид объектов

Создание и загрузка фидов объектов

Создавая и загружая фиды сущностей, убедитесь, что вы следуете этим инструкциям:

  • Следуйте спецификации, описанной в канале Entity для файлов данных Entity. Между загрузками необходимо использовать уникальные имена файлов данных Entity. В имя файла рекомендуется включать временную метку, например, Entity1_1633621547.json .
  • В дескрипторе набора файлов установите в поле name значение reservewithgoogle.entity . Пример файла дескриптора см. в образце JSON файла дескриптора . Между загрузками необходимо использовать уникальные имена файлов дескрипторов. В имя файла рекомендуется включать временную метку, например, Entity1_1633621547.filesetdesc.json . Файл дескриптора необходимо загрузить в общий ящик SFTP.
  • Фиды необходимо загружать в общий ящик SFTP ежедневно с полным обновлением.
  • Информацию об общем списке каналов SFTP можно найти в разделе «Конфигурация» > «Фиды» партнерского портала.
  • Выбор ящиков для каналов

  • Статус приема общего канала можно найти в разделе «Фиды» > «История» партнерского портала.

Определения

Определение EntityFeed

message EntityFeed {
  repeated Entity data = 1;
}

Определение сущности

//
// Information about an Entity that is on the partner's platform. For example,
// an Entity could be a retail store, a hospital, an online business etc.
message Entity {
  // An opaque string generated by the partner that identifies an Entity.
  // Must be unique across all entities.
  // Strongly recommended to only include URL-safe characters. (required)
  string entity_id = 1;

  // If present, the name, telephone, url and location are used to support
  // matching partner inventory with entities already present on Google. This
  // information will not be displayed.

  // The name of the Entity. (required)
  string name = 2;

  // The contact telephone number of the Entity including its country and area
  // codes, e.g. +14567891234. Highly recommended. (optional)
  string telephone = 3;

  // The url of the Entity's public website. Highly recommended. (optional)
  string url = 4;

  // The location of the Entity (required)
  madden.ingestion.GeoCoordinates location = 5;
}

Определение геокоординат

// The Geo data of a location, including latitude, longitude, and address.
// At least one of [lat/lng or address] should be provided (or both).
message GeoCoordinates {
  double latitude = 1;   // In degrees. (optional)
  double longitude = 2;  // In degrees. (optional)

  // Address for a location, could either be structured or unstructured.
  oneof addresses {
    // Postal address of the location, preferred.
    PostalAddress address = 3;
    // An unstructured address could also be provided as a fallback.
    // E.g. "1600 amphitheatre parkway mountain view, ca 94043"
    string unstructured_address = 4;
  }
}

Определение почтового адреса

// The postal address for a merchant.
message PostalAddress {
  // The country, using ISO 3166-1 alpha-2 country code, e.g. "US" (required)
  string country = 1;
  // The locality/city, e.g. "Mountain View". (required)
  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;
  // The postal code, e.g. "94043". (required)
  string postal_code = 4;
  // The street address, e.g. "1600 Amphitheatre Pkwy". (required)
  string street_address = 5;
}

Примеры фида объектов

Фид объектов

Имя файла:entity1_1697754089.json

{
  "data": [
    {
      "entity_id": "dining-1",
      "name": "Cucina Venti Restaurant",
      "telephone": "+1-650-254-1120",
      "url": "www.cucinaventi.com",
      "location": {
        "latitude": 37.41611,
        "longitude": -122.07751,
        "address": {
          "country": "US",
          "locality": "Mountain View",
          "region": "CA",
          "postal_code": "94043",
          "street_address": "1390 Pear Ave ste D"
        }
      }
    }
  ]
}

Файл дескриптора

Имя файла:entity1_1697754089.filesetdesc.json

{
  "generation_timestamp": 1697754089,
  "name": "reservewithgoogle.entity",
  "data_file": ["entity1_1697754089.json"]
}