I was required to implement the JSON-LD standard in EVENT RESERVATION email sent from an event portal to automatically add, update and cancel an event from the user's calendar.
I'm following this tutorial from Google https://developers.google.com/gmail/markup/reference/event-reservation#update_a_event
I've only managed to automatically add an event whenever the user receive the booking email, however I'm struggling to find a way how to implement the update and cancellation.
For the ADD event I'm using this code
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Foo Fighters Concert",
"startDate": "2017-03-06T19: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"
}
}
}
}
</script>
The result in my calendar is the following
Then I try to send this code to UPDATE the event, however I do not notice any changes in the calendar. The event is still in the same date.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Foo Fighters Concert",
"startDate": "2017-03-06T20:00: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"
}
}
},
"modifiedTime": "2013-05-01T08:00:00-08:00"
}
</script>
Have you an idea why the code, taken directly from the google's tutorial. is not working? And how can I implement those functionalities?
You should try to add the "modifiedTime" tag when you add the event the first time, as it serves as the booking time.
Google then detects that, if the id is the same and the modifiedTime is different, the event should be updated.
Related
Hey 👋 I need some help please
I have structured data (JSON-LD) on a website for a Local Business
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "Restaurant",
"name": "Pizza cafe",
"address": {
"#type": "PostalAddress",
"streetAddress": "some street address",
"addressLocality": "city name"
},
"telephone": "+421234567890",
"servesCuisine": "Pizza",
"geo": {
"#type": "GeoCoordinates",
"latitude": 48.172356,
"longitude": 17.238084
},
"openingHours": [
"Mo 11:00–20:30",
"Tu 11:00–20:30",
"We 11:00–20:30",
"Th 11:00–20:30",
"Fr 11:00–20:30",
"Sa 11:00–20:30"
],
"image": [
"https://image.com/photo.jpeg"
],
"aggregateRating": {
"#type": "AggregateRating",
"ratingValue": "4.4",
"ratingCount": 200,
"bestRating": 5,
"worstRating": 1
},
"priceRange": "€€"
}
</script>
and Rich Results Test parse it correctly
But in Search console I can see only Review snippet, and I can't understand why I can't see local business data
What could be the reason?
I added a RentalCarReservation schema markup to my email, which has passed all the tests for whitelisting by Google, except that it does not create the calendar event automatically. I do see the event card above my email in Google and the action button is also working, but whatever I do, the event is not shown in the calendar (despite having 'Smart features' enabled in all Google apps).
https://www.google.com/webmasters/markup-tester/ lists no issues. I thought it might have something to do with the formatting of the datetime and switched this up a few times, but the card above the email shows the correct day and time.
What might I be doing wrong? Any help is appreciated!
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "RentalCarReservation",
"reservationNumber": "11111",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"url": "https://www.test.com/app/",
"underName": {
"#type": "Person",
"name": "FirstName",
"email": "firstname#email.com"
},
"programMembership": {
"#type": "ProgramMembership",
"memberNumber": "222222"
},
"bookingAgent": {
"#type": "Organization",
"name": "OrganizationName",
"url": "https://www.test.com/"
},
"bookingTime": "2022-02-22T06:25:07-01:00",
"modifyReservationUrl": "https://www.test.com/app/book?id=11111",
"potentialAction": [
{
"#type": "CancelAction",
"target": "https://www.test.com/app/edit?id=11111"
}
],
"reservationFor": {
"#type": "RentalCar",
"name": "Mini Cooper",
"model": "Mini Cooper",
"brand": {
"#type": "Brand",
"name": "Mini"
},
"description": "Ipsem Lorum.",
"rentalCompany": {
"#type": "Organization",
"name": "OrganizationName"
}
},
"pickupLocation": {
"#type": "Place",
"name": "Parkeerlocatie",
"address": {
"#type": "PostalAddress",
"streetAddress": "Nijmegenweg 2",
"addressLocality": "Almere",
"addressRegion": "Flevoland",
"postalCode": "1111AA",
"addressCountry": {
"#type": "Country",
"name": "NL"
}
},
"telephone": "+31000000000"
},
"pickupTime": "2022-03-11T07:00:00-01:00",
"dropoffLocation": {
"#type": "Place",
"name": "Parkeerlocatie",
"address": {
"#type": "PostalAddress",
"streetAddress": "Nijmegenweg 2",
"addressLocality": "Almere",
"addressRegion": "Flevoland",
"postalCode": "1111AA",
"addressCountry": {
"#type": "Country",
"name": "NL"
}
},
"telephone": "+31000000000"
},
"dropoffTime": "2022-03-11T10:00:00-01:00"
}
</script>
The page https://www.hello-yoga.co.uk describes two yoga classes, that run every week.
Is an Event with a potentialAction of type ExerciseAction the best way to represent the classes?
Note these are classes that take place in various locations (e.g. church halls) so HealthClub didn't seem an appropriate type.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Event",
"name": "hello YOGA",
"startDate": "2018-06-13T19:45",
"endDate": "2018-06-13T20:45",
"description":
"Yoga class at Friends Meeting House (Harrogate) every Thursday.",
"image": "https://www.hello-yoga.co.uk/yoga-people.svg",
"location": {
"#type": "Place",
"name": "Friends Meeting House",
"address": {
"#type": "PostalAddress",
"streetAddress": "12A Queens Parade",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"postalCode": "HG1 5PP",
"addressCountry": "GB"
}
},
"offers": {
"#type": "Offer",
"availability": "http://schema.org/LimitedAvailability",
"price": "7.00",
"priceCurrency": "GBP",
"validFrom": "2018-05-01T12:00",
"url": "https://www.hello-yoga.co.uk"
},
"potentialAction": {
"#type": "ExerciseAction",
"name": "hello YOGA",
"description": "Small, friendly yoga class. Suitable for all abilities.",
"exerciseType": "Yoga",
"startTime": "2018-06-13T19:45",
"endTime": "2018-06-13T20:45",
"location": {
"name": "Friends Meeting House",
"#type": "PostalAddress",
"streetAddress": "12A Queens Parade",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"postalCode": "HG1 5PP",
"addressCountry": "GB"
}
},
"performer": {
"#type": "LocalBusiness",
"description":
"Small, friendly yoga classes. Suitable for all abilities. Strengthen body, increase flexibility and calm the mind.",
"name": "hello YOGA",
"email": "clare#hello-yoga.co.uk",
"url": "https://www.hello-yoga.co.uk",
"priceRange": "£7",
"image": "https://www.hello-yoga.co.uk/yoga-people.svg",
"address": {
"#type": "PostalAddress",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"addressCountry": "GB"
}
}
}
</script>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Event",
"name": "hello YOGA",
"startDate": "2018-06-07T19:00",
"endDate": "2018-06-07T20:00",
"description":
"Yoga class at Beckwith Health Club (Harrogate) every Wednesday.",
"image": "https://www.hello-yoga.co.uk/yoga-people.svg",
"location": {
"#type": "Place",
"name": "Beckwith Health Club",
"address": {
"#type": "PostalAddress",
"streetAddress": "Beckwith Health Club",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"postalCode": "HG3 1UF",
"addressCountry": "GB"
}
},
"offers": {
"#type": "Offer",
"availability": "http://schema.org/LimitedAvailability",
"price": "7.00",
"priceCurrency": "GBP",
"validFrom": "2018-05-01T12:00",
"url": "https://www.hello-yoga.co.uk"
},
"potentialAction": {
"#type": "ExerciseAction",
"name": "hello YOGA",
"description": "Small, friendly yoga class. Suitable for all abilities.",
"exerciseType": "Yoga",
"startTime": "2018-06-07T19:00",
"endTime": "2018-06-07T20:00",
"location": {
"name": "Beckwith Health Club",
"#type": "PostalAddress",
"streetAddress": "Beckwith Health Club",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"postalCode": "HG3 1UF",
"addressCountry": "GB"
}
},
"performer": {
"#type": "LocalBusiness",
"description":
"Small, friendly yoga classes. Suitable for all abilities. Strengthen body, increase flexibility and calm the mind.",
"name": "hello YOGA",
"email": "clare#hello-yoga.co.uk",
"url": "https://www.hello-yoga.co.uk",
"priceRange": "£7",
"image": "https://www.hello-yoga.co.uk/yoga-people.svg",
"address": {
"#type": "PostalAddress",
"addressLocality": "Harrogate",
"addressRegion": "North Yorkshire",
"addressCountry": "GB"
}
}
}
</script>
How to send email-notification that will add an event. Using this tool I sent "event card" to my Gmail and receive an email as well as notification about adding a new event to my calendar. But if I try to send this exactly "event card" content via PHP, for example, than I receive an email, but not new event in my calendar. What am I doing wrong?
<html>
<head>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "E123456789",
"underName": {
"#type": "Person",
"name": "Andrii Tarykin"
},
"modifiedTime": "2013-11-02T13:15:00-08:00",
"modifyReservationUrl": "http://gmail-actions.appspot.com/success/{{token}}",
"reservationStatus": "confirmed",
"reservationFor": {
"#type": "Event",
"name": "Foo Fighters Concert",
"performer": {
"#type": "Person",
"name": "Metallica",
"image": "http://example.com"
},
"startDate": "2015-10-01T13:07:55",
"location": {
"#type": "Place",
"name": "AT&T Park",
"address": {
"#type": "PostalAddress",
"streetAddress": "24 Willie Mays Plaza",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94107",
"addressCountry": "US"
}
}
}
}
</script>
</head>
<body>
<p>
This a test for an Event reservation Google Now card in Gmail.
</p>
</body>
</html>
This code doesn't work for me, it doesn't add event in my calendar.
I am able to see the event in email but not in Google Now app. I am triggering email from Google App Script. The markup has been verified by Google's markup tester and is valid. Below is JSON-LD format:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "IO123456789",
"modifyReservationUrl": "http://www.searshomeservices.com",
"modifiedTime": "2015-03-04T02:30:00-06:00",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationStatus": "http://schema.org/Confirmed",
"reservationFor": {
"#type": "Event",
"name": "Event Confirmation",
"startDate": "2015-03-05T04:30:00-06:00",
"performer": {
"#type": "Person",
"name": "Jitendra",
"image": "https://lh3.googleusercontent.com/-qYfc01xZOSg/Uw46cceE_EI/AAAAAAAAABw/xNYxVibhDSs/s70-no/cara_verde.png"
},
"location": {
"#type": "Place",
"name": "Moscone Center",
"address": {
"#type": "PostalAddress",
"streetAddress": "800 W Howard St.",
"addressLocality": "Chicago",
"addressRegion": "IL",
"postalCode": "60626",
"addressCountry": "US"
}
}
}
}
</script>