谷歌现在酒店预订(LodgingReservation)图片标记

时间:2016-01-17 19:22:00

标签: json gmail schema.org google-schemas google-now

我正在尝试使用酒店确认电子邮件中的住宿保留架构插入谷歌即时酒店预订卡。 它看起来很有效,但在我的iPhone中,我看不到我在json中插入的酒店图片。 我阅读了所有的谷歌文档,但我没有找到一个有图像显示酒店预订的工作示例,只有最终结果的图像。 这是一个例子:

<html>
  <head>
            <script type=3D"application/ld+json">   
    {
        "@context": "http://schema.org",
        "@type": "LodgingReservation",
        "reservationNumber": "20161",
        "reservationStatus": "http://schema.org/Confirmed",
        "underName": {
            "@type": "Person",
            "name": "Mario Rossi",
            "email": "demo@gmail.com"
        },
        "reservationFor": {
            "@type": "LodgingBusiness",
            "name": "Hotel Beverly",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Viale Portofino 2",
                "addressLocality": "Rimini",
                "addressRegion": "RN",
                "postalCode": "47833",
                "addressCountry": "IT"
            },
            "telephone": "+390541375288",
            "contactPoint" : {
                "@type" : "ContactPoint",
                "telephone" : "+390541375288",
                "contactType" : "Reception",
                "email" : "info@beverlyhotel.com",
                "faxNumber" : "+390541372288"
            }
        },
        "checkinDate": "2016-02-04T12:00:00-08:00",
        "checkoutDate": "2016-02-08T10:00:00-08:00"
    }
    </script>
  </head>
  <body>
    <p>
      Google Now card in Gmail test.
    </p>
  </body>
</html>

我插入了一个图片的示例网址,在google文档中我没有找到任何单词来解释图像项目的使用情况(最小和最大宽度和高度ecc ...)。

我使用了@Franco的例子,这里是谷歌应用程序结果和谷歌日历结果(在日历中我不知道谷歌拍摄照片的地方......)

example of google app on ios

Example of google calendar result

1 个答案:

答案 0 :(得分:0)

经过更多研究后,我得出的结论是,现在的卡片不会解析您的标记中的图像,但会使用酒店Google +页面中的图像。

我和Grand Hotel et de Milan以及UNA Hotel Cusani进行了测试(我找不到Hotel Beverly di Rimini的任何地方)。我的标记(没有图像属性)生成了一张带有Grand Hotel et de Milan Google + page图片的Now卡片(照片部分第1张图片):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LodgingReservation",
  "reservationNumber": "GHM123",
  "reservationStatus": "http://schema.org/Confirmed",
  "underName": {
    "@type": "Person",
    "name": "Mario Rossi",
    "email": "example@gmail.com"
  },
  "reservationFor": {
    "@type": "LodgingBusiness",
    "name": "Grand Hotel et de Milan",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Via Alessandro Manzoni, 29",
      "addressLocality": "Milano",
      "addressRegion": "IT",
      "postalCode": "20121",
      "addressCountry": "IT"
    },
    "telephone": "+3902123456789",
    "contactPoint" : { 
      "@type" : "ContactPoint",
      "telephone" : "++39 02 723141",
      "contactType" : "Reception",
      "email" : "info@reception.com"
    }
  },
  "checkinDate": "2016-01-21T12:00:00-08:00",
  "checkoutDate": "2016-01-25T10:00:00-08:00"
}
</script>

这是iPhone 6上的Now卡结果(注意我在使用UNA Hotel Cusani时也收到了相同的结果):

enter image description here

更新2/5/16

我能够生成一张带有Beverly徽标的Now卡,它看起来就是Google +页面上的“个人资料”图片。我没有使用图像字段。此外,Inbox中生成的图片也是来自Google +的图片。我的测试脚本下面有结果图片:

  <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LodgingReservation",
  "reservationNumber": "abcdef123456",
  "reservationStatus": "http://schema.org/Confirmed",
  "underName": {
    "@type": "Person",
    "name": "Mario Rossi",
    "email": "example@gmail.com"
  },
  "reservationFor": {
    "@type": "LodgingBusiness",
    "name": "Hotel Beverly",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": " Viale Portofino, 2",
      "addressLocality": "Rimini",
      "addressRegion": "RN",
      "postalCode": "47924",
      "addressCountry": "IT"
    },
    "telephone": "+3902123456789",
    "contactPoint" : { 
      "@type" : "ContactPoint",
      "telephone" : "+3902123456789",
      "contactType" : "Reception",
      "email" : "info@reception.com",
      "faxNumber" : "+3902123456789"
    }
  },
  "checkinDate": "2016-02-04T16:00:00-08:00",
  "checkoutDate": "2016-02-06T10:00:00-08:00"
}
</script>

enter image description here

enter image description here