本页介绍了第三方应用开发者如何使用问题解决服务为其业务创建应用内诊断页面。
您可以使用 Accounts API 查看影响您的商家账号以及您有权访问的任何账号的问题。
您有责任遵守购物广告和非付费商品详情政策。Google 购物保留强制执行这些政策的权利,如果我们发现有内容或行为违反这些政策,会采取适当的措施。
您可以使用此服务创建类似于 Merchant Center 账号诊断和商品问题页面的界面。
问题解决服务仅适用于第三方界面。当商家与应用的界面互动时,应触发请求。如需自动诊断您自己的商家账号,请参阅账号问题指南。
我们建议您在应用中提供以下页面,以帮助您的商家排查问题:
- 账号诊断
- 产品诊断
实现诊断页面的不同选项
您可以通过不同方式实现诊断页面。根据您的需求,选择用于确定如何处理复杂诊断操作的选项。 您可以在请求中将 user_input_action_option 设置为以下选项之一:
REDIRECT_TO_MERCHANT_CENTER
:这是默认选项。需要显示其他内容或从商家处接收其他输入的行动未在您的应用中完全实现。对于这些行动,API 会提供一个链接,用于重定向到 Merchant Center 中商家可以执行相应行动的页面。BUILT_IN_USER_INPUT_ACTIONS
:您可以在应用中实现需要用户输入的复杂操作,作为应用内解决方案。
实现诊断页面
本部分介绍了如何实现诊断页面。它使用默认(简单)选项将复杂操作作为重定向到 Merchant Center 的操作来处理。
如需了解有关应用内操作的更高级实现,请查看以下部分,并参阅实现内置操作并提供用户输入。
实现
我们建议诊断页面的流程应如下所示:
- 商家在您的应用中打开诊断页面。
- 您的应用通过调用
issueresolution
服务来请求诊断信息。
以下是示例请求:
POST https://merchantapi.googleapis.com/issueresolution/v1/accounts/{ACCOUNT_ID}:renderaccountissues?timeZone=America/Los_Angeles&languageCode=en-GB { }
将 {ACCOUNT_ID} 替换为要触发相应操作处理的账号的唯一标识符。
您的应用会向商家显示响应中的诊断信息和建议的操作。以下是示例响应:
{ "renderedIssues": [ { "title": "Misrepresentation", "impact": { "message": "Prevents all products from showing in all countries", "severity": "ERROR", "breakdowns": [ { "regions": [ { "code": "001", "name": "All countries" } ], "details": [ "Products not showing organically" ] } ] }, "prerenderedContent": "\u003cdiv class=\"issue-detail\"\u003e\u003cdiv class=\"issue-content\"\u003e\u003cp class=\"content-element\"\u003e\u003cspan class=\"segment\"\u003eBased on the information available about your business, there is reason to believe that customers are being misled on Google. Review the Misrepresentation policy and make changes to your Merchant Center and/or online store.u003c/span\u003e\u003c/p\u003e\u003cp class=\"content-element root-causes-intro\"\u003e\u003cspan class=\"segment\"\u003eMake sure your Merchant Center and online store follow the following best practices / guidelines\u003c/span\u003e\u003c/p\u003e\u003cul class=\"content-element root-causes\"\u003e\u003cli\u003e\u003cp\u003e\u003cspan class=\"segment\"\u003eProvide transparency about your business identity, business model, policies and how your customers can interact with you\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cspan class=\"segment\"\u003ePromote your online reputation by showing reviews or highlighting any badges or seals of approval\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eUse a professional design for your online store that includes an SSL certificate\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eMake sure it's accessible for all users without any redirects and doesn't have any placeholders for text and images.u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eProvide information in the business information settings in your Merchant Center\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eLink any relevant third-party platforms to your Merchant Center and create a Google Business Profile.u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cspan class=\"segment\"\u003eFollow SEO guidelines, improve your eligibility for seller ratings and match your product data in your Merchant Center with your online store\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003ca href=\"https://support.google.com/merchants/answer/6150127?hl=en-US\" class=\"content-element\"\u003eLearn more about the Misrepresentation policy\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e", "actions": [ { "externalAction": { "type": "REVIEW_ACCOUNT_ISSUE_IN_MERCHANT_CENTER", "uri": "https://merchants.google.com/mc/products/diagnostics/accountissues?a=672911686&hl=en-US" }, "buttonLabel": "Request review", "isAvailable": true } ], "prerenderedOutOfCourtDisputeSettlement": "\u003cdetails class=\"ods-section\"\u003e\u003csummary\u003eShow additional options available to you\u003c/summary\u003e\u003cp class=\"ods-description\"\u003e\u003cspan class=\"segment\"\u003eYou may have the option to request an external appeal. You'll also be asked to provide your routing and reference IDs.\u003c/span\u003e \u003ca href=\"https://support.google.com/european-union-digital-services-act-redress-options?hl=en-GB\" target=\"_blank\" class=\"segment\"\u003eLearn more about external appeals\u003c/a\u003e\u003c/p\u003e\u003cp class=\"ods-param ods-routing-id\"\u003e\u003cspan class=\"segment ods-param-header\"\u003eRouting ID:\u003c/span\u003e \u003cspan class=\"segment ods-param-value\"\u003eRDAX\u003c/span\u003e\u003c/p\u003e\u003cp class=\"ods-param ods-reference-id\"\u003e\u003cspan class=\"segment ods-param-header\"\u003eReference ID:\u003c/span\u003e \u003cspan class=\"segment ods-param-value\"\u003e672911686\u003c/span\u003e\u003c/p\u003e\u003c/details\u003e" }, { "title": "Adult-oriented content", "impact": { "message": "Prevents all products from showing in all countries", "severity": "ERROR", "breakdowns": [ { "regions": [ { "code": "001", "name": "All countries" } ], "details": [ "Products not showing organically" ] } ] }, "prerenderedContent": "\u003cdiv class=\"issue-detail\"\u003e\u003cdiv class=\"callout-banners\"\u003e\u003cdiv class=\"callout-banner callout-banner-info\"\u003e\u003cp\u003e\u003cspan class=\"segment\"\u003eReview requested on Aug 9, 2023. It can take a few days to complete.u003c/span\u003e\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"issue-content\"\u003e\u003cp class=\"content-element\"\u003e\u003cspan class=\"segment\"\u003eThere was a problem identified with the sale of prohibited adult products on your online store. In the case that you are intentionally selling adult items, enable Adult content in Settings in your Merchant Center. In your product file, use the \u003c/span\u003e\u003cspan class=\"segment segment-attribute\"\u003eadult\u003c/span\u003e\u003cspan class=\"segment\"\u003e attribute for specific products.u003c/span\u003e\u003c/p\u003e\u003cp class=\"content-element root-causes-intro\"\u003e\u003cspan class=\"segment\"\u003eMake sure the products meet the policy requirements\u003c/span\u003e\u003c/p\u003e\u003cul class=\"content-element root-causes\"\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eAdult oriented content may be prohibited or restricted depending on the product sold and the country it is sold\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eSee a full list of countries in the HelpCenter\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eDon't list sexually explicit content that is intended to arouse or includes content such as text, image, audio, or video of graphic sexual acts intended to arouse\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eExamples: Graphic depictions of sexual acts in progress, including hardcore pornography, any type of genital, anal, or oral sexual activity; graphic depictions of masturbation or genital arousal and language explicitly referencing arousal, masturbation, cartoon porn, or hentai\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003ca href=\"https://support.google.com/merchants/answer/6150138?hl=en-US#wycd-restricted-adult-content\" class=\"content-element\"\u003eLearn more about the Adult-oriented content policy\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e" }, { "title": "Missing return and refund policy", "impact": { "message": "Limits visibility of all products in all countries", "severity": "ERROR", "breakdowns": [ { "regions": [ { "code": "001", "name": "All countries" } ], "details": [ "Limited visibility for products showing organically" ] } ] }, "prerenderedContent": "\u003cdiv class=\"issue-detail\"\u003e\u003cdiv class=\"issue-content\"\u003e\u003cp class=\"content-element\"\u003e\u003cspan class=\"segment\"\u003eThere was a problem identified with the return and/or refund policy of your online store. Update your return or refund policy to provide customers a transparent shopping experience.u003c/span\u003e\u003c/p\u003e\u003cp class=\"content-element root-causes-intro\"\u003e\u003cspan class=\"segment\"\u003eMake sure your products meet the Shopping policy requirements\u003c/span\u003e\u003c/p\u003e\u003cul class=\"content-element root-causes\"\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eIt's available on your online store\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eWe recommend that you have a separate landing page for your policy and link to it from the other pages on your online store, so that it's easy to find.u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp class=\"tooltip tooltip-style-info\"\u003e\u003cspan class=\"segment\"\u003eIt's available in the language of the country you're selling in or in English\u003c/span\u003e\u003cspan class=\"tooltip-icon\"\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"tooltip-text\"\u003e\u003cspan class=\"segment\"\u003eMake sure that the return and/or refund policy is available in the target language or in English. Ideally, users should be given the option to select the return and/or refund policy in their own language.u003c/span\u003e\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cspan class=\"segment\"\u003eIt's accessible to everyone visiting your online store, without having to log in, sign up or enter any personal information\u003c/span\u003e\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003ca href=\"https://support.google.com/merchants/answer/9158778?hl=en-US\" class=\"content-element\"\u003eLearn more about Missing return and refund policy\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e", "actions": [ { "externalAction": { "type": "REVIEW_ACCOUNT_ISSUE_IN_MERCHANT_CENTER", "uri": "https://merchants.google.com/mc/products/diagnostics/accountissues?a=672911686&hl=en-US" }, "buttonLabel": "Request review", "isAvailable": true } ] } ] }
我们建议您按返回顺序显示问题,并使用
title
和impact.message
。我们还建议您在商家将指针悬停在问题标题或说明上时显示问题的impact.breakdowns
。商家点击列表中的某个问题。
您的应用会显示每个问题的详细
impact
(按country
、destination
、prerendered_content
、prerendered_out_of_court_dispute_settlement
分类),以及商家可以采取的actions
来解决问题的按钮。 操作类型各不相同:- 外部操作:指向商家可在外部页面(例如 Merchant Center)中解决问题的链接。
- 内置的简单操作:指向商家可以解决问题的应用页面。
- 内置用户输入操作:打开一个对话框,商家可以在其中提供所需信息并请求相应操作。只有在请求了
BUILT_IN_USER_INPUT_ACTIONS
时,才能执行此类操作。
- 商家按照说明解决问题。
- 业务重新加载应用中的诊断页面。
- 您的应用会向
IssueResolution
服务提交另一项请求,并显示更新后的问题列表。
您可以将已完成的应用显示的信息与 Merchant Center 中的“诊断”页面进行比较,以验证您的实现。
界面模拟
以下示例展示了如何在账号诊断页面中显示 renderaccountissues
响应中的信息。界面中的对象会映射到模拟中的相应 API 字段。您还可以针对商品问题创建类似的页面。
填充后的账号诊断页面如下所示:
设置预渲染 HTML 的样式
调用问题解决服务后返回的响应包含 prerendered_content
字段,其中包含每个问题的 HTML 详细信息。您可以将此 HTML 内容直接嵌入到界面中,以可读格式显示问题。
您可能会看到带有 new-element
类的 HTML 元素。new-element
类适用于在您与 IssueResolution
服务集成后添加到 HTML 的元素。我们建议您隐藏具有 new-element
类的元素,以便在这些元素显示给应用中的用户之前对其进行样式设置。
以下是 prerendered_content
字段值的示例:
<div class="issue-detail">
<div class="callout-banners">
<div class="callout-banner callout-banner-info"><p><span class="segment">Review requested on Aug 9, 2023. It can take a few days to complete.</span>
</p></div>
</div>
<div class="issue-content"><p class="content-element"><span class="segment">There was a problem identified with the sale of prohibited adult products on your online store. In the case that you are intentionally selling adult items, enable Adult content in Settings in your Merchant Center. In your product file, use the </span><span
class="segment segment-attribute">adult</span><span class="segment"> attribute for specific products.</span>
</p>
<p class="content-element root-causes-intro"><span class="segment">Make sure the products meet the policy requirements</span>
</p>
<ul class="content-element root-causes">
<li><p class="tooltip tooltip-style-info"><span class="segment">Adult oriented content may be prohibited or restricted depending on the product sold and the country it is sold</span><span
class="tooltip-icon"><br></span><span class="tooltip-text"><span class="segment">See a full list of countries in the HelpCenter</span></span>
</p></li>
<li><p class="tooltip tooltip-style-info"><span class="segment">Don't list sexually explicit content that is intended to arouse or includes content such as text, image, audio, or video of graphic sexual acts intended to arouse</span><span
class="tooltip-icon"><br></span><span class="tooltip-text"><span class="segment">Examples: Graphic depictions of sexual acts in progress, including hardcore pornography, any type of genital, anal, or oral sexual activity; graphic depictions of masturbation or genital arousal and language explicitly referencing arousal, masturbation, cartoon porn, or hentai</span></span>
</p></li>
</ul>
<a href="https://support.google.com/merchants/answer/6150138?hl=en-US#wycd-restricted-adult-content"
class="content-element">Learn more about the Adult-oriented content policy</a></div>
</div>
如果您在应用中嵌入上述 HTML prerendered_content
而不添加任何样式,则效果如下所示:
您可以使用多个 CSS 类来调整内容在界面中的呈现方式。 以下是您可以使用的 CSS 示例:
issue-detail {
text-align: left;
width: 700px;
border-radius: 8px;
background: white;
margin: 16px;
padding: 16px;
}
.content-element {
margin: 8px 0 8px 0;
display: block;
}
/* callout banners */
.callout-banners {
margin: 0 0 16px 0;
}
.callout-banner {
display: block;
padding: 16px 16px 6px 16px;
margin: 0 0 8px 0;
border-radius: 8px;
}
.callout-banner-info {
background: #e8f0fe;
}
.callout-banner-warning {
background: #fef7e0;
}
.callout-banner-error {
background: #fce8e6;
}
/* add an icon to the callout banner */
.callout-banner p {
background-repeat: no-repeat;
padding-left: 32px;
}
.callout-banner-error p {
background-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/error/default/20px.svg");
}
.callout-banner-warning p {
background-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/warning/default/20px.svg");
}
.callout-banner-info p {
background-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/search/default/20px.svg");
}
/* segments with style */
.segment-attribute {
color: #198639;
font-family: monospace, monospace;
}
.segment-bold {
font-weight: bold;
}
.segment-italic {
font-style: italic;
}
/* tooltip */
.tooltip {
position: relative;
}
.tooltip-style-info .tooltip-icon:before {
content: '(i)';
font-style: normal;
font-weight: normal;
text-decoration: inherit;
margin-left: 5px;
}
.tooltip-style-question .tooltip-icon:before {
content: '(?)';
font-style: normal;
font-weight: normal;
text-decoration: inherit;
margin-left: 5px;
}
.tooltip .tooltip-text {
visibility: hidden;
text-align: left;
background: white;
border-radius: 8px;
padding: 5px 0;
border: 1px solid;
padding: 10px;
box-shadow: 3px 7px 12px #c1c1c1;
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltip-text {
visibility: visible;
}
/* table */
table.content-element {
margin: 16px 0 16px 0;
border: 1px solid #ccc;
border-collapse: collapse;
margin: 1em 0;
}
table.content-element th {
background-color: #eee;
}
table.content-element th, table td {
border: 1px solid #ddd;
font-size: 0.9em;
padding: 0.3em 1em;
}
/* hidde elements added in future, until they are supported in your application */
.new-element {
visibility: hidden;
}
如果您使用上述 CSS,呈现的内容将如下所示:
您还可以使用 CSS 配置和显示提示:
实现使用用户输入的内置操作
借助包含用户输入的内置操作,您可以在应用中提供复杂的诊断功能作为应用内解决方案。我们建议将其实现为对话框,以便商家提供输入内容、阅读更多信息并确认请求。
每个操作都包含一个或多个操作流程。对于某些操作,可能存在多个流程。例如,商家因不同意审核决定而申请重新审核时,流程可能与商家已解决问题时不同。
如需请求数据以实现需要用户输入才能完成的复杂操作,您必须将 user_input_action_option 字段设置为 BUILT_IN_USER_INPUT_ACTIONS 值。
POST https://merchantapi.googleapis.com/issueresolution/v1/accounts/{ACCOUNT_ID}:renderaccountissues?timeZone=America/Los_Angeles&languageCode=en-GB
{
"user_input_action_option": "BUILT_IN_USER_INPUT_ACTIONS"
}
将 {ACCOUNT_ID} 替换为要触发相应操作处理的账号的唯一标识符。
实现
我们建议,请求用户输入的诊断页面的流程应如下所示:
用户点击操作按钮。
- 如果有多个流程可用,您的应用会提供所有流程,以便用户根据自己的意图选择一个流程。
- 用户选择相应流程。
应用会显示所选操作流程的标题、消息、标注和用户输入表单。建议您在对话框中显示这些详细信息。
- 如果存在,标注会包含重要信息,旨在帮助用户更好地了解相应操作的运作方式以及如何成功完成操作。我们建议突出显示此消息,并根据标注的严重程度设置其样式。
- 如果流程中有任何输入字段,则需要显示这些字段,以便用户提供值。如果输入字段被标记为必需,则在商家提供值之前,您的应用不应允许商家发送请求。
用户阅读信息并提供所需的值。
用户点击相应按钮即可确认其请求。
您的应用通过调用问题解决服务来触发操作处理。以下是示例请求:
POST https://merchantapi.googleapis.com/issueresolution/v1/accounts/{ACCOUNT_ID}:triggeraction { actionContext: "ActionContextValue=", actionInput: { actionFlowId: "flow1", inputValues: [ { input_field_id: "input1", checkbox_input_value: { value: true } } ] }
将 {ACCOUNT_ID} 替换为要触发相应操作处理的账号的唯一标识符。
如需访问
BuiltInUserInputAction
的triggeraction
方法,请使用此表单提交申请。您的应用会显示从
IssueResolution
服务返回的确认消息。- 如果服务返回状态为
INVALID_ARGUMENT
的验证错误,则其中包含详细信息和本地化错误消息,应向商家显示这些信息。我们建议在受影响的输入字段附近显示此类错误。以下是示例回答:
{ "error": { "code": 400, "message": "[actionInput.inputValues] Invalid user input", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "invalid", "domain": "global" }, { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "field": "actionInput.inputValues.input", "description": "The field is required" } ] } ] } }
- 如果服务返回无效状态或内部错误(以
FAILED_PRECONDITION
和INTERNAL
状态表示),应用应指示商家重新加载页面或稍后重试。
- 如果服务返回状态为