Google now Hotel reservation (LodgingReservation) image markup

醉酒当歌 提交于 2020-01-03 05:16:07

问题


I'm trying to insert a google now hotel reservation card using lodgingReservation schema in my hotel's confirmation email. It seems working all, but in my iphone I can't see the hotel image I've insert in the json. I read all the google documentation but I didn't find a working example with image display of an hotel reservation, only an image of the final result. Here's an example:

<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>

I've insert an example url of an image, in google documentation I didn't find any word to explain the usage of the image item (min and max width and height ecc...).

I've used the example of @Franco and here's the google app result and the google calendar result (in calendar I don't have idea where google take the photo...)


回答1:


After researching more, I came to the conclusion that the Now card will not parse the image in your markup, but will use an image from the hotel's Google + page.

I've conducted a test with Grand Hotel et de Milan and UNA Hotel Cusani (I could not find Hotel Beverly di Rimini anywhere). My markup below (no image property) generated a Now card with an image from the Grand Hotel et de Milan Google + page (1st pic in the photo section):

<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>

This is the Now card result on a iPhone 6 (note I also received the same result when using UNA Hotel Cusani):

Update 2/5/16:

I was able to generate a Now card with the Beverly logo which looks it's the "profile" image on the Google + page. I didn't use the image field. Additionally, the image generated in Inbox was a picture from the Google + as well. My test script below with pictures of the results:

  <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>



来源:https://stackoverflow.com/questions/34842570/google-now-hotel-reservation-lodgingreservation-image-markup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!