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.
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.
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"/>
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.
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."
I found another way to force the facebook crawler to check the page before you click the share button: just include an hidden iFrame with the sharer facebook link.
Example:
<iframe src="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.example.com" style="width: 0px; height: 0px; margin: 0px; padding: 0px;"></iframe>
I finally I think I found the issue. The images I want to share are delivered by a PHP script instead of a plain file. It seems to be related to the way PHP delivers the images:
Bad:
echo readfile($image_thumb_file);
Good:
$fp = fopen($image_thumb_file, "rb");
fpassthru($fp);
After doing this change my images finally appear in the Facebook debugger.
You also can check og:image:width and og:image:height properties.
This works for me.
Related
Facebook will randomly take posts I have shared on a company page and make the preview image blank/white. It is maddening.
Here's what I do to replicate:
Copy URL that I want to share
Go to Facebook's debug and check URL to confirm a preview image shows
Go to Facebook and share the URL in a post
Preview image is blank/white
Example URL: https://hoist.digital/content/blog/know-the-value-of-phone-calls-and-grow-your-business-with-call-tracking
Open graph code in on that URL
<meta property="og:image" content="https://hoist.digital/images/3/1/d/5/1/31d518d87ae71ad5bb2acc907b3ad304b99971e1-graphicstock-beautiful-young-mother-with-her-newbornsoeul9rzz.jpg" />
<meta property="og:image:secure" content="https://hoist.digital/images/3/1/d/5/1/31d518d87ae71ad5bb2acc907b3ad304b99971e1-graphicstock-beautiful-young-mother-with-her-newbornsoeul9rzz.jpg" />
Video of me replicating this: https://hoist.digital/facebookattempt.webm
If the open graph code is there, it's secure, what else could be causing Facebook to occasionally flake out and make some of the preview images white/blank? Here's a strange kicker too... sometimes I can edit/refresh the preview image within Facebook, and the preview image will show again... but in a few days it goes back to white/blank.
Unfortunately, it is well-known problem on Facebook that has not been fixed for years and there is no canonical answer to your question.
The main problem is URIs using HTTP works just fine and URIs using HTTPS do not. So first of all, you should try to change your og:image:secure property to og:image:secure_url, because due to documentation there is no og:image:secure property.
If it does not help, you can explore this thread and you gonna try different options unless, of course, you have tried it yet.
Please pay attention to such methods:
Try to add og:image:url (yes, it is similar to og:image but sometimes it can help).
Try to remove og:image:secure_url property (yes, it is looking strange, but it is Facebook, and it also might work).
Try to add other og properties such as og:image:type, og:image:width, og:image:height
The ShareThis Facebook button will only pull the logo as an image to choose from a page. I am not sure why this is the case since I have other images on pages that I am trying to share from. Can someone help me out with this. I am not really familiar with the ShareThis API. Thanks for any help or feedback.
I tried using the Facebook URL Debugger: https://developers.facebook.com/tools/debug. When doing so, Facebook found all the images on the page, but ShareThis doesn't seem to do the same. That is why I am guessing it is a ShareThis related issue.
The client wants the person posting the page/blog post to be able to select the image from the images on the page. This is normally the case with the ShareThis API, but does not seem to do so. Otherwise I would have just used the open graph option.
URL of site: http://www.atranquilnook.com/
1-30-14: I tried specifying an image with open graph meta on a page. The image was larger than 200 x 200, but it still did not work.
This appears to be happening on every page of the site.
Note: I did not build this site. It was built in Adobe Muse by someone else.
This is not a real answer, but I have to use the space here, to get you all the details of what I found out.
On the debugger it says https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.atranquilnook.com%2F :
Provided og:image is not big enough. Please use an image that's at least 200x200 px. Image 'http://www.atranquilnook.com/images/header-home03.png' will be used instead.
Since there is the image with the couple, which is bigger than 200px x 200px, I do not know if this is the answer, but you could try by uploading some bigger image.
Although the whole warning is deceptive, since a line above it states, that there is no og:image.
Looks like you are relying on Facebook being smart enough to find "better" image on your site. What you should do instead is adding a meta tag in the head section of your page.
<meta property="og:image" content="http://www.yoursite.com/img/some-image.jpg"/>
This will tell Facebook exactly what you want to rest of the world to see.
One of the problems I face while sharing a link of my blogger post on facebook or linkedin is that the thumbnail shared is my picture (which is the only picture on the page). I would prefer no thumbnail being shared.I tried using
<meta property="og:image" content=""
I.e the content is kept as blank, yet it shows a thumbnail. How do i set it to no picture?
You can't. Facebook/Linkedin will crawl your site and decide on it's own what images to offer the user. The og:image meta tag is just a suggestion and not a directive.
The only way to share without image is for the user to remove it.
Update: there is another way. You could detect (on the server) FB/LinkedIns crawler and serve them HTML that does not contain any images. That way they wouldn't have anything to display (just text). I don't know if that's possible on blogger. And if you go down this path, check FB/LinkedIn's TOS if this is allowed (doing this with google, for instance, will get you banned).
I'm having a bizarre problem with Facebook. When I share my content in MSIE 9, it successfully loads the thumbnail the first time I share a URL, but if I share it again, the thumbnail does not load (and never loads again). It just shows their animated "loading" image for several seconds, then that disappears and so do the thumbnail options.
You can see this yourself by clicking these Facebook share links in MSIE 9.
Example 1
Example 2
The same sharing functionality works fine in other browsers, and sharing other pages (e.g. Youtube videos) from the same MSIE 9 works fine every time.
Running Facebook's debugger does not resolve the problem, nor does it report any problems with the OpenGraph tags on my page. It even shows the thumbnails in question.
Looking at the Network tab of the Developer Tools in Facebook shows that the thumbnail image is being loaded each time I share the content.
Update
I've found that MSIE 9 will display the image under the following conditions:
- if I have the image in my cache already
- if the browser doesn't make a request to the server to the safe_image.php URL where the image comes from.
I've been messing around with this test page: http://www.facebook.com/sharer/sharer.php?u=http://c2a-v3-staging.s3.amazonaws.com/sparks%2Fspark_5079%2Findex_test.html
I cannot load the image if I refresh the page, as that makes a request to the server for safe_image.php. It doesn't matter whether the response is a 200 or a 304, the image does not display. However, if I then go to the location bar and press enter, that's a "navigate" event instead of a "refresh", no request is made for the image, and it is displayed (after being loaded from the cache).
I've tried serving the image from another domain, adding the og:image:secure_url tag, having Facebook crawl the HTML on a different domain, and this is the best I can do so far. Unfortunately, it's pretty useless because it means the first share from any user will never work right.
the sharer function of fb is no longer supported by facebook
you should use the feed dialog part of javascript api: https://developers.facebook.com/docs/reference/dialogs/feed/
also make sure your og meta tags contain the correct information http://ogp.me/ that could be your problem, the image size is a meta tag and the image should be 200x200 at least to optimize the scraping of the og meta data
you can also check what errors the meta data is getting from https://developers.facebook.com/tools/debug
Solved! Bizarrely enough, the issue was the dimensions of the image. If I reduce the dimensions of the og:image to fit in a 255x255 pixel box, the sharing works perfectly in MSIE9! Slightly larger sizes, like 262x262, do not work.
I had to run the URL through the Facebook debug tool to clear our their cache of it, of course.
I have another answer to your Question.
Reference: https://sparkengine.call2action.com/sparks/5186/live
The above webpage you want to share doesn't have the Facebook Opengraph protocol for the webpage's thumbnail to be used when sharing links with Facebook.
Here's what that metatag should look like:
<meta property="og:image" content="https://sparkengine.call2action.com/assets/c2a_logo_white-6396a6a536d065359780af683e66dd2a.png"/>
Read more about using this propery name HERE.
In Facebook's debugger tool, it could just be showing a thumbnail that's rendered in the debugger but not necessarily associated with the shared link process.
Although you do see a thumbnail image in the Network Tab, it's not necessarily the case that this will be used in the shared link process, hence the Facebook Opengraph protocol solves this problem, and allows further customization.
EDIT:
It appears at the moment of this writing, your webpage's template has changed. I now notice that the only previously seen og metatag names of:
og:video
og:video:height
og:video:width
now includes the og:image metatag, along with other newly added og metatag properties.
Current image file provided for og:image metatag:
https://c2a-v3.s3.amazonaws.com/sparks/spark_5186/media/thumbnails/spark_5186_09_28_2012_WgZN50Q.jpg
In Firefox web browser, but not in IE8, accessing the og:image directly in the browsers address bar produced this download box:
What also struck me odd about that download is that it's identified as a flash movie. To be sure, no issues were seen in IE8.
I then tested that image thumbnail link directly in Chromes web browser, and that caused an automatic download of that image, but it did not display in the browser, treating it like a downloaded mime type file.
This was true for both thumbnails in both your examples. Perhaps the server-side flash-to-thumbnail is saving the images with incorrect mime file-type information. Once downloaded and analyzed in IfranView, no errors were reported with the .jpg image, as IrfanView will check the file header to ensure it matches it's file-type extension automatically. I would look into how these thumbnails are created on the back-end.
DIGGING DEEPER:
I now understand that you'll have no control on how these thumbnails are made, since it's a service/process done by Amazon s3 Web Servers.
Digging deeper, I see that the main domain for this image files URL is for an XML File:
Reference: https://c2a-v3.s3.amazonaws.com
Google to the rescue. I typed in amazon thumbnail opens as file and this article mentioned to drop the protocol http://www. or https://www. when using a URL for og metatags.
The Facebook Debugger shows no errors when dropping the https:// too, even though it will be report as http:// protocol.
Try:
<meta content='sparkengine.call2action.com/sparks/5186/live' property='og:url'>
<meta content='c2a-v3.s3.amazonaws.com/sparks%2Fspark_5186%2Fmedia%2Fthumbnails%2Fspark_5186_09_28_2012_WgZN50Q.jpg' property='og:image'>
Note any Facebook user can force HTTPS requests via there settings, otherwise HTTP is assumed here.
Resulting Shared Link Generated:
http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsparkengine.call2action.com%2Fsparks%2F5186%2Flive
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How does Facebook Sharer select Images?
Ok guys.. I've researched this thoroughly- I'm at the end of my rope and my supervisor is getting pissed. Any help is appreciated.
facebook opengraph thumbnails do not work when I share pages from my site. I'm sure I have og:image implemented correctly. I have resized the JPG thumbnails to 130x110 pixels. I have even tried hiding another copy of the same thumbnails in the pages with display:none.
example page: http://www.classical917.org/houston_public_radio-arte_publico.php
from that page:
The Facebook debugger (formerly the Linter) picks up the URL of the image, but displays a blank box. When I click on the blank box, the image loads.
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.classical917.org%2Fhouston_public_radio-arte_publico.php
When I post a page from my site into a Facebook 'What's on Your Mind?' box, Facebook gets the title and description from my og: tags, thinks for a while about the image, then loads with no image.
Is it because I'm trying to use the same logo image for every page on the site? Is that a no-no? Is there something wrong with my image (although I've tried several versions)? Am I being penalized for using the debugger too often? Does Facebook hate my site?
Thanks for any ideas or pointers on this. I'm desperate to fix it before I get called into my supervisor's office.. : P
Your site has 215 xhtml validation errors according to the w3c validator. Facebook may be having a hard time parsing your page with so many errors. It could also be a caching issue, although the linter tool should clean up the cache, and the linter tool is pulling in the image properly. It may also not like full path URL's. Try a relative path.
As a work-around, you could also try specifying an image the old way:
<link rel="image_src" href="/_images/logo-facebook-130x110-kuha.jpg" />
The rest of your questions are invalid (Facebook isn't penalizing you and they don't care if you are using the same image).
Try removing line break in the og:description meta.