Reputation: 51
I'm attempting to do this via FQL but I think I'm retrieving info from the wrong database or something.
Using this FB Like iframe to 'like' a URL:
<iframe src="//www.facebook.com/plugins/like.php?href=http://shop.sinkorswimbrand.com/product/sink-or-swim-snapback&send=false&layout=button_count&width=46&show_faces=false&action=like&colorscheme=light&font&height=21" onclick="javascript:updateLikes();" style="border:none; overflow:hidden; width:46px; height:21px;" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
Using this FQL URL to retrieve JSON info on the URL:
https://api.facebook.com/method/fql.query?query=select total_count,like_count,comment_count,share_count,click_count from link_stat where url='http://shop.sinkorswimbrand.com/product/sink-or-swim-snapback'&format=json
Returns: --- Note: I've made sure to 'like' this myself.
[{"total_count":0,"like_count":0,"comment_count":0,"share_count":0,"click_count":0}]
Does anyone with more experience with Facebook's API have any experience with this? Thanks in advance!
Upvotes: 1
Views: 1020
Reputation: 11852
The problem is in your og:meta tags. This tag on line 31 of your generated source:
<meta property="og:url" content="http://www.sinkorswimbrand.com" />
This tells Facebook to aggregate all the likes for this page into the www.sinkorswimbrand.com
results.
You can see this if you look at the "Redirect Path" section of the debugger results for your URL.
You need unique og:url
tags for each page of your site if you want likes for each individual product page.
Also, you're using a deprecated url to make an FQL query. You should be using https://graph.facebook.com/fql?q=...
Upvotes: 2