Installing BBClone Web Analytics Pros and Cons, WordPress Solution

These are my observations, problems and solution to using BBClone analytics.

BBClone

I had a go at using BBClone web analytics software. Also known as “A PHP based Web Counter on Steroids”, which hasn’t seen updates since 2015. I found out that if you are on shared hosting you might run into problems with automatically adding the BBClone activation code (or tracking code) to each php file. The suggested method is to add the following lines into your .htaccess file:

<FilesMatch “\.(php)$”>
php_value short_open_tag “Off”
php_value auto_append_file “/the/path/that/leads/to/count.php”
</FilesMatch>

This resulted in a “500 Internal server error” on two different hosts (one of them being GoDaddy) because a majority of server admins prohibit the use of auto_predend_file in .htaccess as a security measure. If you are running your own server however, this shouldn’t cause any problems.

BBClone PHP Web Counter Analytics

For those who are running WordPress for example, there is a straight forward solution.

How to install BBClone on WordPress:

All you need to do (after unpacking BBClone into your public_html) is to add this for example to your template-loader.php file in the wp-includes directory.

define(“_BBC_PAGE_NAME”, get_bloginfo(“name”) . wp_title(“/”, false));
define(“_BBCLONE_DIR”, “/path/to/public_html/bbclone/”);
define(“COUNTER”, _BBCLONE_DIR.”mark_page.php”);
if (is_readable(COUNTER)) include_once(COUNTER);

Then just redirect your browser to “http://www.domain.com/bbclone”.

What’s basically being done here is to have the tracking code run on every page, and each page is given a unique title value “BBC_PAGE_NAME”, despite each page processing the same code, from the same file.

If you don’t know your way around this issue, another method might to add the code separately on each php file, so you can set the page name value individually. Which doesn’t sound much like fun.

Also running BBClone on a html site is probably not a good idea as it’s designed to parse php code. I have no idea if it’s possible or not, but I even tried and failed miserably.

This is simply my observations, please prove me wrong if so.

1 thought on “Installing BBClone Web Analytics Pros and Cons, WordPress Solution”

Leave a Reply to Chris Cancel reply