views:

410

answers:

2

I have a Facebook connect app / canvas IFrame app which has a Like control for a fanpage.

I'd like to detect when the user clicks the Like button to be able to display additional info (a discount coupon code).

I'm using the latest Javascript API but the events that can be handled doesn't seem to include detection of social widget controls. The documentation for the Like Plugin doesn't show any events.

However I know its definitely possible because if I have two Like buttons on a page they both instantly update each other if I like or unlike whatever it is.


Edit: It is specifically allowed to require someone to become a fan for a promotion :

4.2 In the rules of the promotion, or otherwise, you will not condition entry to the promotion upon taking any action on Facebook, for example, updating a status, posting on a profile or Page, or uploading a photo.

You may, however, condition entry to the promotion upon becoming a fan of a Page.

+1  A: 

I have just posted an article on my blog describing how to do that:

http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/

Sascha Kimmel
perfect! thanks. i gave up trying to wade through facebook's event handling documentation
Simon_Weaver
A: 

I think Facebook updated their documentation since I first looked :

Now its clearer :

http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe

A 'like' click is the edge.create event

Simon_Weaver

related questions