查看動作

「目的地」動作會將使用者帶往您的網站,讓使用者完成指定動作。行動號召與單鍵動作不同,行動號召可由多次互動。

Gmail 中的 GoTo 連結
在 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>

測試標記

你可以使用電子郵件標記測試工具驗證標記。貼上標記程式碼後,按一下「驗證」按鈕掃描內容,系統就會回報所有存在的錯誤。

規格

如需各種通用動作類型的規格,請參閱特定類型 ViewActionTrackAction 的說明文件。