指定操作链接(旧版)

操作链接让用户能够与深层链接互动,该链接会链接到合作伙伴的网站以执行操作。深层链接会显示在商家的知识面板中。本指南将介绍如何向 Feed 添加操作链接。

操作链接可在以下两个位置提供:

  • 商家 Feed - 当一个商家有多项服务在执行类似操作时,通过商家 Feed 实现操作链接。
  • 服务 Feed - 当单个商家有多项服务执行不同操作时,通过服务 Feed 实现操作链接。

当指定商家的所有服务将用户重定向到合作伙伴网站上的同一着陆页时,您应通过商家 Feed 提供操作链接。

对于餐饮而言,这通常是唯一有意义的实现,因为每个商家只有一项服务。

示例如下:

  • 商家提供瑜伽课程、拳击课程、骑行课程、理发、染发、洗发水等多种服务。 该操作链接会重定向到显示商家的整个服务目录的着陆页。

必须使用 ActionLinkType(商家 Feed 中 ActionLink 的一部分)指定操作类型。

  // Predetermined type of action associated with an action link.
  enum ActionLinkType {
    // The action link type is unspecified.
    ACTION_LINK_TYPE_UNSPECIFIED = 0;
    // The action link type is booking an appointment.
    ACTION_LINK_TYPE_BOOK_APPOINTMENT = 1;
    // The action link type is booking an online appointment.
    ACTION_LINK_TYPE_BOOK_ONLINE_APPOINTMENT = 2;
    // The action link type is ordering food for delivery or takeout or both.
    ACTION_LINK_TYPE_ORDER_FOOD = 3;
    // The action link type is ordering food for delivery.
    ACTION_LINK_TYPE_ORDER_FOOD_DELIVERY = 4;
    // The action link type is ordering food for takeout.
    ACTION_LINK_TYPE_ORDER_FOOD_TAKEOUT = 5;
    // The action link type is making a dining reservation.
    ACTION_LINK_TYPE_MAKE_DINING_RESERVATION = 6;
    // The action link type allows users to shop from the given merchant. It
    // could either be delivery or pickup.
    ACTION_LINK_TYPE_SHOP_ONLINE = 7;
  }

如果商家为每项服务使用不同的深层链接,或者商家有多项服务可执行不同的操作(例如订餐和预订),您应该通过服务 Feed 提供操作链接。

示例如下:

  • 餐厅提供订餐和订餐服务。一个操作链接将用户重定向到订餐页面,另一个操作链接将用户重定向到订餐页面

可以使用服务中的 ServiceType 和商家 Feed 中 ActionLinkActionLinkType 来指定操作类型。

  enum ServiceType {
    SERVICE_TYPE_UNSPECIFIED = 0;
    // Service that provides dining reservation.
    SERVICE_TYPE_DINING_RESERVATION = 1;
    // Service that provides food ordering in general, could be either takeout
    // or delivery or both.
    SERVICE_TYPE_FOOD_ORDERING = 2;
    // Service that only provides food delivery.
    SERVICE_TYPE_FOOD_DELIVERY = 6;
    // Service that only provides food takeout.
    SERVICE_TYPE_FOOD_TAKEOUT = 7;

    // Services that provide event based ticketing (e.g. concerts, sporting
    // events, shows). Do not use for Reserve with Google integrations.
    SERVICE_TYPE_EVENT_TICKET = 3;
    SERVICE_TYPE_TRIP_TOUR = 4;

    // Service that provides appointments or classes. Recommended for (1) health
    // and fitness, (2) spa and beauty, and (3) financial consults and
    // evaluations services. Please see the supported service types:
    // https://developers.google.com/maps-booking/guides/end-to-end-integration/overview
    SERVICE_TYPE_APPOINTMENT = 5;
    // Service that provides appointment for an online class or session which
    // will be fully virtual. Must be set if enabling virtual service bookings.
    SERVICE_TYPE_ONLINE_APPOINTMENT = 8;

    // Service that allows users to shop from the given merchant. It could
    // either be delivery or pickup.
    SERVICE_TYPE_SHOPPING = 9;
  }

使用 OrderOnlineMetadata

OrderOnlineMetadata 用于指定要向用户显示的有关各种费用、最低订单金额和不同在线购物履单方式的库存状况的信息。如果添加,此元数据将包含在商家 Feed 中的操作链接中。

如需详细了解如何在 Feed 中正确添加此信息(如果您的集成需要这些信息),请参阅以下文档: