Section 6.6. Incorporating Statistics

Over time, you're going to be curious about the people who visit your blog. In particular, you'll want to know if anyone is linking to you and which particular blog archive files seem to be the most popular. Though this information isn't going to improve the quality of your writing, it does give you some useful feedback.

If you FTP your Blogger-generated files to a server, chances are you have a log statistics package already in place to track visitors. However, if you don't have a package in place, or if you're hosting on BlogSpot, you'll need a web statistics package that can be embedded into the blog page itself, rather than being integrated with your web server.

One popular web statistics package is Site Meter, accessible from http://sitemeter.com. The basic service is free, and, because it's a client-side process, it doesn't require any server-side support. To get access to this service, go to the site and sign up for an account following the site instructions.

Eventually, you'll get directed to a page that contains the HTML to add to your blog, or you can use the pre-built service Site Meter provides by supplying your Blogger ID. You can find your Blogger ID by looking at the URL when you open your blog in Blogger. Once you provide the ID and your username and password, as shown in Figure 6-16, click the Add Site Meter to Template button.

Figure 6-16. Service to add Site Meter support to the blog
figs/blog_0616.gif

The Site Meter service invokes the Blogger API to embed the Site Meter code within the template without any intervention on your part. The code it adds is shown in Example 6-7.

Example 6-7. Generated Site Meter code, embedded using XML-RPC based Blogger API
<!--WEBBOT bot="HTMLMarkup" startspan ALT="Site Meter" -->

<script type="text/javascript" language="JavaScript">var 

                                                     site="s13essential"</script>

<script type="text/javascript" language="JavaScript1.2" src="http://s13.sitemeter.com/js/

counter.js?site=s13essential">

</script>

<noscript>

<a href="http://s13.sitemeter.com/stats.asp?site=s13essential" target="_top">

<img src="http://s13.sitemeter.com/meter.asp?site=s13essential" 

                                                alt="Site Meter" border=0></a>

</noscript>

<!-- Copyright (c)2002 Site Meter -->

<!--WEBBOT bot="HTMLMarkup" Endspan -->

After publishing the blog page, you'll see the Site Meter indicator at the bottom. Click on the icon to open the Site Meter statistics for the page, shown in Figure 6-17. The statistics are accessible only with a code name and password ? sent by Site Meter to you in an email when you signed up for the account.

Figure 6-17. Site Meter statistics for blog page
figs/blog_0617.gif

If you're not comfortable supplying your Blogger account name and password, you can copy the generated HTML and paste it into your blog yourself.