og:image shows only after 4 share "clicks" - facebook

I've seen this is a common issue here on stack but it seems that the answer is always dependent on the specific scenario. I'm looking for a fellow coder to give me that "AHA" moment.
Problem: Ads posted to my website do not show the og:image content when shared to facebook until the ad is shared at least 4 times
I have thought about/ tried the following things
Checking the image size to make sure it's not large (128kb) is the norm. I compress all uploads.
Giving the ad some time to marinate before sharing (perhaps the fb crawler takes a while to cache the page)
I tried using the debug crawler tool on fb to see if I could reproduce the problem and I indeed could.
I tried sharing the ad to my own page regardless of the missing image to see if the image showed up on my wall. It did not.
The image will not show up on ANY shares until someone has clicked on the share icon on an ad at least 4 times. It seems to me like it might be some latency issue on facebook's part.
What could cause og:image to only show on subsequent share clicks?
Edit
Here's a test ad.
https://www.jdmxchange.com/Classifieds/Details/6ae72690-14d8-4bab-b039-3a2d79923794

Reading https://developers.facebook.com/docs/sharing/best-practices I found this, which might be just what you're looking for:
Use og:image:width and og:image:height Open Graph tags
Using these tags will specify the image to the crawler so that it can render it immediately without having to asynchronously.
This means, if you set the width and height of your og:image with tags, the image will show straight away.
UPDATE
Actually debugging your URL shows like this URL is redirecting to another page, and then another. Which makes me suspect the Facebook crawler is not able to access the actual OG meta tags you're using.
As a random test, I would add OG metatags to that last URL and see if Facebook uses them. But the actual solution would be to use URLs which are actually reachable to FB (no credentials necessary).

Related

Facebook Sharer has suddenly stopped working for me

I have a LAMP website which allows users to share a graph on Facebook. It was woking fine until May 1st but now whenever I try to share, I just get a grey box.
My site was using sharer.php to do the sharing and giving as the url a document which would generate a single graph, and in it's og:image and og:image:url tags I put a url which points to some code which generates an 800 x 400 png of the same graph. If I copy either url into a browser, they render exactly what I would expect, but if I post the same url to the Sharing Debugger tool, it gives me a blank image.
I have noticed that although clicking the Scrape Again button usually calls the url which renders the image as a png, every now and then it does not, but there is no indication as to why and the Scraped URL page shows exactly the page I would expect with the correct og:image tags.
I have tried changing from using sharer.php to the FB.ui 'share' method, but this has not fixed the issue.
I have also tried asking in the Facebook Developer Community but have had no response. I even tried to raise a bug with Facebook, but it won't let me.
This is driving me nuts. I just don't understand why it has suddenly stopped working. Have I missed something or has Facebook changed anything in the Sharer functionality? Is there any other way to debug this ?
Update: After a lot of tinkering I have found out that this only affects my account, and it affects anything I share on Facebook, not just things from my own site. Furthermore, it's only the preview of the shared page which is not working. What actually gets posted to Facebook is the correct image. I have tried multiple PC's and multiple browsers and it always fails even if I switch off all anti-virus/anti-malware/firewalls etc. Bizarrely, if I share from my phone, it works!

Facebook share wrong image

We use the Facebook Share option on a website with newsarticles. The website is build with PHP and uses Smarty. We generate a unique URL (stripped like /news/headline-of-the-article) and have the meta properties defined.
When the owner shares a links with an image that was previously uploaded, everything is fine. When he uploads a news image, inserts it into the article and shares, Facebook takes another pictures, the pictures that it finds first on the source-code. Altho, in the preview-box just before you publish, it shows the correct image. Once placed, it's the wrong one.
The Facebook Debug Tool shows as og:image tag > og:image domain/UserFiles/images/news/standard_14.jpg
But when I look at the RAW tags og:image shows > domain/UserFiles/images/news/bosuil_1.jpg
So the og:image tag does it job and generates the correct URL, but facebook still posts the wrong image. When I force Facebook (manually) to scrape again, it shows everything good and also shares it correct.
I don't get it...
I had the same problem and found these best practices on facebook's developer wiki: https://developers.facebook.com/docs/sharing/best-practices#precaching
Use og:image:width and og:image:height Open Graph tags
Using these tags will specify the image dimensions to the crawler so that it can
render the image immediately without having to asynchronously download
and process it.
After specifying the width and height we have not had a problem with facebook crawling the right picture immediately.

