Gmail Confirm actions (and roll-out schedule) - google-schemas

I'm testing actions with the Apps Script tutorial (with emails sent to myself), but currently only Go-To actions show up. This is the code I use to generate a Confirm Action, am I doing something wrong?
<script type="application/ld+json">{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Retry fax sending",
"action": {
"#type": "ConfirmAction",
"name": "Retry",
"handler": {
"#type": "HttpActionHandler",
"url": "http://example.com/do/ba98262b-6eb9-4314-a01a-8ff3076821e3"
"method": "POST"
}
}
}
BTW, is there any place in which we can check the status of roll-out of Gmail Actions? For instance, my Google Apps account does not show any action, while my "standard" Gmail account does.

You are simply missing a comma after the handler.url property, this is the correct markup:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Retry fax sending",
"action": {
"#type": "ConfirmAction",
"name": "Retry",
"handler": {
"#type": "HttpActionHandler",
"url": "http://example.com/do/ba98262b-6eb9-4314-a01a-8ff3076821e3",
"method": "POST"
}
}
}
</script>
You can use the Schema Validator tool to check your markup for syntax errors like this: https://developers.google.com/gmail/schemas/testing-your-schema
Go-To and One-Click actions are launched, while Review and RSVP are not yet. Please track the Release Notes page to get all updates.
For what concerns Google Apps accounts, please note that domain admins decide which track they want to be part of and that controls when they get the new features.

Related

TrainReservation markup has no effect on the email

We are trying to integrate TrainReservation schemas in our emails, like what we did for FlightReservation before. I've tried sending a test email to myself (using google scripts) along with the following schema:
<script type="application/ld+json">
[
{
"#context": "http://schema.org",
"#type": "TrainReservation",
"reservationNumber": "175091993",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"cancelReservationUrl": "https://test.com/cancel?id=AB3XY2",
"underName": {
"#type": "Person",
"name": "Test Test"
},
"reservationFor": {
"#type": "TrainTrip",
"departureStation": {
"#type": "TrainStation",
"name": "Foo"
},
"departureTime": "2021-09-21T15:15:00+04:30",
"arrivalStation": {
"#type": "TrainStation",
"name": "Bar"
},
"arrivalTime": "2021-09-21T19:55:00+04:30",
"trainNumber": "282"
},
"reservedTicket": {
"#type": "Ticket",
"underName": "Test Test",
"ticketNumber": "175091993",
"additionalTicketText": "Some text"
}
}
]
</script>
The schema is successfully tested using the markup tester. However, in the received email, I do not see any special thing, unlike FlightReservation markups that show the itinerary data at the top of the email, adds it to the calendar automatically and has action buttons for cancellation and modification.
So I'm wondering, am I doing something wrong, or is this just the normal behavior? What features do I have to expect from TrainReservation markups for the receivers of emails? (and also please answer that for BusReservation markups as well)
Appreciate this question is almost a year old, but it appeared when I Googled "TrainReservation" and "Schema" and didn't have any answers. Somebody asked it 6 years ago here, and it looks like as of August 2022 the TrainReservation type is not supported in Google Schema - you can find a list of supported schema types here, which currently only includes:
Events
Flights
Hotels
Restaurants
They haven't included car hire, but that does also seem to work in my experience.
I suppose all we can do is wait for Google to eventually implement TrainReservation and BusReservation as types. Very frustrating!

Schema.org for website with multiple languages: filling Corporation and WebSite things right

