eth.block
eth.block

Reputation: 504

Tracking Facebook Like clicks

I am trying to build a function in my site where I'll reward the users who 'Like' a page/post/item on site. I know using FQL I can query the like table and find out who liked it. Also I probably need to subscribe to edge.create event to know when someone 'Like' it.

However my question is this. I don't have Facebook connect on my site so I don't know the facebook UID of my site users. Now how I'll compare the Facebook user who click on like with my local site user since there is nothing in common? Or do I need to make login via FB connect mandatory? Any solutions (neat or dirty) are welcome.

Upvotes: 0

Views: 564

Answers (2)

ezmilhouse
ezmilhouse

Reputation: 9121

You should identify the user on your site and save his liking by using a callback solution:

FB.Event.subscribe('edge.create', function(href, widget) {
    // callback will be fired when some one clicked your like button
    // your code to save here ...
    alert('You liked ' + href, widget);
});

Find more info aboeut event subscriptions here: http://developers.facebook.com/docs/reference/api/event/

Find lots of samples here: http://fbrell.com/xfbml/fb:like

Upvotes: 1

ifaour
ifaour

Reputation: 38115

I guess that the fact that you linked to the Like FQL table this means that you are a bit confused about the whole thing.

Here's a couple of points:

  1. Facebook will not share the user id until the user authorize your App
  2. The table you should be looking to is link_stat; and as you can see there's no "uid" in it
  3. Since you don't have Facebook Login implemented but you still have your own system, I suppose you can capture the like through the edge.create, run the reward routine through ajax and since you already have the local site user logged in you can check against that.

Upvotes: 1

Related Questions