Facebook "Like" button callback

Matt picture Matt · May 9, 2010 · Viewed 71.3k times · Source

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..

Answer

TLK picture TLK · Aug 30, 2011
<script>
  FB.Event.subscribe('edge.create', function(href, widget) {
    alert('You just liked the page!');
  });
</script>