I'm working on a multiple-language website and I'm preparing Schema.org markups using JSON-LD. Important detail: this website uses subdirectories for languages. Let's consider 2 languages:
English: https://www.example.com/
French: https://www.example.com/fr/
I want to put Corporation and WebSite things on all localized HP. Everything goes fine but for #id, url and inLanguage properties: I don't quite know what I should fill.
For Corporation, I think I got it right: I'm going to use on all pages default url and base my #id on it:
{
"#context": "http://schema.org",
"#type": "Corporation",
"#id": "https://www.example.com/#organization",
"name": "Example",
"url": "https://www.example.com/",
...
But what would be the best move for WebSite properties, on my French HP?
Technically speaking, /fr/ subfolder is part of the example.com/ domain. But then, #id, inLanguage and url are not telling my website is also available for French-speakers.
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/#website", // should this be "https://www.example.com/fr/#website" ?
"name": "Example",
"url": "https://www.example.com/", // should this be "https://www.example.com/fr/" ?
"inLanguage": "en", // should this be "fr" ?
...
I searched a lot about this and found nothing on this particular matter.
Does anyone have any experience on this?
You have two different (albeit translated) websites. It shouldn’t matter that they share the same domain/hostname.
Each website should get its own WebSite item, with its own #id, url, and inLanguage values, while they would refer to the same Corporation item.
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/#website",
"url": "https://www.example.com/",
"inLanguage": "en",
"publisher": {"#id": "https://www.example.com/#organization"}
}
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.example.com/fr/#website",
"url": "https://www.example.com/fr/",
"inLanguage": "fr",
"publisher": {"#id": "https://www.example.com/#organization"}
}
If the websites are primarily translations, you could use workTranslation/translationOfWork to link the WebSite items.
"workTranslation": {"#id": "https://www.example.com/fr/#website"}
"translationOfWork": {"#id": "https://www.example.com/#website"}
(This is a good case to see why the WebSite items should have different #id values, because otherwise you couldn’t refer to their translations like that. Using the url value instead of the #id value wouldn’t be a good idea, because this URI typically represents the homepage, not the whole website.)

Error in Google SDTT: "All values provided for url must point to the same page."

I am trying to create some JSON-LD structured data for a list of products on an ecom-site but I am getting an error when using Google's Structured Data Testing Tool.
So far, I have this:
{
"#context": "http://schema.org",
"#type": "OfferCatalog",
"name": "Fresh Fruit",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item":
{
"#type": "Offer",
"price": "1.20",
"priceCurrency": "GBP",
"availability": "http://schema.org/InStock",
"url": "http://example.com/green-apples/",
"itemOffered": {
"#type": "Product",
"name": "Green Apples",
"url": "http://example.com/green-apples/"
}
}
}
]
}
Mostly it validates, but the Google tool throws the following error:
All values provided for url must point to the same page.
The error highlights line 11 ("#type": "Offer",).
The URL fields seem to be clashing with the #context declaration, because if I change the context to either a non-url string or http://example.com, it validates (although, this obviously causes its own issues). (This has been shown to be a red-herring, in the comments below)
What am I missing here? It feels like something blindingly obvious.
I think it is connected with pushing of accelerated mobile pages and its structured data.
Please check my thoughts here: All values provided for URL must point to the same page. My guess was about the problem in Google’s SDTT
So, to fix the problem with your structure data, please use the correct version of ItemList (there are Separately and Combined marked up ItemLists, please check here):
If your items are on the same page, please use the version with items
inside, the Combined one.
Otherwise, if you point to different pages inside and your items are
not on one page, please DON’T put item element with type and other
description inside, the Separately marked up one.
Now it's 2018.
Answer by Yash Pal above is close, but not quite right.
This is not an error from Google validator tools.
The error is valid and you need to fix it.
You use the "Single Page" approach ( there are two approaches "Summary page" and "Single page" )
For "Single Page" approach, you need each URL to be exactly same, and each of them should have "an anchor".
The Google developer doc clearly mentioned it.
I wrote the explanation details there
If your page contains some links to another page, then you should use "Summary Page" approach and it had different data structure ( much simpler one, I think )
I think the issues occurs when we mix two list types i.e Summary page + multiple full details pages and A single, all-in-one-page list.
Google stated on page - https://developers.google.com/search/docs/guides/mark-up-listings
If this is a summary page, the ListItem should include only the type,
position, and url properties.
If this is an all-in-one-page list, the ListItem should include all the additional schema.org properties for the data type that it describes (for example, Recipe or Course objects).
But Google should consider eCommerce category's product listing where people display numbers of product with more than 3 properties on summery page and these are obvious for eCommerce, like price and image are 2 important item on product listing page except the 3 listed above.
So we need to raise this issue with Google to address the concern.
No, it is NOT an error in Google's SDTT,
I have helped many people fix their structured data, including dynamic arrays. Read the instructions. Google clearly states "All values for the URL must point to the same page". Think about it, Google is trying to tell you something.
That something means this "Hey you are using a different item list from the example we provided, your item list has more than two item".
The solution:
Use anchors! Voila!
Please use this example snippet and you cannot go wrong. And another tip; use the Fetch Url option from SDTT:
<script type="application/ld+json">
/*structerd data markup compiled by http://www.iwanross.co.za */
{
"#context": "http://schema.org",
"#type": "ItemList",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item": {
"#type": "Recipe",
"url": "https://www.smokingchimney.com/#beetroot",
"name": "Beetroot Side Salad for the braai",
"image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Beetroot-Salad-
for-the-Braai-800x451.jpg",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2018-10-05"
}
},
{
"#type": "ListItem",
"position": 2,
"item": {
"#type": "Recipe",
"url": "https://www.smokingchimney.com/#carrot",
"name": "Carrot Cake",
"image": "http://www.smokingchimney.com/recipe-pages/images/16x9/carrot-cake-
recipe-picture-1024x576.jpg",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2018-10-05"
}
},
{
"#type": "ListItem",
"position": 3,
"item": {
"#type" : "Recipe",
"url":"https://www.smokingchimney.com/#overnight",
"name": "Overnight Steak Marinade",
"image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Overnight-steak-
marinade-700x465.png",
"author": {
"#type": "Person",
"name": "Marna Ross"
},
"datePublished": "2009-10-05"
}
}
]
}
</script>
It is surely an error in the validator. I checked with the examples google provided: https://developers.google.com/search/docs/guides/mark-up-listings .
If you click on the 2nd example you will see that it has the same error.
The error is shown even if you use 1 item:
{
"#context": "http://schema.org",
"#type": "ItemList",
"itemListElement": [
{
"#type": "ListItem",
"position": 1,
"item": {
"#type": "Recipe",
"url": "http://example.com/desserts/pies/#apple-pie",
"name": "Apple Pie",
"image": "https://example.com/300px-Apple_pie.jpg",
"author": {
"#type": "Person",
"name": "Carol Smith"
},
"datePublished": "2009-11-05"
}
}
]
}
you don't need to anchor every URL, you can add parameters to the URL as well ?i=1
like:
https://website.com/d/link?i=1
https://website.com/d/link?i=2
....
Use type OfferCatalog instead of ItemList. https://schema.org/OfferCatalog

