Facebook like button notification - facebook-like

I apologize for the beginner question but I don't know where else to turn.
I have the following code in my website:
<script>
FB.Event.subscribe('edge.create', function(href, widget) {
alert('You just liked the page!');
});
</script>
On the developer page, it states that it will record likes in the database. Well, how do I view them?
The button shows up fine and everything is working properly but I just don't know how to view them.
Thank you.

The code you have posted is for notifying your page (in Javascript obviously) that the user viewing the page has 'liked' it. This is not actually needed in order for the Like functionality to work.
You need to have the Like button on the page already for someone to Like the page (eg. by using the tag with the necessary Javascript SDK loaded - http://developers.facebook.com/docs/reference/plugins/like/ - though it sounds like you already have that done).
As for viewing the 'likes', your Like button will tell you how many people have liked it (if you have that option set), however you cannot directly view who actually Liked your page as Facebook do not allow that (privacy concerns)
The script that you posted can be modify to perform other actions, for example you could make an AJAX call to your own server to record information of the 'like' - eg. if the users are logged in, then you would know who it was that liked it.

Related

Adding custom links like 'Like' / 'Share' / 'Comment' in newsfeed

I just want to know if its possible to add a custom button like 'Like'/'Share'/'Comment' in Facebook's newsfeed.
I wanna add an action like 'Mark as unread' to Posts appearing on the user's newsfeed, so that the user can check them out later.
I found this browser add-on : http://socialfixer.com
So this enables certain functions on a user's newsfeed. I was wondering if this could be achieved through a Facebook app, without the help of a browser add-on.
Thanks :)

Facebook likes (with comments) not working well on a password/login protected website

I am working with our web developer to integrate Facebook Likes (with comments) onto our website. However, he is having problems because FB doesn't work very well with sites where a log in is required. Currently when you click on the 'like' button the 'like' turns into 'confirm'. You then have to click on 'confirm' and another box appears showing how the like will appear on your FB page saying 'Click Like to post this to your profile' with the option of 'like' or cancel. If you click on 'like' then it allows the comment box to pop up then you can add a comment and post to FB.
There are currently too many clicks for this to work. Does anyone have any advice? Would it be better to just use straight likes with the number perhaps or is this a common problem with website that require a login. We just want users to be able to click once, add their comment and post it to FB.
Any help would be really apprecaited. If it is technical that is fine as I will pass replies onto my developer.
Many thanks
This will generally happen for URLs and sites that are new to the Facebook scraper. It is a security measure to prevent like-jacking that some sites have done in the past. You should ensure that you test your site fully with the Debug tool and after some confirmed 'likes', that step will be automatically removed and future users will just have to click like once.
Where you are gating content behind a login, I would additionally recommend that you show different HTML (including OG tags) for anything detected with the Facebook scraper User Agent (see When does Facebook scrape my page? on the Like Button FAQ) so that, for example, the OG tags for a product detail page are picked up correctly even though the scraper is technically not logged in.

Adding a Like button to my web site

I've added a facebook Like button to a few of my web site pages. All of them work except for the home page and I can't figure out why?
It is almost impossible to answer this question without seeing some sample code of your "home page".
Check your page with https://developers.facebook.com/tools/debug
If the response code isn't 200 or your meta tags don't appear properly or whatever else, at least you'll know where to look. Keep in mind that when you click like, Facebook makes a request to your page. Make sure you let Facebook do that (don't block/Redirect the Facebook crawler).
Edit: Sometimes, simply adding your URL and testing on the link above solves the problem. This is if you had a problem with the site when you first added it and meanwhile Facebook cached it as problematic. Debugging it will clear the Facebook cache for that URL.

Facebook Comment page through API

I've searched for a while but I've only found the Facebook UI, that has some basic dialogs. Maybe some of you know some iOS apps that can open the comments page in a new "page" (e.g. Flipboard). Is there a way to show the comment page directly from Facebook or I have to simulate it through the API?
UPDATE: Not a page comment box. I want to show the comments of a post.
It is possible to create a facebook app showing your comment box. The same comment box can be showed in different pages/ urls using the "data-href" url.
<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470"></div>
You could eventually add an static url in a database or something like that to wich you can always refer.
I dont exactly know what you want but i hope this helps

Facebook Like Button for Facebook Page for Blog

I just created a Facebook page for my blog and am working on adding the like button. I suppose my first question is, is there already a like button added to a Facebook fan page itself and the code for the like button is so you can create a like button on a whole different page, like my Blogspot blog page? Since I'm the admin I'm not sure if I'm seeing whatever else is. If not, I'd like to add a like button to my Facebook page for people to like, but for the life of my cannot figure out where to paste the code. I know it says behind the tag, but that doesn't mean anything to me. Please help.
http://developers.facebook.com/docs/plugins/
On the Facebook page is a like button of course already integrated, on that page you can get code for your Blog or website.
Specifically, you're looking for this plugin:
https://developers.facebook.com/docs/reference/plugins/like/
Specify the URL you want the like button to like, whether that be your blog post or your facebook page.
You are looking for the facebook Like Box.
https://developers.facebook.com/docs/reference/plugins/like-box/