Tạo và tải nguồn cấp dữ liệu hành động lên
Khi tạo và tải nguồn cấp dữ liệu hành động lên, hãy làm theo các hướng dẫn sau:
- Tuân thủ quy cách được mô tả trong nguồn cấp dữ liệu hành động cho các tệp dữ liệu hành động. Bạn nên sử dụng tên tệp dữ liệu hành động riêng biệt cho mỗi lần tải lên.
Thêm dấu thời gian vào tên tệp, ví dụ:
action_1633621547.json. - Trong bộ mô tả nhóm tệp, hãy đặt trường
namethànhreservewithgoogle.action.v2. Để xem ví dụ về tệp mô tả, hãy tham khảo mẫu JSON. Bạn nên sử dụng tên tệp mô tả riêng biệt cho mỗi lần tải lên. Thêm dấu thời gian vào tên tệp, ví dụ:action_1633621547.filesetdesc.json. Bạn phải tải tệp mô tả lên máy chủ SFTP chung. - Tải nguồn cấp dữ liệu lên máy chủ SFTP chung hằng ngày dưới dạng bản làm mới đầy đủ.
- Bạn có thể xem thông tin chi tiết về máy chủ SFTP trong phần Cấu hình > Nguồn cấp dữ liệu của Cổng đối tác.
- Xem trạng thái nhập nguồn cấp dữ liệu trong phần Nguồn cấp dữ liệu > Nhật ký của Cổng đối tác.
Định nghĩa
Định nghĩa ActionFeed
message ActionFeed { repeated ActionDetail data = 1; }
Định nghĩa ActionDetail
message ActionDetail { string entity_id = 2; string link_id = 3; // Deep link for action detail string url = 4; repeated Action actions = 1; }
Định nghĩa hành động
// Information about an Action which could be performed. message Action { // Deprecated fields not to be reused. reserved 1; oneof action_info { FoodOrderingInfo food_ordering_info = 3; } }
Định nghĩa FoodOrderingInfo
message FoodOrderingInfo { // Service type for food ordering action. enum ServiceType { UNKNOWN = 0; DELIVERY = 1; TAKEOUT = 2; } ServiceType service_type = 1 ; }
Ví dụ về Nguồn cấp dữ liệu hành động
Chỉ có dịch vụ giao hàng tận nơi
Tên tệp : 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" } ] }
Chỉ phục vụ mua mang đi
Tên tệp : 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" } ] }
Giao hàng và mua mang đi
Tên tệp : 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 khác cho dịch vụ giao hàng và mang đi
Tên tệp : 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" } ] }
Tệp mô tả
Tên tệp : actions_1697754089.filesetdesc.json
{ "generation_timestamp": 1697754089, "name": "reservewithgoogle.action.v2", "data_file": [ "actions_1697754089_0001.json", "actions_1697754089_0002.json" ] }