Akash Mishra
Akash Mishra

Reputation: 189

Facebook Like button showing total count of Likes, Shares and Comments - not just Liked count

I am using facebook like button and my custom facebook share button.

Here is my facebook like button code

<fb:like id="fbLikeButton_pl" href="'+document.URL+'" data-action="like" data-share="false"  send="false" layout="button_count" width="50" show_faces="false"></fb:like>

and following is the custom share button

<a href="javascript:void(0);" class="fb_share_pop "><img src="'+site_url+'/wp-content/plugins/wp-sharelock/images/images.png"></a>

And I am using fb.ui to share on facebook

Query(".fb_share_pop").click(function()
    {

        FB.ui(
                          {
                            method: "feed",
                            name:document.URL,
                            link: document.URL,
                              },
                          function(response) {

                            if (response && response.post_id) {
                                clear();

                                jQuery.cookie('fbs_'+document.URL, 'true', { expires: 100 });


                            } else {

                            }
                          }
                        );
    });

I made custom share button because I have to save it's cookie in my db.

Now fb like button is automatically showing me the total likes of the url and for share I am using graph api to get total shared of url

http://api.facebook.com/restserver.php?method=links.getStats&urls=http://umodemo.com/basic_runclick/test-2/

Issue :

Share is working fine but my fb like button is showing me wrong like counts.It is actually showing me the total counts (liked + share counts) while I need to show only liked counts.

I searched over google but not able to find any parameter or anything so that it show only like counts.

I have other option to make custom like button which I don't want to do.

Does anyone has idea how to achieve my goal? Thanks!

Upvotes: 0

Views: 5886

Answers (1)

thaddeusmt
thaddeusmt

Reputation: 15600

Facebook appears to count "shares" and "likes" together as one number now, since 2011. This is why the Like button shows a number that includes Shares in addition to Likes and Comments.

What makes up the number shown next to my Like button?
The number shown is the sum of:
* The number of likes of your URL
* The number of shares of your URL (this includes copy/pasting a link back to Facebook)
* The number of likes and comments on stories on Facebook about your URL

Sources:

As you note above, you can still get the number of just Shares via the REST API call you are making to links.getStats, but note that Facebook is shutting down the REST API, so it would be smart to stop using it soon. You can also access this information, apparently, via FQL using the link_stat table, but that is also being depreciated after API v2.0 so you should probably not use it either (although it will be around for a while) - especially since Facebook has merged the numbers in their Like button.

Facebook's intention seems to be to count all interactions with a URL as a "Like" in their Button, so attempting to do anything else will be difficult as Facebook slowly updates their APIs to reflect this change. It will continue to be more and more difficult to count Likes and Shares separately, so I would suggest "going with the flow" and not worrying about tracking these numbers independently.

Upvotes: 2

Related Questions