Creating a "Like" button for each page

Hi there,

I’ve recently been looking into Facebook integration and more specifically how I can promote my portfolio website via the “Like” button for each of my projects’ pages. However, when I came to go through the wizard for generating the code I noticed an option which said “This script uses the app ID of your app:”.

Now, I do have an app which is an old game I created as part of a University project but I don’t want it to use that, I simply want to view statistics related to my portfolio’s pages (and they have nothing to do with the application itself anyway) :S.

So my real question is how do I create a unique Like button for each page and track statistics accordingly without linking it to an application? If anything I’d like it to be connected to my portfolio’s Facebook page.

Any ideas please? :slight_smile:

Cheers,

Shoxt3r.

Hi Shoxt3r,
I don’t know the technical answer to your question but I want to know why you want to put ‘LIKE’ button on every page? Only to keep statistic tracked?

It’s pretty straightforward to put a Like button on your pages, so you may need to clarify what you are asking. How were you expecting to track statistics? What statistics?

Sorry, I wrote that question late at night just before bed so should have been clearer :slight_smile:

The purpose of putting “Like” buttons on each page would simply be so that visitors can share specific projects and so that each “Like” button is unique to each page. For this I guess I would need to create a new “Like” button for each page or use the script they provide so that the page’s name and details are tracked accordingly?

As for statistics I’ve realised that there’s no way of really doing this other than viewing the page and seeing the number of “Likes” it has - unless there’s a way of getting at these statistics via Facebook? I know that page visits etc would be handled much more accurately using my Google Analytics account.

However, my main question is why Facebook requires me to link it to an app? I simply want to place a “Like” button on each page - not link to any applications? :S

how do you expect to get the results without placing any script or linking to any application? You have to link your pages and like buttons to the application or pages. Facebook provides analysis of visitors who viewed your site from the posts shared on facebook!

Yes, just put the same code on each page, and the like code picks up the URL, title and description automatically.

my main question is why Facebook requires me to link it to an app? I simply want to place a “Like” button on each page - not link to any applications? :S

The button code needs to link to some kind of app that handles all the Like functionality. However, there are some arguments for not using “Likes”, but rather encouraging people to share your content on Facebook, which is slightly different. Because I didn’t want a whole bunch of JS and apps on my site, I just stripped down the buttons to simple HTML code that gets the same result (not a like as such, but a sharing of content). For example, you can just put a link like this on each page:

<a href="http://www.facebook.com/share.php?u=&amp;title=[title]">Share on Facebook</a>

You just have to replace with the page URL and [title] with the page title. There are various ways to do that dynamically, especially if you are using a CMS like WordPress.

If you are interested, I wrote a little piece on this a while back. It’s pretty basic, but still fun.

All I wanted to enable my visitors to do was “Like” or “Share” my projects’ pages and be able to monitor the statistics for these - such as how many times these pages are shared/liked. I see ralph.m has already answered this question but thank you for your input :).

Great! Thank you very much for your help. I have seen many implementations of the “Like” button but I think Share would be more suitable. Is there a way of dynamically inputting these settings using a custom XHTML/CSS website not integrated within Wordpress? I will take a look at your article too, very useful! :slight_smile:

You could do it with some simple PHP, but there’s still some manual labor involved*. I haven’t tried using JS, but it would probably be easy using that to grab the url and title and inserting them dynamically … but then you are relying on the user having JS enabled and it’s kind of back to JS again, which I wanted to avoid in the first place.

  • A simple example would be to create a variable that holds the URL and a variable that holds the page title, and echoing those variables where needed.

I see. Thank you for your help. My site is running primarily from ASP and I’m not well-up on PHP - one language at a time :). I will use the code you posted on your blogpost though, as the URL method seems straightforward, if a little manual. It certainly explains a lot more than Facebook itself which seems intent on making me link it to an application even though I don’t have any which are related?! :S

Is there any particular reason for it wanting to link to an application when it is more than likely the “Like” button will be placed on a webpage which is completely unrelated to the application it tries to link to?

I’m not totally sure what you mean by linking to an application. I’ve never been aware of that before when getting the FB Like code (for others, as I don’t use it myself).

I’m not sure what it means either. On the main page under Social Plugins there is the IFrame code (http://developers.facebook.com/docs/guides/web/#plugins) but when I go to the Like button page to adjust the settings and generate the code (at http://developers.facebook.com/docs/reference/plugins/like/), it comes up with a screen stating that it will be connected to an application I’ve created :S. I don’t see why I would need to setup an application for my website just to add the Like button…

I don’t like that code generating page. You can just grab the Like code from elsewhere and bypass all that stuff. For example, you can create a Like button by just pasting this code on you page, and replacing the URL with your chosen URL:

<iframe src="http://www.facebook.com/plugins/like.php?href=[COLOR="#FF0000"]http://mysite.com/folder/page[/COLOR]&amp;layout=standard&amp;show_faces=false&amp;action=like&amp;colorscheme=light"
        scrolling="no" frameborder="0"
        style="border:none; height:25px; width: 440px;">
</iframe>

Great, thanks very much!