Facebook's Default Image When `og:image` is Invalid

How does Facebook choose a preview image when the og:image tag is invalid? A friend and I were curious why a Facebook preview image didn't show up in the article — when we ran the URL through the Facebook debugger, it provided the following information.
Provided og:image could not be downloaded or is not big enough. Please use an image that's at least 200x200px and is accessible from Facebook. Image 'http://lostoregon.files.wordpress.com/2014/06/foodcarts.jpeg' will be used instead
Tangent: Running the debugger once appears to clear Facebook's cache, and on the next run Facebook grabbed the correct (since fixed?) image.
The one part of this I don't understand is: How did Facebook chose the http://lostoregon.files.wordpress.com/2014/06/foodcarts.jpeg image to use instead? When I look at the original page, foodcarts.jpeg isn't shown anywhere, which means either
Facebook has some secret sause for chosing from images it's seen before
Facebook picked an image that was on the page at the time, but is no longer there
Something else I'm not considering
Is this default image picking defined, deterministic behavior? If so, how does it work?
the error you describe is common enough, and the image may be all right, but Facebook probably has issues downloading it (it's too big). What happens when the image isn't good is that the get a cached representation of you page, and use the image you provided back then. If Facebook crawls many urls, and there's no image on your site, or there's no cached image, the system will pick the one you use more frequently (on all pages). At least, that's what I have seen.

Facebook displays the wrong og:image tag when sharing

Upon sharing a link on Facebook with og:image and og:video tags it will, under the right conditions, consistently display the wrong thumbnail image. Our clients are having this problem but unfortunately I cannot consistently replicate the conditions under which this issue occurs.
Go to the QVC UK Facebook page and look for video shares (example post). You'll see that the thumbnail for the video is the QVC logo when it should be the image given in the og:image tag. When putting the link through Facebook's debug tool the correct image is displayed with no content warnings or errors. This only seems to be happening when the URL is shared for the first time as subsequent shares will display the correct image. The image is present on our CDN before the URL is shared on Facebook. When I did manage to luckily replicate this issue; running the debugger before sharing on Facebook did not seem to solve the problem.
Am I missing something obvious, is there something wrong with my meta tags or could this be a potential facebook bug?
I've seen that multiple people are recording the same sort of problem on Facebook however only this bug has been left open (as of June 21st). In a related bug report Facebook mention that their crawlers don't only look at the image in the og tag but also look for other relevant images within the page.
Is it possible that it is seeing the QVC logo used so many times on the page that it decides to randomly overwrite the one specified?
Thanks
-- UPDATE
This only seems to be a problem when sharing to Facebook pages as opposed to a user's timeline. Changing the image URL seems to have temporarily fixed the problem. This looks like a Facebook bug

Like - Sharer.php ignoring image despite og meta

Despite the meta tags (the first one I never used before, but it came up in the addthis forums);
And the debug tool getting the data in a correct manner:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.mondiales.nl%2F
The facebook sharer code does not use the image specified. No images show up at all, there is no thumbnail chooser.
Looking at the HTML of the facebook sharer page, the image is actually there! The thumbnail chooser has a display:none. And when posting the damn thing, no image shows up on the wall.
Stop using addthis and implement a like function using the just the Facebook API? But from what I read, Facebook does a request for the page to get it's data so the JS part should not be the issue, should it?
Did I overlook something?
There's a restriction on the width/height ratio of images shared, the ratio must be less than 3.0
Your image is too wide (211/66 = 3.19) - add some vertical whitespace and it'll share OK i think
For future reference this is mentioned on both the old Share Button docs and the Open Graph protocol docs (under 'og:image')
I've found that once I've posted something to my wall from the sharer or the app, if I try to repost it, it will remember the original image (or no image in your case).
It might be worth clearing the whole cache/cookies from your browser and see if that does the trick.
If not, you'll find that if you log in as another user of Facebook and they try to post it, it will pick up on the new image on their account and not yours.
I'm not exactly sure how Facebook caches the images.
I know this thread is old but this may help someone else with the same issue. FB caches shared urls along with the thumb images and descriptions. To update the cache, add a bogus parameter to your shared query string, like, "?v=1". This gets the latest og tags.