how to show an image in gmail inbox preview - email

I have been receiving promotional emails with an image along with the subject line. i have seen this only in Gmail.
Not emojis, but image preview right below the subject line portion in the inbox preview
The emails are much more catchy with this. I have been checking google for a while to see what this feature is called but could not find any clue on the same.
Any information on this is Greatly appreciated.

Gmail Promotion Annotation
Since 2018 you can, indeed, add images with a preview in Gmail by using JSON-LD markup in the email's head.
Gmail Promotions Tabs can have/show:
Logo
Image
Subject
Deal Badges with Dates Frames
Discount Code within a Badge Design
The customization is quite strict, as of now, but the google guidelines are commented in the code snippet below:
<script type="application/ld+json">
[{
"#context": "http://schema.org/",
"#type": "Organization",
// WARNING: Before sending email, either point the logo
// at your own image or delete the logo annotation.
//
// If showing a logo, we recommend using an https URL.
// It's not a requirement today, but may be in the future.
"logo": "https://www.gstatic.com/images/branding/product/1x/googleg_48dp.png"
},{
"#context": "http://schema.org/",
"#type": "EmailMessage",
// Use this optional alternative subject line to avoid duplicate text
// between the subject, deal badge, and discount code.
"subjectLine": "[Important] Please add subject line in annotation"
},{
"#context": "http://schema.org/",
"#type": "DiscountOffer",
// Describe your discount, this will be shown as a badge (eg "25% off" or "free
shipping")
"description": "20% off",
"discountCode": "PROMO",
"availabilityStarts": "2019-07-21T03:42:38-07:00",
"availabilityEnds": "2019-07-24T03:42:38-07:00"
},{
// Promotion card with single image.
// We recommend using an https URL. It's not a requirement today, but may be in
the future.
// Any image size will work and will just be cropped automatically.
// GIF & WEBP images are not supported and will be filtered out.
// Sample image is 538x138, 3.9 aspect ratio
"#context": "http://schema.org/",
"#type": "PromotionCard",
"image": "https://www.google.com/gmail-for-marketers/promo-tab/markup-
tool/sample.png"
}]
</script>
Resources for this answer can be found in Google Developers Documentation:
Promotion Tab Documentation

enter image description here
This is the image of gmail inbox preview for product listing.

Add a Event onmouseover=FuntionName() to each GridView row, and show the popup which will include the message. But get it from client side

Related

Google Schema Tag for site ratings/reviews not working

I've added Schema Tags in order to show star ratings in google search like in the screenshot
I've added the below code
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebSite",
"url": "https://mysiteexample.com",
"potentialAction": { "#type": "SearchAction",
"target": "https://mysiteexample.com/search/?keyword={search_term_string}",
"query-input": "required name=search_term_string" },
"aggregateRating": {
"#type": "AggregateRating",
"ratingValue": "4.8",
"bestRating": "5.0",
"ratingCount": "45"
}
}
</script>
But it not being shown by google. I don't know what the problem is. I've also verified the schema tag from schema analyzer and its alright. Please help me understand what i'm I doing wrong here. Thanks in advance.
Google does not always show review stars, even if the markup is syntactically correct. Check the Google structured data guidelines.
Some possible reasons:
WebSite is not a specified type that can get review stars
The page with the markup should clearly relate to what is being
reviewed
The reviews should be very visible on the page
The reviews should be directly acquired by the page (submit review
option?)
Home pages do not get review stars

Google Structured Data Delegation

