Dienstag, 22. Februar 2011

How does Facebook choose the thumbnail images in the "share" popup ?

Everybody who ever addes an share (teilen) button in a webpage knows the small thumbnails shown within the popup that display one or more of your images.

Of course you have the next and forward arrow here, but in 99% of the cases this pop up shows an image on the first position we just do not want there !!

Two questions took me ages to figure out.

1) how can i overrule the image
2) how does facebook choose the particular order of the images, if there are more then one


The answer:
Let us start with question 2:
After ages i found a comment made by one of the facebook devs:
 



For shares, we just pull all the <img> tags, and sort by size, with the biggest one being first.
By size ? I have a page with very small images, so the bigest image here is my content add... great :D


Now the first one, simply put a meta 
og:image tag in your <head> section: 

<meta property="og:image" content="http://www.yourpage.cc/images/1/icon.jpg"> 
This will overrule every other picture.
Easy if yaa know, hum ?








Keine Kommentare:

Kommentar veröffentlichen