Count facebook like from our page - facebook

We want to give our site visitor option to like our Facebook page from our website. However we want to track the "count" of how many like we get from this page. It is indeed our campaign page and we want to track how many visitor we have verus how many like we generate.
I did google and maybe I don't know how to search it, but all I got is general count of like or how to get like button. But my need is little specific, we just need how many like our campaign generate. Period.

You can do some analytics at your end-
The XFBML and HTML5 versions of the button allow you to subscribe to the edge.create event in the Facebook SDK for JavaScript through FB.Event.subscribe. This JavaScript event will fire any time a button is clicked.
edge.create is fired when someone clicks a like button on your page to like something.
edge.remove is fired when someone clicks a like button on your page to unlike something.
Example-
var page_like_or_unlike_callback = function(url, html_element) {
console.log("page_like_or_unlike_callback");
console.log(url);
console.log(html_element);
}
// In your onload handler
FB.Event.subscribe('edge.create', page_like_or_unlike_callback);
FB.Event.subscribe('edge.remove', page_like_or_unlike_callback);
And some other ways mentioned in the FAQ section of the documentation: Like Button

Related

how to check who and when clicked facebook like button

I using this to check how many likes are on my website
http://api.facebook.com/restserver.php?method=links.getStats&urls=http://mywebsite.pl
My Question is:
How to check who and when clicked facebook like button on my website?
There is no way to identify users who clicked a Like Button on your external Website, for privacy reasons. You can only see friends who liked the same URL by setting the "data-show-faces" flag in the Like Button Plugin.
You can subscribe to the edge.create event if you want to know when it gets clicked, but this still does not return WHO clicked it: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe

How to get insights for separate "Like" button(s), not for whole domain

I have put a like button on my web page which is dynamically linked to different Facebook fan pages. I have checked the insights pages of Facebook but it gives an overall count of button clicks from my site. Is there a way to get more detailed information like how many users clicked which Like button?
Facebook documentation mentions a ref tag that can be added to Like button code, however this tag does not show up in insights reports. Also I know I have the chance use JavaScript events to handle reporting personally, but I cannot since I am using iframe version of the button.
Also, is there a way for the Facebook fan page admin (the one that my like button links to) to see that detail exactly? e.g. "xx number of clicks generated with like button from this site (or app--which the like button is tied ?)"
In my opinion, Facebook insights are far from being complete.
If I where you, I would track like events, and visits from like using an analytic tools like Google Analytics. This is what I do for my website, and the website of the company I am working for.
However, Facebook insights can give you complementary metrics (age, gender...).
Regards
Antoine
As Antoine says, you can track your likes with Google Analytics. I don't know about insights though.
Here's more info on how to track likes with GA:
http://www.socialmediaexaminer.com/how-to-track-tweets-facebook-likes-and-more-with-google-analytics/
Use FB.Event.subscribe:
FB.Event.subscribe('edge.create',
function(response) {
alert('You liked the URL: ' + response);
}
);
Why use iframe if it is limiting you from doing what you need to do? Use XFBML or HTML5 versions and use the event handler to do an AJAX call to your server. Kinda like, Dr it hurts when I hit my thumb with a hammer, and the Dr says don't hit your thumb.

Facebook: Get when user clicks like button on fan page

I have created an app that will be used as a tab on my company facebook fan page. I have a new requirement to capture when the user clicks the like button on the facebook fan page and hide a portion of the app page (within the iframe) when the event fires. Although the like button is on facebook's page, is there a way to capture the click event of the like button (ie: javascript sdk) within my app iframe so I can hide appropriate elements?
Like this .... http://www.facebook.com/redbull
Thanks for any and all advice,
B
I found the answer...
How to detect Facebook Like button pressed and trigger event?
I checked the incoming request for fb_sig_is_fan.
I am afraid that this is not possible. Also it makes no sense! because Facebook will reload the page once you click on the like button!

How to catch action from Facebook 'Like' button

Is there a way to catch event of clicking Facebook like button? I don't want to integrate my app with Facebook, just need to count clicks of 'Like'. Tried :
$('.fb_iframe_widget').click(function(){
alert("clicked");
});
but without any luck. If there is no way of doing this will I be able to count likes of particular pages when synced with FB API ?
You must use the xfbml like button rather than the iframe button. After you switch that, do the following:
FB.Event.subscribe('edge.create', function(response) {
// user clicked like button!
});
The facebook event "edge.create" is called when a like button is clicked. I have no idea why it is named that, but that will do what you are looking for.
If that doesn't work, then I think you'd be out of luck, as you can't do anything else because of same origin policy.

Event handling to detect if user clicks a 'Like' button in XFBML page

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.
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
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