I am attempting to get events to show up in the Google Knowledge panel for a business. I have created an organization SD JSON object in the header of the business homepage and delegated the events to another website with proper event markup (microdata) on the page.
I used the following documentation
https://developers.google.com/search/docs/data-types/events#delegation_markup
I have had Google reindex the page and the structured data object shows up in the cached version of the website. I have also waited 3 days before posting here to ensure it had time to get captured by Google and related in searches.
I would like to know if there is something wrong with the following markup, etc in order to get the delegated events to show up in the Google Knowledge panel.
<script type="application/ld+json">
{
"#context":"http://schema.org",
"#type":"Organization",
"legalName":"Diversified Design and Manufacturing",
"address":"165 Boro Line Road, King of Prussia, PA 19406",
"email":"www.diversifieddesignmfg.com/",
"telephone":"(610) 337-1969",
"event": "http://www.burbio.com/groups/diversified-design-and-manufacturing"
}
Also I noticed most release notes and documentation refers to MusicGroups, etc. Is event delegation supported for Organization type SD objects?
Google provides the following information for trouble-shooting events:
Troubleshooting events in Knowledge Graph cards
Knowledge Graph card display is governed by a complex algorithm, so if you don’t see your artist or your artist’s events in the Knowledge Graph card, try these steps:
Make sure that the artist is in both Wikipedia and MusicBrainz, and that the artist's official home page is recorded properly on both those sites.
For events missing from a Knowledge Graph card, check that the events
are shown correctly with no errors in the Structured Data Testing
Tool.
If all fields look correct, report the missing events using the Feedback link under the Knowledge Graph card in Google search.
Please report it asgeneral feedback and be sure to use the term events in your description of the problem.
It also states that event information should come from the *ticket seller's website** and that you cannot use delegation to link to your own website.
SOLUTION -
Firstly, it appears only certain artists are expected to appear in Knowledge Graph Events.
Secondly, your structured data does not contain any information about the specific event, eg start or end time, location or name. The event field must be of type http://schema.org/Event OR a hyperlink to a webpage with http://schema.org/Event markup - the link you included does not refer to any specific event.
If the destination does not contain http://schema.org/Event structured data you can include it manually by nesting it inside http://schema.org/Organization (not delegate) event data inside the Organization as follows:
<script type="application/ld+json">
{
"#context":"http://schema.org",
"#type":"Organization",
"legalName":"Diversified Design and Manufacturing",
"address":"165 Boro Line Road, King of Prussia, PA 19406",
"email":"www.diversifieddesignmfg.com/",
"telephone":"(610) 337-1969",
"event": {
"#context": "http://schema.org/",
"#type": "Event",
"name": "Chinese New Year Festival",
"url": "http://chinesenewyear-2017.org/festival"
"startDate": "2016-01-28T06:00",
"description": "The best Chinese New Year party in 2017",
"location": {
"#type": "Place",
"name": "Missoula, MT",
"url": "http://www.missoula.com/",
"address": {
"#type": "PostalAddress",
"addressLocality": "Missoula",
"addressRegion": "MT"
},
}
}
Google requires certain fields to be included, such as startDate, Location, see at the bottom of this page from google's documentation
Finally, in your example code the email field contains a website URL - not an email address.

Graph API direct message for page: how to retrieve link to attached file

I need to store the link to a file attached to a direct message (for a page, retrieved with "/conversations"). How can I do that?
I know how to get the link of an image. The JSON-object for an image ("attachments") contains the tag "image_data", which contains the tags "url" and "preview_url" for accessing the image.
For attached files (in my case e.g. a PDF), FB only sends "id", "mime_type", "name" and "size", but no additional data. Example:
"id": "m_id.158623824339344"
....
"attachments": {
"data": [
{
"id": "7b84fd4c0f18fb4060ae0fe0dcfeb42e",
"mime_type": "application/pdf",
"name": "Attachment1.pdf",
"size": 80798
}
]
}
But when I log into FB as a user and click the attachment in the browser, I get this link:
https://www.facebook.com/ajax/messaging/attachment.php?attach_id=<attach_id>&mid=id.<mid>&pageid=<pageid>&ext=<ext>&hash=AQCafpYeZj2pSjRk
By trial and error I found out that it is possible to access the file without the "hash" and "ext"-part. This means that in theory I am able to generate this link in my application ("attach_id" and "mid" are provided with the message and I know my pageid).
But this seems to be very unreliable. This link might change anytime, breaking my application.
I searched a lot but couldn't find any documentation about this. Does anybody know a better solution? Or can someone point me to some documentation regarding this issue?
Thanks a lot!
Barbara
Sorry this is not available as of v2.5.
If this becomes a new feature in the future, you should be able to find it in the documentation:
https://developers.intern.facebook.com/docs/graph-api/reference/v2.5/message/attachments

Set Size of SWF posted to Facebook with Feed Dialog

Is there a way to set the dimensions of a swf posted to Facebook using the feed dialog, either javascript or direct url method?
https://developers.facebook.com/docs/reference/dialogs/feed/
I'm not 100% certain that this works anymore as I've tried to add this with the Feed dialog as opposed to the sharer and it seemed to have no effect at all. It may have been replaced by the source parameter in the newer feed dialog API (which I don't think you can define a width/height for. Please correct me if I'm wrong) ..
but,
take a look at media attachments in the stream attachment guide:
https://developers.facebook.com/docs/guides/attachments/
you would pass in a JSON encoded object as the media URL param.
{"media": [{
"type": "flash",
"swfsrc": "http://www.mapsofwar.com/photos/EMPIRE17.swf",
"imgsrc": "http://icanhascheezburger.files.wordpress.com/2009/04/funny-pictures-hairless-cat-phones-home.jpg",
"width": "80",
"height": "60",
"expanded_width": "160",
"expanded_height": "120"
}]}

Facebook platform: what data can I get?

I want to get some data from companies' Facebook pages, but I don't know what kind of data I can expect. Here is just a small set of properties I can use, although I can see that I can get more according to their official example:
{
"id": "19292868552",
"name": "Facebook Platform",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/50414_19292868552_7650_s.jpg",
"link": "http://www.facebook.com/platform",
"category": "Product/service",
"website": "http://developers.facebook.com",
"username": "platform",
"founded": "May 2007",
"company_overview": "Facebook Platform enables anyone to build social applications on Facebook and the web.",
"mission": "To make the web more open and social.",
"fan_count": 1522363
}
On the official site it is written:
Pages in specific categories have
additional fields depending on
category.
But what does that mean? Is there a finite set of properties that can be put on a page, or can a company choose what they want to put? Where can I get the complete list of fields that can be on a page?
Thanks,
Ivan
When you create a page inside Facebook, it lets you choose which type of page you want to create e.g. product, service, company, etc.
Depending on the category that you choose, I guess that there will be some instrinsic information fields for your page. Anyway, I don't think that one category is much different than the others, you should be fine with the standard fields that you have outlined in your question.