How will Google email markup support application deeplinking?

Reading through the Google email markup documentation (https://developers.google.com/gmail/markup/overview) I found not information on how it is possible to deeplink into a native application.
Since an email contains LD+JSON and contains the URL, why can't the schema not support a native deep-link into the Android or iOS app?
I would have thought that this is the most obvious use-case where one-click actionable content makes sense.
If you look at the JSON-LD example for EntryPoint on Schema.org you'll notice that it allows android-app:// and other types of deep links which is a very explicit way of providing deep links for each platform:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Restaurant",
"name": "Tartine Bakery",
"potentialAction": {
"#type": "ViewAction",
"target": [
"http://www.urbanspoon.com/r/6/92204",
{
"#type": "EntryPoint",
"urlTemplate": "http://api.urbanspoon.com/r/6/92204",
"contentType": "application/json+ld"
},
"android-app://com.urbanspoon/http/www.urbanspoon.com/r/6/92204",
{
"#type": "EntryPoint",
"urlTemplate": "urbanspoon://r/6/92204",
"application": {
"#type": "SoftwareApplication",
"#id": "284708449",
"name": "Urbanspoon iPhone & iPad App",
"operatingSystem": "iOS"
}
},
{
"#type": "EntryPoint",
"urlTemplate": "urbanspoon://r/6/92204",
"application": {
"#type": "SoftwareApplication",
"#id": "5b23b738-bb64-4829-9296-5bcb59bb0d2d",
"name": "Windows Phone App",
"operatingSystem": "Windows Phone 8"
}
}
]
}
}
</script>
Eventually, once deep linking is baked into all of Google's products, these mappings could be crawled from your webpage and the correct links automatically applied regardless of whether you're view a Highlight in Gmail on Chrome or one of the native mobile apps.

SendGrid spec differences between versions of Event Notification Webhook

I have an existing rails3 application with SendGrid Service integration based on SMTP relay, and subscribed to Event Notification Webhooks.
I've got reminder email from Service, informing about impending change to SendGrid's service, and I need make some changes to match new version of Event Notification Webhooks v3.
Email I got contains instructions about How To Upgrade:
Review the documentation to understand how to consume this new version's events.
Implement changes on your side to handle the new in-formatting of event data.
Make changes on SendGrid's configuration page
I wounder, what changes now need I implement on my site? I read manual for v3, but there no information about specifications differences between old and new versions.
Previously, the SendGrid event webhook sent improper batched JSON, with documents seperated by line breaks:
{ "email": "john.doe#sendgrid.com", "timestamp": 1337197600, "smtp-id": "<4FB4041F.6080505#sendgrid.com>", "event": "processed" }
{ "email": "john.doe#sendgrid.com", "timestamp": 1337966815, "category": "newuser", "event": "click", "url": "http://sendgrid.com" }
{ "email": "john.doe#sendgrid.com", "timestamp": 1337969592, "smtp-id": "<20120525181309.C1A9B40405B3#Example-Mac.local>", "event": "processed" }
Today, with v3 it sends proper JSON as such:
[
{
"email": "john.doe#sendgrid.com",
"timestamp": 1337197600,
"smtp-id": "<4FB4041F.6080505#sendgrid.com>",
"event": "processed"
},
{
"email": "john.doe#sendgrid.com",
"timestamp": 1337966815,
"category": "newuser",
"event": "click",
"url": "http://sendgrid.com"
},
{
"email": "john.doe#sendgrid.com",
"timestamp": 1337969592,
"smtp-id": "<20120525181309.C1A9B40405B3#Example-Mac.local>",
"event": "processed"
}
]
If you'd previously been dealing with non-batched events you'll need to adjust your code so that it interprets an array, rather than just a single document, and then loops through said array. Put into code:
# This
consume_data(params)
# Becomes this
params.each { |doc|
consume_data(doc)
}

Resources