SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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?

    Cheers,

    Shoxt3r.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    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?

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I wrote that question late at night just before bed so should have been clearer

    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

  5. #5
    SitePoint Addict
    Join Date
    Apr 2012
    Location
    Delhi
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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!
    LEADING SEO COMPANY INDIA OFFERING FINEST SEO SERVICES

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Shoxt3r View Post
    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?
    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:

    Code:
    <a href="http://www.facebook.com/share.php?u=[URL]&amp;title=[title]">Share on Facebook</a>
    You just have to replace [URL] 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.

  7. #7
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by seotrafficsearch View Post
    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!
    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 .

    Quote Originally Posted by ralph.m View Post
    Yes, just put the same code on each page, and the like code picks up the URL, title and description automatically.


    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:

    Code:
    <a href="http://www.facebook.com/share.php?u=[URL]&title=[title]">Share on Facebook</a>
    You just have to replace [URL] 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.
    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!

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Shoxt3r View Post
    Is there a way of dynamically inputting these settings using a custom XHTML/CSS website not integrated within Wordpress?
    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.

  9. #9
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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?

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    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).

  11. #11
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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/.../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.....

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    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:

    Code:
    <iframe src="http://www.facebook.com/plugins/like.php?href=http://mysite.com/folder/page&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>

  13. #13
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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:

    Code:
    <iframe src="http://www.facebook.com/plugins/like.php?href=http://mysite.com/folder/page&layout=standard&show_faces=false&action=like&colorscheme=light"
            scrolling="no" frameborder="0"
            style="border:none; height:25px; width: 440px;">
    </iframe>
    Great, thanks very much!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •