Andrew Smart
Andrew Smart

Reputation: 391

Facebook invite friend with tracking

I am about to create a Facebook iFrame page which will consist of content that I want browsers to share. The page will feature a Facebook friend chooser, most probably the following javascript http://labs.thesedays.com/blog/2011/06/20/the-missing-facebook-interface-component-for-friend-selection/

What I'd like to know is if there is a way to track who shared the link and with how many people?

Upvotes: 2

Views: 1072

Answers (1)

Lix
Lix

Reputation: 48006

You should read the documentation on the Requests Dialog.

When you use the Facebook Javascript SDK to call the dialog, you will recieve a callback as soon as the dialog has closed. This callback will contain details about the users actions within the dialog.

Taken from the documentation :

  FB.ui({method: 'apprequests',
    message: 'My Great Request'
  }, function requestCallback(response) {
    // Handle callback here
  });

In the callback's response argument there is details about the request_id and who the request was sent to :

Object
  request: "REQUEST_ID"
  to: Array[2]
    0: "FB_ID1"
    1: "FB_ID2"
    2: "FB_ID3"
 ...

Unless there is a specific and valid reason not to use facebook's dialogs, I recommend staying with the features facebook has given us. As soon as you start using 3rd party plugins to "mimic" facebook behavior, you are dependent on those developers to update their code when facebook makes changes.

Upvotes: 6

Related Questions