Monday, May 03, 2010

Statistics Widget for Blogger



What is Statistics Widget for Blogger?
 
Statistics Widget for Blogger will display the total number of posts and total number of comments on your blog. As of now, I have included only these two data for display. I do not see any value in displaying the total words in posts and total words in comments. I find them meaningless. If you are interested to display the total number of posts and total number of comments on your blog, please follow the instructions below.

Instructions to install Statistics Widget for Blogger

  • Log in to your Blogger account
  • On your Blogger Dashboard, click on the "Layout" link 
  • This will take you to the "Page Elements" tab. Decide where you want to insert the statistics widget and click on the "Add a Gadget" link accordingly.
    • Scroll down the list and find "HTML/ Javascript" and click on the "+" button 
  • This will open the "Configure HTML/ Javascript" window. In the title section, please type "Blog Statistics" or "Blog Information" or "Blog Data" or any other title as you may wish
  • In the content section, please copy & paste the following code:

<script style="text/javascript">

function numberOfPosts(json) {
document.write('Total Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}

function numberOfComments(json) {
document.write('Total Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}

</script>

<ul><li><script src="http://yourblog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>

<li><script src="http://yourblog.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul>

<span style="font-size:75%;"><a href="http://blogspot-n-blogger.blogspot.com/2010/05/statistics-widget-for-blogger.html" target="_blank">Widgets for Blogger</a></span>

  • Remember to replace the text in bold "yourblog" with your blog address. Take note to replace it in two locations.

  • Your window should look like the image below.
  • I have a link back to my blog at the bottom. You are free to remove the credit, if you don't like it
  • Click on "Save" button at the bottom right hand corner

That's it. You have created a widget to display the number of posts and number of comments on your blog. Please contact me if you have any doubts or you face any problems with the widget.

1 comment:

  1. I have to express appreciation to this writer for bailing me out of this particular setting. As a result of exploring through the the net and obtaining proposals which were not beneficial, I assumed my life was done. Being alive devoid of the strategies to the problems you've resolved through your report is a serious case, and ones that could have in a negative way affected my entire career if I had not noticed the blog. Your own personal expertise and kindness in controlling a lot of stuff was invaluable. I don't know what I would have done if I hadn't encountered such a solution like this. I can also at this moment look ahead to my future. Thanks very much for this skilled and results-oriented guide. I won't be reluctant to recommend your web page to any person who desires guidance on this subject matter.

    ReplyDelete