开发者

Facebook, who liked our fan page?

开发者 https://www.devze.com 2023-03-23 06:21 出处:网络
I have a Facebook like button on the top of my page and on every product page. How I can find out, where and who clicke开发者_JAVA技巧d the like button (on which product, or on the top of the page?).

I have a Facebook like button on the top of my page and on every product page. How I can find out, where and who clicke开发者_JAVA技巧d the like button (on which product, or on the top of the page?).


You can't because it's restriction of their privacy policy


I've never done anything like that myself, but it looks like you can use Javascript to fire off an event when a given button is clicked -- so you would assign each button on each page a unique identifier and send that back to the server on click. Relevant bits:

After you have obtained the application id you first of all have to add Facebook’s namespace to your html element on the website you wish to add the “Like” button to:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

Then, on the actual page, you include:

window.fbAsyncInit = function() {
  FB.init({appId: 'YOUR_FACEBOOK_APP_ID', status: true, cookie: true, xfbml: true});
    FB.Event.subscribe('edge.create', function(href, widget) {
    // Do something, e.g. track the click on the "Like" button here
    alert('You just liked '+href);
  });
};

The actual post has a bit more detail.

EDIT: As others have mentioned, this only covers which button is clicked, and not who has clicked it. In addition to being technically impossible and in violation of Facebook's privacy policy, tracking individual Facebook users on your site without their explicit permission is an unethical invasion of their privacy. Respect your users.


You cannot know your users' Facebook account, it goes against Facebook's privacy policy.

As for where on the page, use Javascript.


If a user has connected to the application the xfbml like button is configured to, then yes you can collect the information the user has shared with your application. You can not share the analytical type data though. For your use only.

As per http://developers.facebook.com/policy/ art. II sec. 2,3

** Storing and Using Data You Receive From Us**

You will only request the data you need to operate your application. You may cache data you receive through use of the Facebook API in order to improve your application’s user experience, but you should try to keep the data up to date. This permission does not give you any rights to such data.

But in art. I sec. 7

Special provisions for apps on Pages:

  • b. When a user visits your Page, if they have not given explicit permission by authorizing your Facebook app or directly providing information to your Page, you may only use information obtained from us and the user's interaction with your Page in connection with that Page. For example, although you may use aggregate analytics for your individual Page, you must not combine information from any other sources to customize the user's experience on your Page and may not use any information about the user's interaction with your Page in any other context (such as analytics or customization across other Pages or websites).


Step 1 Create a Facebook Page, such as http://www.facebook.com/pages/SomethingFacebookUsersLike/

Step 2 Create a custom Facebook Like button configured for the above URL. Place the Like button on your Web page.

Step 3 Create an event handler for when a Facebook user clicks the like button...

 FB.Event.subscribe("edge.create", function(targetUrl) {

// When the Facebook Like Button is clicked (Likejacked), kick off
// a request to the server immediately to see who just now "liked" the page.
// That person who clicked the like button is probably the same person.
    dojo.xhrGet({
        url : server_url + fb_page_id,
        handleAs : "json",
        load : function(response, ioArgs) {
            // response should have the facebook user data
        }
    });

});

Step 4 Server-side process makes a request for the fan page of the Facebook Page...

https://www.facebook.com/browse/page_fans/?page_id=[insert_facebook_page_id]

Replace the page ID for the Facebook Page in the above URL. On that page, the top most Facebook user listed, which will include a link to their profile, is the person who most recently clicked the Like button. Visit users profile and screen scape whatever information is sought after. This information would include at least their "real name" and Facebook ID.

Longer technical explanation can be found here:

I Know Your Name, and Probably a Whole Lot More (Deanonymization via Likejacking, Followjacking, etc.) http://blog.whitehatsec.com/i-know-your-name-and-probably-a-whole-lot-more-deanonymization-via-likejacking-followjacking-etc/

0

精彩评论

暂无评论...
验证码 换一张
取 消