Order schema not showing right on Gmail - google-schemas

I'm trying to implement the Order schema as presented on : https://developers.google.com/gmail/markup/reference/order
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Test Ltd."
},
"orderNumber": "56d59b633427b",
"orderStatus": "http://schema.org/PaymentComplete",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Test Products"
},
"price": "41.09",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
},
"url": "http://project1.local/account/tickets",
"potentialAction": {
"#type": "ViewAction",
"target": "http://project1.local/account/tickets"
}
}}
</script>
The issue is that the email shows like a normal email. What am I doing wrong?
Thank you!
PS: The code validates on https://developers.google.com/structured-data/testing-tool/

Try using the JSON I've posted below. PaymentComplete is not recognized, so I used OrderDelivered. You can find more info here:
https://schema.org/OrderStatus
I noticed the word "tickets" in your URL, are you intending to use the order schema for ticket confirmations? I would suggest using event reservation instead. Using this will integrate with Google Now cards and also input the event into the user's Calendar. You can still generate a action button by using url or modifyReservationurl.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Test Ltd."
},
"orderNumber": "56d59b633427b",
"orderStatus": "http://schema.org/OrderDelivered",
"priceCurrency": "USD",
"price": "41.00",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Test Products"
},
"price": "41.00",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
}
},
"url": "https://project1.local/account/tickets",
"potentialAction": {
"#type": "ViewAction",
"target": "https://project1.local/account/tickets"
}
}
</script>

Related

Timezones in Google Mail Markup

We recently implemented the Rental car Mail Markup. For this we implemented the pickup and dropoff time as ISO dates as shown in the documentation. Nevertheless it appeared to us that the timezones of our dates has been ignored and thus we removed the timezone and add the date in local time of the pickup destination. Now we still get reports that in some occasions our date is interpreted as being UTC+0 and then displayed with a wrong time. What is the right way to put in the date so that it will be correctly displayed in google mail?
Thanks in advance
Our Mail includes this snippet
{
"#context": "http://schema.org",
"#type": "RentalCarReservation",
"reservationNumber": "K0523X3368",
"reservationStatus": "http://schema.org/Pending",
"url": "...",
"underName": {
"#type": "Person",
"name": "....",
"email": "..."
},
"programMembership": {
"#type": "ProgramMembership",
"memberNumber": ...,
"program": "..."
},
"bookingAgent": {
"#type": "Organization",
"name": "...",
"url": "..."
},
"reservationFor": {
"#type": "RentalCar",
"name": "FIAT PANDA",
"model": "MBMR",
"brand": {
"#type": "Brand",
"name": "FIAT PANDA"
},
"description": "FIAT PANDA",
"rentalCompany": {
"#type": "Organization",
"name": "Hiper Rentacar"
}
},
"pickupLocation": {
"#type": "Place",
"name": "Palma de Mallorca Airport",
"address": {
"#type": "PostalAddress",
"streetAddress": "Palma de Mallorca Airport",
"addressLocality": "Palma",
"postalCode": "07611",
"addressRegion": "ES",
"addressCountry": "ES"
}
},
"pickupTime": "2019-02-13T14:00:00.000+00:00",
"dropoffLocation": {
"#type": "Place",
"name": "Palma de Mallorca Airport",
"address": {
"#type": "PostalAddress",
"streetAddress": "Palma de Mallorca Airport",
"addressLocality": "Palma",
"postalCode": "07611",
"addressRegion": "ES",
"addressCountry": "ES"
}
},
"dropoffTime": "2019-02-14T08:00:00.000+00:00",
"cancelReservationUrl": "...",
"modifyReservationUrl": "...",
"potentialAction": [
{
"#type": "EditAction",
"target": "..."
}
],
"price": 16.91,
"priceCurrency": "EUR",
"modifiedTime": "2018-05-23T09:20:32.861Z"
}
the resulting card looks like that
mail card
All dates are shown in UTC although my machine is currently located in Germany and the rentlocation is in Spain (both CEST)

Google Schema Markup - Event Reservation - View Action CTA

