Search code examples
facebookfacebook-likefacebook-social-plugins

Facebook Like Button for Specific Tab and Url in Facebook Page


I'm trying to include a Facebook Like button for my App Tab in a Facebook Page. For example:

http://www.facebook.com/pages/PageName/PageId?v=app_AppId&app_data=article-1 http://www.facebook.com/pages/PageName/PageId?v=app_AppId&app_data=article-2 http://www.facebook.com/pages/PageName/PageId?v=app_AppId&app_data=article-3

I'd like all 3 of the URLs to have their own "Like" buttons. Unfortunately, for both the iframe and fbml vesions of the like button, it seems like Facebook treats the like button as an overall Page like button. i.e. if a user has "liked" the Page, then they would have liked all 3 links above.

Is there a way to treat these "like" hrefs as unique?

Thanks


Solution

  • You can pass a different URL than the current page as the href parameter of the Like button. The way I solved it is by having the content available on a stand alone URL, without query strings (http://example.com/article/3) which redirects to the Facebook page tab using JavaScript.

    When the user "likes" the content, the Facebook scraper hits the stand alone page, and since it doesn't follow the JavaScript redirect, it picks up the Open Graph tags correctly, and counts the likes for each article separately.