11

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.

5
  • Get people to like your page by paying them money (even if it's in the form of a discount)? That's cheap, man, just cheap... May 14, 2010 at 22:20
  • @matti presumably if they're willing to make a purchase then they do in fact like the product - at least to some degree. marketing is marketing. its about as minimal commitment as you can get. no signup. simply to get people who already like the product to announce that they like it. i have to disagree with this being cheap May 14, 2010 at 22:26
  • I have just posted an article on my blog describing how to do that: saschakimmel.com/2010/05/… May 26, 2010 at 5:13
  • @matti plus EVERYBODY is doing this now :-) May 27, 2011 at 1:42
  • @Sascha Kimmel thanks but your link is broken. Jun 15, 2015 at 21:59

2 Answers 2

9

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

2

Official FAQ:

Q: How do I know when a user clicks a Like button?

A: If you are using the XFBML version of the button, you can subscribe to the 'edge.create' event through FB.Event.subscribe.

Source: Core Concepts › Social Plugins › Like Button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.