I have an event reservation markup that works. I'm now trying to add a ViewAction but I'm getting a Modify Reservations CTA instead of View Tickets as shown on this page:
https://developers.google.com/gmail/markup/highlights#ticketed_event_reservation
The Modify Reservations CTA appears to be associated with Hotel Reservations, so I'm not sure why this is showing up for my event reservation type. I know the action.name doesn't change the CTA text but it's there to follow the code.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "123456",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "FIRSTNAME LASTNAME"
},
"reservationFor": {
"#type": "Event",
"name": "Michelle Branch",
"startDate": "2017-07-30 19:00:00.000",
"location": {
"#type": "Place",
"name": "Emos",
"address": {
"#type": "PostalAddress",
"streetAddress": "Emos",
"addressLocality": "Austin",
"addressRegion": "Texas",
"postalCode": "-----",
"addressCountry": "United States"
}
}
},
"ticketNumber": "123456",
"numSeats": "1",
"url": "URLHERE",
"action": {
"#type": "ViewAction",
"target": "URLHERE",
"url": "URLHERE",
"name": "View Order"
},
"description": "View Order"
}
</script>

Multiple email markups for Gmail and Inbox

Does Google support adding multiple markups in one email? For e.g i want to add an action button markup for Gmail and a Highlight markup for Inbox. Can this be done? I did not find any documentation for it.
Yes, having multiple markups is supported. For example, for a flight reservation.
All the code until "arrivalTime" is standard for a basic flight confirmation, but with the addition of "checkinUrl" you add a Go-To action to create a [Check In] button in Gmail.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "FlightReservation",
"reservationNumber": "RXJ34P",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Eva Green"
},
"reservationFor": {
"#type": "Flight",
"flightNumber": "110",
"airline": {
"#type": "Airline",
"name": "United",
"iataCode": "UA"
},
"departureAirport": {
"#type": "Airport",
"name": "San Francisco Airport",
"iataCode": "SFO"
},
"departureTime": "2017-03-04T20:15:00-08:00",
"arrivalAirport": {
"#type": "Airport",
"name": "John F. Kennedy International Airport",
"iataCode": "JFK"
},
"arrivalTime": "2017-03-05T06:30:00-05:00"
},
"checkinUrl": "http://united.com/onlinecheckin.html",
"potentialAction": {
"#type": "CheckInAction",
"target": "http://united.com/onlinecheckin.html"
}
}
</script>

Reading the posted review and rating from Google review-action POST request

I am trying to integrate the review-action button in our review request mailers. Following is the schema used.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"action": {
"#type": "ReviewAction",
"review": {
"#type": "Review",
"itemReviewed": {
"#type": "Product",
"name": "Samsung Galaxy Duos 06-013"
},
"reviewRating": {
"#type": "Rating",
"bestRating": "5",
"worstRating": "1"
}
},
"handler": {
"#type": "HttpActionHandler",
"url": "http://dev.snapdeal.com/reviews/rateReviewGmailButton?pageId=215768&email=furqan8810#gmail.com&limitedAccessToken=97801e79-5d2d-42c0-ad88-8e6ac06ad032",
"requiredProperty": {
"#type": "Property",
"name": "review.reviewRating.ratingValue"
},
"optionalProperty": {
"#type": "Property",
"name": "review.reviewBody"
},
"method": "http://schema.org/HttpRequestMethod/POST"
}
},
"description": "We hope you liked Samsung Galaxy Duos 06-013 . Please tell us about it."
}
</script>
The review button appears in the email . However when the publish request is sent from the button the POSTed form data is something like this:
sma=%5B%22sma%22%2Cnull%2C%22msg-f%3A1470144207624023699%22%2C1402657061725%2C%220%3Aproduct%3A%22%2C%5B%220%3Aproduct%3A%22%2Cnull%2Cnull%2C%5Bnull%2Cnull%2Cnull%2Cnull%2C%5B%22Test%22%2C4%5D%2Cnull%2C%5B%5D%5D%2Cnull%2Cnull%2Cnull%2Cnull%2Cnull%2C%5B0%2C%22product%22%5D%5D%2C%221467005e20072e93%22%2C%5B0%2C%22product%22%5D%5D&
Decoded form:
sma=["sma",null,"msg-f:1470144207624023699",1402657061725,"0:product:",["0:product:",null,null,[null,null,null,null,["Test",4],null,[]],null,null,null,null,null,[0,"product"]],"1467005e20072e93",[0,"product"]]&
The above x-www-form urlencoded data does not seem to have any pattern for us to parse/extract the "review" and "rating" data that is embedded somewhere inside this data chunk.
Could you please help me in getting the posted data read inside my Spring MVC controller.

