アクション フィード

アクション フィードを作成してアップロードする

アクション フィードを作成してアップロードする際は、次の手順に沿って操作します。

  • アクション データファイルについては、アクション フィードに記載されている仕様に沿って作成してください。アップロードごとに一意のアクション データ ファイル名を使用することをおすすめします。 ファイル名にタイムスタンプを含めます(例: action_1633621547.json)。
  • ファイルセット記述子で、name フィールドを reservewithgoogle.action.v2 に設定します。記述子ファイルの例については、JSON のサンプルをご覧ください。アップロードごとに一意の記述子ファイル名を使用することをおすすめします。 ファイル名にタイムスタンプを含めます(例: action_1633621547.filesetdesc.json)。記述子ファイルは、汎用 SFTP サーバーにアップロードする必要があります。
  • フィードを汎用 SFTP サーバーに毎日アップロードして、完全に更新します。
  • SFTP サーバーの詳細は、Partner Portal の [Configuration] > [Feeds] セクションで確認できます。
  • フィード サーバーの選択

    Partner Portal でのフィード サーバーの選択
  • フィードの取り込みステータスは、Partner Portal の [取り込み] > [履歴] セクションで確認できます。

定義

ActionFeed の定義

message ActionFeed {
  option features.(pb.java).nest_in_file_class = YES;

  repeated ActionDetail data = 1;
}

ActionDetail の定義

message ActionDetail {
  option features.(pb.java).nest_in_file_class = YES;

  string entity_id = 2;
  string link_id = 3;

  // Deep link for action detail
  string url = 4;

  // The actions that can be performed using this deep link. At least one
  // Action must be specified.
  repeated Action actions = 1;
}

アクションの定義

// Information about an Action which could be performed.
message Action {
  option features.(pb.java).nest_in_file_class = YES;

  // Deprecated fields not to be reused.
  reserved 1;

  oneof action_info {
    FoodOrderingInfo food_ordering_info = 3;

  }
}

FoodOrderingInfo の定義

message FoodOrderingInfo {
  option features.(pb.java).nest_in_file_class = YES;

  // Service type for food ordering action.
  enum ServiceType {
    UNKNOWN = 0;
    DELIVERY = 1;
    TAKEOUT = 2;
  }

      ;
}

アクション フィードのサンプル

宅配のみ

ファイル名 : actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [{ "food_ordering_info": { "service_type": "DELIVERY" } }],
      "entity_id": "dining-1",
      "link_id": "delivery-dining-1",
      "url": "https://www.restaurant.com/delivery/dining-1"
    }
  ]
}

テイクアウトのみ

ファイル名 : actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [{ "food_ordering_info": { "service_type": "TAKEOUT" } }],
      "entity_id": "dining-1",
      "link_id": "takeout-link-dining-1",
      "url": "https://www.restaurant.com/takeout/dining-1"
    }
  ]
}

デリバリーとテイクアウト

ファイル名 : actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [
        { "food_ordering_info": { "service_type": "DELIVERY" } },
        { "food_ordering_info": { "service_type": "TAKEOUT" } }
      ],
      "entity_id": "dining-1",
      "link_id": "common-link-dining-1",
      "url": "https://www.restaurant.com/commonlink/dining-1"
    }
  ]
}

デリバリーとテイクアウトで異なる URL

ファイル名 : actions_1697754089_0001.json

{
  "data": [
    {
      "actions": [
        {
          "food_ordering_info": {
            "service_type": "TAKEOUT"
          }
        }
      ],
      "entity_id": "dining-1",
      "link_id": "takeout-dining-1",
      "url": "https://www.restaurant.com/takeout/dining-1"
    },
    {
      "actions": [
        {
          "food_ordering_info": {
            "service_type": "DELIVERY"
          }
        }
      ],
      "entity_id": "dining-1",
      "link_id": "delivery-dining-1",
      "url": "https://www.restaurant.com/delivery/dining-1"
    }
  ]
}

記述子ファイル

ファイル名 : actions_1697754089.filesetdesc.json

{
  "generation_timestamp": 1697754089,
  "name": "reservewithgoogle.action.v2",
  "data_file": [
    "actions_1697754089_0001.json",
    "actions_1697754089_0002.json"
  ]
}