Alternatives to Google Analytics

Statistics Suppliers

Statistics on the Basis of AWStats

But, because such an opt-out often hurts businesses more than it helps them, we have looked at alternatives for extensive web statistics. Of course, you have a legitimate interest in discovering at what time people visited your website, what the search term was, and how long they stayed on the site. And, it is also interesting to know in which subpages, product offerings, and landing pages visitors are particularly interested.

This data is delivered by statistics programs, for example, on the basis of information every web server stores: the access log files. The software prepares the very large files so that the desired information is straightforward and easy to read. The disadvantage of such a software tool is that it needs to be installed on the web server and have access to the log file of the web server service.

As an example, we looked at AWStats. The freely available script, written in Perl, offers simple analysis of log files. The solution is not confined to web servers, but also analyzes mail and FTP log files. You can pick up the latest version on the website [1]. Alternatively, AWStats is already integrated as a package in various Linux distributions. There are different ways of installing. We selected a Ubuntu installation as the operating system on which Apache was already running as the web server. You start the installation at the command line with the following command:

# apt-get install awstats

Ubuntu may complain about missing Perl packages and propose to install them. Confirm by saying Y.

After the installation, you need to configure AWStats. To do so, open the /etc/awstats/awstats.conf file with an editor of your choice, such as vi or JOE. In the line with the LogFile = entry, enter the full path to the access.log file, for example,

/var/log/apache2/access.log. You can also use different placeholders to set up file names with date entries or read all log files in a directory using a wildcard. Then, you enter the log file format: where LogFormat = 4 means an Apache log file. If you are using AWStats on IIS on Windows, the value for LogFormat is 2.

In the next line, enter the domain name. For example:

SiteDomain=www.admin-magazine.com

Below HostAliases, enter the alternative domain names that you want to evaluate via the specified log file. As an example, the entry could look like this:

HostAliases = "admin-magazine.com http://www.sparkhaus-shop.com http://www.linux-magazine.com/"

Leave all the other settings as they are for your first steps. Only the "skiphosts" entry is of interest. There you enter the IPs or domain names from which requests originate that you want to exclude from the statistics. It makes sense, for example, not to record your own page hits, which inevitably occur if you need to maintain the data via a CMS. If your company has a static IP, you would enter it here:

SkipHosts="81.99.123.45"

You can alternatively also specify a DynDNS name or a combination of multiple entries. Then, the entry would look like this, for example:

SkipHostst = "adminmag.dyndns.org 81.99.123.45"

Specifying the SkipFiles variable is equally interesting. It lets you exclude certain files from the access statistics. This could be, say, a file that regularly queries an external monitoring service. Regex parameters are allowed here.

Finally, you need to add AWStats to the cronjob so that the dashboard automatically updates. For example:

*/10 * * * * root /usr/lib/cgi-bin/awstats.pl -update > /dev/null

could be the entry in the crontab.

Setting up Access to the Statistics

You access the statistics through a website. But for the server to actually display the page, you first need to configure a virtual host for Apache2. Go to /etc/apache2/sites-available/000-default.conf in an editor, and enter the information in Listing 1 before the final VirtualHosts tag.

Listing 1

Configure a virtual host for Apache2

01 Alias /awstatsclasses "/usr/share/awstats/lib/"
02 Alias /awstats-icon/ "/usr/share/awstats/icon/"
03 Alias /awstatscss "/usr/share/doc/awstats/examples/css"
04 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
05 ScriptAlias /awstats/ /usr/lib/cgi-bin/
06 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Then, restart Apache service with apache2 restart and access the statistics using

http://alias.domain.tld/awstats/awstats.pl?config=alias.domain.ltd

in a browser of your choice. An example would be:

http://www.admin-magazine.com/awstats/awstats.pl?config=www.admin-magazine.com

You should protect the page with a htaccess file so that only authorized users can view the data.

Free Evaluation with Histats

If the installation is not to your liking, or if you have no options for installing AWstats or a similar program on the web server, you can use alternative web statistics. Two representatives of online statistics suppliers are Histats [2] and Stetic [3]. They differ in that Histats is free of charge for up to 10 million clicks per day, whereas Stetic is generally subject to a charge. Stetic is a German product that stores its data on servers in Germany.

To use Histats for your own site, simply access the website and sign up. Then add the website you want to capture by clicking + Add a website . Now enter the URL and language. Set the time zone of the website and the category. Then enter a title and a page description. Optionally, you can enter the starting value of the counter for page views and visits. Then it is important to ensure the visibility of statistics on "Site stats are visible only to you" because otherwise anybody can gain insights.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus