Take the 2-minute tour ×

I am interested in implementing the facebook "Like" button, but I would like to know what user is clicking on this button so I can get some useful information from this. From what I have read, facebook is leaving us in the dark on who is clicking on what. ANyone have an idea on how I could track which user clicked on a like button for a particular product?

UPDATE: The like button is rendered by facebook either through an iFrame, or through xFBML. This is why it is difficult to track who clicks on what, or embed an onclick event, etc..

share|improve this question
developers.facebook.com/docs/reference/javascript/… –  user762793 Nov 24 '11 at 10:24

5 Answers 5

    alert('You just liked the page!');
share|improve this answer
just to put some reference: developers.facebook.com/docs/reference/javascript/… –  shem Sep 13 '12 at 9:25

so I simply rendered a unique like button for each logged in user with a URL of www.somewebsite.com/thisIsThePageIlike/facebookUID.

won't this defeat the purpose of having a like button and mess up your facebook search ranking? Every user will be liking a different url and so facebook will think you have a ton of pages each with a single like count.

I am also having an issue with XFBML like buttons where the edge.create event isn't firing

share|improve this answer

OK, so I can let you know how I implemented it. What I wanted to get was the UID of the facebook user clicking on the "Like" button inside my facebook connect app. I noticed when a user clicks on the "like" button, facebook fetches the URL passed to it from the button, so I simply rendered a unique like button for each logged in user with a URL of www.somewebsite.com/thisIsThePageIlike/facebookUID. When a request come to the web server with this url, it works like a callback and I process and record the UID if its the first time a user has clicked "like" (ie.. a record of this 'like' does not exist in the db). works for me.

share|improve this answer
that's a great solution!! –  Mild Fuzz Jun 27 '11 at 14:25
Smart solution! –  user1949346 Jun 7 '13 at 10:50

It would be something like the one I have for my client's site such as

share|improve this answer

I'm kind of late here, but check this out: http://socialmediaautomat.com/jquery-fbjlike-js.php

It's a jQuery plugin that allows you to add callbacks on like/unlike for fb, follow/unfollow for twitter and like/unlike in g+

share|improve this answer

protected by Community Jan 12 '12 at 10:52


Would you like to answer one of these unanswered questions instead?
