首选操作
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
“前往”操作会将用户引导至您的网站,以便用户完成相应操作。与一键操作不同,前往操作可以多次互动。
Gmail 中的常用操作。
使用场景
Gmail 目前支持的“前往”操作包括:
我们将来可能会支持更多操作。
查看操作
您可以向需要用户前往您的网站才能完成操作的电子邮件添加 ViewAction
按钮。
以下声明会向电子邮件添加 ViewAction
按钮:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"url": "https://watch-movies.com/watch?movieId=abc123",
"name": "Watch movie"
},
"description": "Watch the 'Avengers' movie online"
}
</script>
微数据
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="target" href="https://watch-movies.com/watch?movieId=abc123"/>
<meta itemprop="name" content="Watch movie"/>
</div>
<meta itemprop="description" content="Watch the 'Avengers' movie online"/>
</div>
发布商数据
您可以通过设置 publisher
字段来添加有关发送电子邮件的组织的详细信息:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "Watch the 'Avengers' movie online",
"potentialAction": {
"@type": "ViewAction",
"url": "https://watch-movies.com/watch?movieId=abc123",
"name": "Watch movie"
},
"publisher": {
"@type": "Organization",
"name": "Google Play",
"url": "https://play.google.com",
"url/googlePlus": "https://plus.google.com/106886664866983861036"
}
}
</script>
微数据
<div itemscope itemtype="http://schema.org/EmailMessage">
<meta itemprop="description" content="Watch the 'Avengers' movie online"/>
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="target" href="https://watch-movies.com/watch?movieId=abc123"/>
<meta itemprop="name" content="Watch movie"/>
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Google Play"/>
<link itemprop="url" href="https://play.google.com"/>
<link itemprop="url/googlePlus" href="https://plus.google.com/106886664866983861036"/>
</div>
</div>
跟踪操作
您可以向电子邮件添加 TrackAction
按钮,以便用户前往您的网站跟踪包裹递送情况。
当您指定 trackingUrl
属性时,系统会自动生成操作。如需直接链接到移动应用,请同时添加 TrackAction
,如下所示:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ParcelDelivery",
"deliveryAddress": {
"@type": "PostalAddress",
"streetAddress": "24 Willie Mays Plaza",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"addressCountry": "US",
"postalCode": "94107"
},
"expectedArrivalUntil": "2013-03-12T12:00:00-08:00",
"carrier": {
"@type": "Organization",
"name": "FedEx"
},
"itemShipped": {
"@type": "Product",
"name": "iPod Mini"
},
"partOfOrder": {
"@type": "Order",
"orderNumber": "176057",
"merchant": {
"@type": "Organization",
"name": "Bob Dole"
}
},
"trackingUrl": "http://fedex.com/track/1234567890"
"potentialAction": {
"@type": "TrackAction",
"target": "http://fedex.com/track/1234567890"
},
}
</script>
微数据
<div itemscope itemtype="http://schema.org/ParcelDelivery">
<div itemprop="deliveryAddress" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="24 Willie Mays Plaza"/>
<meta itemprop="addressLocality" content="San Francisco"/>
<meta itemprop="addressRegion" content="CA"/>
<meta itemprop="addressCountry" content="US"/>
<meta itemprop="postalCode" content="94107"/>
</div>
<meta itemprop="expectedArrivalUntil" content="2013-03-12T12:00:00-08:00"/>
<div itemprop="carrier" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="FedEx"/>
</div>
<div itemprop="itemShipped" itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="iPod Mini"/>
</div>
<div itemprop="partOfOrder" itemscope itemtype="http://schema.org/Order">
<meta itemprop="orderNumber" content="176057"/>
<div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Bob Dole"/>
</div>
</div>
<link itemprop="trackingUrl" href="http://fedex.com/track/1234567890"/>
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/TrackAction">
<link itemprop="target" href="http://fedex.com/track/1234567890"/>
</div>
</div>
测试您的标记
您可以使用电子邮件标记测试工具验证标记。粘贴您的标记代码,然后点击验证按钮扫描内容,并接收有关是否存在任何错误的报告。
规范
如需了解各种前往操作类型的规范,请参阅特定类型 ViewAction 或 TrackAction 的文档。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Go-To Actions take the user to your website where the action can be completed. Unlike [One Click Actions](/workspace/gmail/markup/reference/one-click-action), go-to actions can be interacted with multiple times.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nGo-to actions in Gmail.\n\n\u003cbr /\u003e\n\nUse Cases\n---------\n\nGo-To Actions currently supported by Gmail are:\n\n- [ViewAction](#view_action)\n- [TrackAction](#track_action)\n\nMore actions might be supported in the future.\n| **Note:** Before you start, make sure you understand how to [embed schemas in emails](/workspace/gmail/markup/embedding-schemas-in-emails) and you are familiar with [testing schemas](/workspace/gmail/markup/testing-your-schema).\n\nView Action\n-----------\n\nYou can add a `ViewAction` button to emails requiring users to go to your site to complete the action.\n\nThe following declaration adds a `ViewAction` button to an email: \n\n### JSON-LD\n\n \u003cscript type=\"application/ld+json\"\u003e\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"EmailMessage\",\n \"potentialAction\": {\n \"@type\": \"ViewAction\",\n \"url\": \"https://watch-movies.com/watch?movieId=abc123\",\n \"name\": \"Watch movie\"\n },\n \"description\": \"Watch the 'Avengers' movie online\"\n }\n \u003c/script\u003e\n\n### Microdata\n\n \u003cdiv itemscope itemtype=\"http://schema.org/EmailMessage\"\u003e\n \u003cdiv itemprop=\"potentialAction\" itemscope itemtype=\"http://schema.org/ViewAction\"\u003e\n \u003clink itemprop=\"target\" href=\"https://watch-movies.com/watch?movieId=abc123\"/\u003e\n \u003cmeta itemprop=\"name\" content=\"Watch movie\"/\u003e\n \u003c/div\u003e\n \u003cmeta itemprop=\"description\" content=\"Watch the 'Avengers' movie online\"/\u003e\n \u003c/div\u003e\n\n### Publisher data\n\nYou can add details about the organization sending the email message by setting the `publisher` field: \n\n### JSON-LD\n\n \u003cscript type=\"application/ld+json\"\u003e\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"EmailMessage\",\n \"description\": \"Watch the 'Avengers' movie online\",\n \"potentialAction\": {\n \"@type\": \"ViewAction\",\n \"url\": \"https://watch-movies.com/watch?movieId=abc123\",\n \"name\": \"Watch movie\"\n },\n \"publisher\": {\n \"@type\": \"Organization\",\n \"name\": \"Google Play\",\n \"url\": \"https://play.google.com\",\n \"url/googlePlus\": \"https://plus.google.com/106886664866983861036\"\n }\n }\n \u003c/script\u003e\n\n### Microdata\n\n \u003cdiv itemscope itemtype=\"http://schema.org/EmailMessage\"\u003e\n \u003cmeta itemprop=\"description\" content=\"Watch the 'Avengers' movie online\"/\u003e\n \u003cdiv itemprop=\"potentialAction\" itemscope itemtype=\"http://schema.org/ViewAction\"\u003e\n \u003clink itemprop=\"target\" href=\"https://watch-movies.com/watch?movieId=abc123\"/\u003e\n \u003cmeta itemprop=\"name\" content=\"Watch movie\"/\u003e\n \u003c/div\u003e\n \u003cdiv itemprop=\"publisher\" itemscope itemtype=\"http://schema.org/Organization\"\u003e\n \u003cmeta itemprop=\"name\" content=\"Google Play\"/\u003e\n \u003clink itemprop=\"url\" href=\"https://play.google.com\"/\u003e\n \u003clink itemprop=\"url/googlePlus\" href=\"https://plus.google.com/106886664866983861036\"/\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n\nTrack Action\n------------\n\nYou may add a `TrackAction` button to emails requiring users to go to your site to track packages being delivered.\n\nAn action is automatically generated when you specify the `trackingUrl` property. To link directly to a mobile application,\nalso include a `TrackAction` as shown: \n\n### JSON-LD\n\n \u003cscript type=\"application/ld+json\"\u003e\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"ParcelDelivery\",\n \"deliveryAddress\": {\n \"@type\": \"PostalAddress\",\n \"streetAddress\": \"24 Willie Mays Plaza\",\n \"addressLocality\": \"San Francisco\",\n \"addressRegion\": \"CA\",\n \"addressCountry\": \"US\",\n \"postalCode\": \"94107\"\n },\n \"expectedArrivalUntil\": \"2013-03-12T12:00:00-08:00\",\n \"carrier\": {\n \"@type\": \"Organization\",\n \"name\": \"FedEx\"\n },\n \"itemShipped\": {\n \"@type\": \"Product\",\n \"name\": \"iPod Mini\"\n },\n \"partOfOrder\": {\n \"@type\": \"Order\",\n \"orderNumber\": \"176057\",\n \"merchant\": {\n \"@type\": \"Organization\",\n \"name\": \"Bob Dole\"\n }\n },\n \"trackingUrl\": \"http://fedex.com/track/1234567890\"\n \"potentialAction\": {\n \"@type\": \"TrackAction\",\n \"target\": \"http://fedex.com/track/1234567890\"\n },\n }\n \u003c/script\u003e\n\n### Microdata\n\n \u003cdiv itemscope itemtype=\"http://schema.org/ParcelDelivery\"\u003e\n \u003cdiv itemprop=\"deliveryAddress\" itemscope itemtype=\"http://schema.org/PostalAddress\"\u003e\n \u003cmeta itemprop=\"streetAddress\" content=\"24 Willie Mays Plaza\"/\u003e\n \u003cmeta itemprop=\"addressLocality\" content=\"San Francisco\"/\u003e\n \u003cmeta itemprop=\"addressRegion\" content=\"CA\"/\u003e\n \u003cmeta itemprop=\"addressCountry\" content=\"US\"/\u003e\n \u003cmeta itemprop=\"postalCode\" content=\"94107\"/\u003e\n \u003c/div\u003e\n \u003cmeta itemprop=\"expectedArrivalUntil\" content=\"2013-03-12T12:00:00-08:00\"/\u003e\n \u003cdiv itemprop=\"carrier\" itemscope itemtype=\"http://schema.org/Organization\"\u003e\n \u003cmeta itemprop=\"name\" content=\"FedEx\"/\u003e\n \u003c/div\u003e\n \u003cdiv itemprop=\"itemShipped\" itemscope itemtype=\"http://schema.org/Product\"\u003e\n \u003cmeta itemprop=\"name\" content=\"iPod Mini\"/\u003e\n \u003c/div\u003e\n \u003cdiv itemprop=\"partOfOrder\" itemscope itemtype=\"http://schema.org/Order\"\u003e\n \u003cmeta itemprop=\"orderNumber\" content=\"176057\"/\u003e\n \u003cdiv itemprop=\"merchant\" itemscope itemtype=\"http://schema.org/Organization\"\u003e\n \u003cmeta itemprop=\"name\" content=\"Bob Dole\"/\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n \u003clink itemprop=\"trackingUrl\" href=\"http://fedex.com/track/1234567890\"/\u003e\n \u003cdiv itemprop=\"potentialAction\" itemscope itemtype=\"http://schema.org/TrackAction\"\u003e\n \u003clink itemprop=\"target\" href=\"http://fedex.com/track/1234567890\"/\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n\nTest your markup\n----------------\n\nYou can validate your markup using the [Email Markup Tester Tool](https://www.google.com/webmasters/markup-tester/). Paste in your markup code and click the **Validate** button to scan the content and receive a report on any errors present.\n\nSpecification\n-------------\n\nFor a specification of the various go-to action types, see the documentation\nfor the specific type [ViewAction](/workspace/gmail/markup/reference/types/ViewAction) or\n[TrackAction](/workspace/gmail/markup/reference/types/TrackAction).\n| **Note:** Some of the schemas used by Google are still going through the standardization process of [schema.org](http://schema.org), and therefore, may change in the future. [Learn More](/workspace/gmail/markup/reference/schema-org-proposals)."]]