What exactly is working for the EventReservation type

I created a quite complex schema of the EventRegistration type.
It contained two tickets, had images, contact details, etc.
But all I could get once was a Now card that only contained the title of the event, the date, the location and a action button to open the mail.
I'm wondering, if all the additional data has some error or if this is currently all that is supported. I would have loved to see Logos, contact details, a cancellation link and of course the ticket itself (=QR-Code + download link). This would have been such a nice alternative to Apple's Passbook.
What are the plans for this feature? Is this still going to be developed, is there perhaps already a rough roadmap on when to expect this?
Additionally what I was wondering about is, that the "Email Markup Tester" was complaining that the ticketToken property would be invalid for that type, even though the documentation clearly states that it is part of the EventReservation type.
FYI, here is the anonymized schema I used:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "TFXLLUS00008",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Name 1",
"email": "...#gmail.com"
},
"bookingAgent": {
"#type": "Organization",
"name": "My company",
"description": "My company - online ticketing",
"image": "http://www.MyCompany.com/link/to/logo_1500x1500px.jpg",
"url": "http://www.MyCompany.com",
"url/googlePlus": "https://plus.google.com/+MyCompany/",
"ContactPoint": {
"#type": "ContactPoint",
"email": "support#MyCompany.com",
"telephone": "123456789"
}
},
"reservationFor": {
"#type": "Event",
"name": "Test-Event",
"startDate": "2014-04-26T20:00:00+00:00",
"endDate": "2014-04-30T18:00:00+00:00",
"description": "This is a test event for demo purposes.",
"image": "http://www.MyCompany.com/link/to/event/logo.png",
"url": "http://www.MyCompany.com/link/to/event.html",
"location": {
"#type": "Place",
"name": "Congress hall",
"address": {
"#type": "PostalAddress",
"streetAddress": "Street. 1",
"addressLocality": "City",
"addressRegion": "",
"postalCode": "12345",
"addressCountry": "DE"
}
}
},
"ticketToken": "qrCode:4641484423168988",
"ticketNumber": "1690-8587-4723",
"numSeats": "1",
"ticketDownloadUrl": "https://www.MyCompany.com/linkToTicket.pdf",
"ticketPrintUrl": "https://www.MyCompany.com/linkToTicket.pdf",
"price": "100",
"priceCurrency": "EUR",
"bookingTime": "2014-04-26T13:57:50+00:00",
"modifiedTime": "2014-04-26T13:57:50+00:00"
},
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "TFXLLUS00008",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "Name 2",
"email": "...#gmail.com"
},
"bookingAgent": {
"#type": "Organization",
"name": "My company",
"description": "My company - online ticketing",
"image": "http://www.MyCompany.com/link/to/logo_1500x1500px.jpg",
"url": "http://www.MyCompany.com",
"url/googlePlus": "https://plus.google.com/+MyCompany/",
"ContactPoint": {
"#type": "ContactPoint",
"email": "support#MyCompany.com",
"telephone": "123456789"
}
},
"reservationFor": {
"#type": "Event",
"name": "Test-Event",
"startDate": "2014-04-26T20:00:00+00:00",
"endDate": "2014-04-30T18:00:00+00:00",
"description": "This is a test event for demo purposes.",
"image": "http://www.MyCompany.com/link/to/event/logo.png",
"url": "http://www.MyCompany.com/link/to/event.html",
"location": {
"#type": "Place",
"name": "Congress hall",
"address": {
"#type": "PostalAddress",
"streetAddress": "Street. 1",
"addressLocality": "City",
"addressRegion": "",
"postalCode": "12345",
"addressCountry": "DE"
}
}
},
"ticketToken": "qrCode:4020229019819219",
"ticketNumber": "5218-3082-0382",
"numSeats": "1",
"ticketDownloadUrl": "https://www.MyCompany.com/linkToTicket.pdf",
"ticketPrintUrl": "https://www.MyCompany.com/linkToTicket.pdf",
"price": "100",
"priceCurrency": "EUR",
"bookingTime": "2014-04-26T13:57:50+00:00",
"modifiedTime": "2014-04-26T13:57:50+00:00"
}
</script>

Resources