Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Share Dialog does not display thumbnails one first load

I'm using the Facebook share dialog to share a specific url. The shared link contains an image which should be part of the sharing later on. The strange thing about this is that it works totally fine on mobile browsers. But desktop browser do not load the image at the first attempt. A simple reload of the sharing window fixes the missing image. Once this image shows up for at least one time it continues working in other browsers without additional reloads..

So my question is: Does anybody knows why the first call of this url does not show images?

Details

Link for opening the sharing dialog

Here is the output of the Facebook Debugger, which is free of errors and shows the image as well.

Facebook debugger output

Update

Seems to work with the Feed Dialog without any issues. But this is another way of sharing which I would like to prevent since it requires an App ID.

like image 985
Sven Bluege Avatar asked Jul 29 '13 09:07

Sven Bluege


People also ask

Why is there no thumbnail when I share a link on Facebook?

1. Facebook debug If you are getting no image at all it's possibly due to a crawl error. The Facebook debug tool will ask Facebook to crawl your page and find all info. You just need to visit the debug web page, add your link and hit the debug button.

When I share a photo on Facebook What's the image resolution?

The Facebook recommended image size for sharing images and sharing links with an image is 1,200 x 630 pixels. Whether you're sharing landscape, portrait, or square images, Facebook will resize it to 500 pixels wide and scale the height accordingly.

How to change Facebook link preview image WordPress?

Just scroll down to the AIOSEO Settings meta box below the post editor and then click on the social tab. Scroll down a bit, and you will see an “Image Source” dropdown where you can select the thumbnail image for Facebook. For example, you can choose to use your featured image, or upload a custom image to use instead.


2 Answers

I have run into this issue as well and it turns out that Facebook has an undocumented "feature", likely implemented for optimization. It does not load your image during the first share.

The bug description can be found here: https://developers.facebook.com/bugs/657696104321030

In short, the solution is one of two possibilities.

  1. The easiest is to include og:image:width and og:image:height as part of your ogtags describing the pixel width and height of the image. Strangely, this will (by design apparently) convince Facebook to scrape the site immediately, including image.

    <meta property="og:image" content="http://example.com/image.jpg"/ >

    <meta property="og:image:width" content="450"/>

    <meta property="og:image:height" content="298"/>

  2. The second potential solution is to trigger a scrape manually via API. I have not tested this, but theoretically it is possible. See the relevant Stackoverflow discussion on this topic.

like image 62
Aron Avatar answered Sep 23 '22 06:09

Aron


Facebook displays a cached image. It does so the first time the share is submitted or when Facebook crawler finds og:image tag on your page.

According to Facebook docs at https://developers.facebook.com/docs/sharing/best-practices#pre-cache-images

"Some of our Social Plugins render an image when someone is interacting with them. The image is based on the og:image on the page, or other images on the page if the og:image isn't set. Before the social plugin can render an image Facebook's crawler has to see the image at least once. For sites where pages change frequently (e.g. ecommerce) the first person who clicks on these plugins won't see a rendered image."

like image 22
SoHo Avatar answered Sep 20 '22 06:09

SoHo