I constantly run into issues with Facebook scrapping the wrong information off of a page, when all you’re trying to do is put a simple Like, Recommend, or Send (or custom share) button on your page. This is especially problematic when you are working with a Facebook tab. In a failed attempt to make Facebook scrape one of its own Facebook tabs, it scrapes the root page’s basic info (Info tab) every single time.
For example, while trying to share via Send button a link to http://www.facebook.com/DietCoke?sk=app_296328391504, which is Diet Coke’s Home tab, Facebook is likely to scrape the page’s Info tab and you’ll see:
One way to get around this is by creating your own redirector page that forwards to the appropriate Facebook tab while at the same time providing Facebook with the meta data you want it to scrape.
This dummy page consists of two main things:
- Meta tags adhering to the OpenGraph standard which specify the title, URL, description and thumbnail of what you want to share.
- Meta refresh tag that immediately redirects to the appropriate Facebook tab.
Here’s sample content for the dummy/redirector page:
3: <meta http-equiv="refresh" content="0;url=http://www.facebook.com/DietCoke?sk=app_296328391504">
5: <meta property="og:title" content="This is my title" />
6: <meta property="og:type" content="activity" />
7: <meta property="og:url" content="http://www.mysite.com/redirect/" />
8: <meta property="og:image" content="http://www.mysite.com/logo.jpg" />
9: <meta property="og:site_name" content="I'm on Facebook!" />
10: <meta property="fb:admins" content="123456789,2345678912345678" />
11: <meta property="og:description" content="Hello World!" />
In this example we are redirecting to a specific tab on the Diet Coke page. Facebook will ignore this redirect, but it will scrape the meta tags and retrieve the info we specified.
This particular solution (while not pretty) works well for Facebook-specific sharing buttons such as Like, Recommend and Send.
If you can suggest a better alternative, please do!