Transaction API 将于 2023 年 5 月 3 日弃用,在此之前,会话操作将于 2023 年 6 月 13 日停用。如需了解详情,请参阅
对话型 Action 停用。
设计事务性对话 (Dialogflow)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
设计对话以引导用户完成事务流程。我们提供了参考示例,您可以在设计自己的事务性 Action 时参考这些示例。
示例
设计提示
确保对话听起来自然且如真人对话,就像真人说话一样。
您的 TTS/语音所说的文字不一定要与聊天气泡中显示的文字完全一致。如果聊天气泡是语音对话框的一部分,此功能会非常有用。
问候访问者,吸引他们参与互动。询问他们有什么需求,然后提供一些建议内容信息卡,帮助他们上手。
在邀请用户将商品添加到购物车之前,请使用 actions.intent.TRANSACTION_REQUIREMENTS_CHECK
进行后端检查,以确认用户已经为其 Google 助理设置了付款方式。
请做好准备,以应对与其他移动或 Web 体验一样的语音问题。例如,在商品缺货时提供类似商品,或邀请用户注册以在商品补货时收到通知。
请注意,订单摘要是根据您通过 API 传递的数据构建的。“通过 Google 付款”标签有助于用户了解付款是由 Google 协助完成的。
向用户索要地址信息(例如地址信息),请先说明您提出要求的原因,以及这类要求可让他们受益。
Google 会根据用户的设置显示购买授权方法(无需进行身份验证、密码或指纹)。有时,我们的风险评估还会启动额外的身份验证步骤,例如确认银行卡的 CVV。
付款完成后,请务必发送收据和订单确认函。请务必让用户了解您是收单商家,并会提供有关订单(而非 Google)的所有详细信息。
默认情况下,您可以在带有屏幕的 surface(例如 Android 手机)或仅支持语音的 surface(例如 Google Home)上执行交易。
为了最好地支持纯语音交易,请格外小心,设计出良好的对话体验,引导用户完成完整的交易体验。
请注意,某些交易 intent 可能需要一个屏幕。其中大部分信息(如添加新的配送地址、解决付款问题、帐号关联)会自动发送到手机上。如果对话中新增了最适合显示在屏幕上的内容(例如,为构建卡片而显示丰富的响应、显示商家服务条款或隐私权政策),您应检查当前 surface 是否支持 SCREEN_OUTPUT
或 WEB_BROWSER
功能,如果不支持,请转移到新 surface。
如果您不希望通过 Action 支持纯语音交易,则可以将 Actions 项目设置为需要屏幕,方法是在 Actions 控制台中依次转到 Deploy > Surface capability,并将 Do your Actions required a screen output 设为 Yes。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eDesign conversational flows for transactional Actions, guiding users through the process similar to a real-world conversation.\u003c/p\u003e\n"],["\u003cp\u003eRefer to provided examples like Shoe store, Ticketing, and Flower Shop to understand transactional Action design.\u003c/p\u003e\n"],["\u003cp\u003eFollow design tips to ensure natural dialog, clear communication, and a smooth user experience, including pre-purchase checks and handling potential issues.\u003c/p\u003e\n"],["\u003cp\u003eTransactions can occur on screen and voice-only surfaces; optimize for both by crafting a comprehensive conversational experience and leveraging surface capabilities effectively.\u003c/p\u003e\n"],["\u003cp\u003eRemember to inform users about data requests, purchase authorization, and merchant responsibility for post-purchase communication.\u003c/p\u003e\n"]]],[],null,["# Designing Transactional Conversations (Dialogflow)\n\nDesign a conversation to guide users through your transactional\nflows. We've provided reference examples that you can use as a guide\nwhen designing your own transactional Actions.\n\nExamples\n--------\n\n[](https://docs.google.com/presentation/d/1Zw-Cg4ODJWpEViJJT_LugxvFv1VeOB7Hw54wNQemrfg) [Shoe store Example](https://docs.google.com/presentation/d/1Zw-Cg4ODJWpEViJJT_LugxvFv1VeOB7Hw54wNQemrfg) \n[](https://docs.google.com/presentation/d/1RBVzklC8n7nPU98lRt1CkzDSFcBlaQf5PWVtlr58OQQ) [Ticketing example](https://docs.google.com/presentation/d/1RBVzklC8n7nPU98lRt1CkzDSFcBlaQf5PWVtlr58OQQ) \n[](https://docs.google.com/presentation/d/1icd64B_mJvba6lmhlfmUy35sejy5n-LsYYkvPXzUXgA) [Flower Shop Example](https://docs.google.com/presentation/d/1icd64B_mJvba6lmhlfmUy35sejy5n-LsYYkvPXzUXgA)\n\nDesign Tips\n-----------\n\n- Make sure the dialogs [sound natural and conversational](/assistant/actions/design) --- the way a real person would talk.\n\n- The text spoken by your TTS/voice does not have to exactly match the text shown in your chat bubbles. It works well if the chat bubbles are a subset of the spoken dialog.\n\n- Greet your visitors and get them engaged. Ask what they need and offer a few suggestion chips to get them started.\n\n- Before inviting the user to add items to the cart, do a backend check using `actions.intent.TRANSACTION_REQUIREMENTS_CHECK` to confirm the user has payments set up for their Google Assistant.\n\n- Be prepared to respond to the same issues with voice as with other mobile or web experiences. For example, offer a similar item when you're out of a certain size or color, or invite users to sign up to be notified when the item is back in stock.\n\n- Note that the order summary is built with the data you pass via the API. The \"Pay with Google\" label helps users understand that Google facilitated the payment.\n\n- When requesting info from your users, like their address info, first let them know why you are making the request and how it will benefit them.\n\n- Google will present the purchase authorization method (either no auth required, password, or fingerprint) based on the user's settings. Sometimes our risk assessment will kick off an additional auth step like confirming CVV for a card.\n\n- After the payment is complete, be sure to send a receipt and an order confirmation. It's important that users understand that you are the merchant of record, and will follow up with all details about the order, not Google.\n\n- By default transactions can be performed on either a surface with a screen (such as an Android phone) or a voice-only surface (such as a Google Home).\n\n - To best support voice-only transactions, take extra care to design a [good conversational experience](/assistant/actions/design) that walks users through the full transaction experience.\n\n - Note that some transactions intents may require a screen. Most of these (e.g. adding a new delivery address, fixing payment issues, account linking) will be handed off to the phone automatically. If there are any additions to the conversation that are best displayed on a screen (e.g. presenting rich responses for card building, displaying a merchant ToS or privacy policy), you should check if the current surface supports the `SCREEN_OUTPUT` or `WEB_BROWSER` capabilities, and [transfer to a new surface](/assistant/df-asdk/surface-capabilities#multi-surface_conversations) if not.\n\n - If you would rather not support voice-only transactions with your Action, you can set your Actions project to require a screen by navigating to **Deploy \\\u003e Surface capabilities** in the [Actions Console](https://console.actions.google.com) and setting **Do your Actions require a screen output** to **Yes**."]]