0

Hi i'm searching for a way to know if a visitor of my webpage did like my facebook fanpage ? Is there away to know it? It is better if it can be done with javascript but is not a problem if it is in php. Thank you.

EDITED: and i want to know as well if the visitor did like my fanpage earlier ?

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
em.rexhepi
  • 289
  • 1
  • 5
  • 17

2 Answers2

0

If you want to use Javascript, Facebook provides a callback when the like button is clicked :

FB.Event.subscribe('edge.create',
    function(response) {
        alert('You liked the URL: ' + response);
    }
);

You can find more details there : https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

Libert Piou Piou
  • 540
  • 5
  • 22
  • yes but what if a visitor did like my page earlier ? i want to know that to ? – em.rexhepi Jan 12 '13 at 02:30
  • 1
    it seems that you need some permissions to access this information. See http://www.sitepoint.com/forums/showthread.php?855989-Detect-if-current-visitor-has-already-quot-liked-quot-a-webpage – Libert Piou Piou Jan 12 '13 at 02:39
0

It seems there is a way to know if the visitor liked your page.

You can check this page : How to check if a user likes my Facebook Page or URL using Facebook's API

Community
  • 1
  • 1
Libert Piou Piou
  • 540
  • 5
  • 22