0

我的EventReservation标记已获得 Google 的批准,但我注意到有时,ViewAction我与之关联的(一个简单的链接)会从 Gmail 中消失,我想知道是什么导致了这个问题。

标记示例:

{
   {
    "@context":"http://schema.org",
    "@type":"EventReservation",
    "reservationStatus":"http://schema.org/Confirmed",
    "reservationNumber":XXX,
    "url":"XXX",
    "action": {
      "@type":"ViewAction",
      "name":"Message Host",
      "url":"XXX"
    },
    "modifiedTime":"2015-08-13T17:56:29+0000",
    "underName": {
      "@type":"Person",
      "name":"XXX"
    },
    "reservationFor": {
      "@type":"Event",
      "name":"XXX",
      "image":"XXX",
      "startDate":"2015-08-17T10:42:28-0400",
      "endDate":"",
      "location": {
        "@type":"Place",
        "name":"",
        "address": {
          "streetAddress":"XXX",
          "addressLocality":"XXX",
          "addressRegion":"XXX",
          "postalCode":"XXX",
          "addressCountry":"XXX"
        }
      }
    }
}
4

2 回答 2

0

There are a few ways to generate a button with the EventReservation schema. You can generate a "View Ticket" button using a URL property:

"url": "https://example.com"

To get a "modify reservation" button, use the modifyReservation property:

"modifyReservationUrl": "https://example.com

In the example you've posted, I'm assuming you're trying to trigger a custom action label with the ViewAction schema. I was able to achieve this by defining a top level Event Reservation first then the View Action. My example below:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EventReservation",
  "reservationNumber": "123456",
  "reservationStatus": "http://schema.org/Confirmed",
  "underName": {
    "@type": "Person",
    "name": "John Smith"
  },
  "reservationFor": {
    "@type": "Event",
    "name": "Example Event",
    "startDate": "2015-08-17T14:30:00-08:00",
    "location": {
      "@type": "Place",
      "name": "AT&T Park",
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "24 Willie Mays Plaza",
        "addressLocality": "San Francisco",
        "addressRegion": "CA",
        "postalCode": "94107",
        "addressCountry": "US"
      }
    }
  },
 "potentialAction": {
    "@type": "ViewAction",
    "name": "View Event",
    "target": "https://www.example.com"
  }
}
</script>

The action button doesn't disappear and should stay:

enter image description here

于 2015-08-17T17:55:26.617 回答
0

一些电子邮件运营商也删除了 json+ld 标记。

我发现 Mandrill 正在删除我的标记,直到我将格式从 json+ld 更改为 microdata。

于 2019-12-19T23:07:37.623 回答