.comment-link {margin-left:.6em;}

Linux stories... and more

Thursday, October 13, 2005

How to add counter to your blog

This is a story how I've added counter to my blog. But the recipe is right for adding counters to any page, especially, if do not have much control over the host.

OK, lets begin. One day I've come to http://nfsworld.blogspot.com and saw that the blog has counter at the bottom of the page. The design of the thingy was not astonishing, but it did the job. I've started to play with it: http://www.sitemeter.com - they give you free counter. Quickly, I've discovered major problem with their service:
The counter display you actually get is rendered image. You can choose from a pretty small number of predefined patterns with different colors. Generated text on the image is not anti-aliased, and since its the image, it does not benefit from your CSS settings. Bottom line - no matter how I've tried, counter still did not fit well into overall blog design.

I've said good bye to sitemeter and... Google we go. After short time, I've came to http://www.statcounter.com. They also offer free service. But here there are far more design options. I've chosen my favorite one - plain text. I.e. the script just gives you plain number. This way you can design counter look any way you like and perfectly fit it in your blog design.

How to install:
Generally, just follow instructions on website. If you host your blog on http://www.blogger.com, you'll need to insert script snippet to the blog template. That's what I've done:

<h2 class="sidebar-title">Stats</h2>
<p>
Visitors:
<!-- Start of StatCounter Code -->
<span style="font-style: italic;">
... code you've got from statcounter goes here...
</span>
<!-- End of StatCounter Code -->
</p><p></p>
You may also want to place a link to statistics page of your counter

To the end, here are some links to HTML and CSS resouces:

0 Comments:

Post a Comment

<< Home