John Irons's Blog

Icon

Economic News, Data and Analysis

BackIron Referral Tracking Tool

I’ve tried my hand at developing a PHP based referral tracking/displaying tool. I’ve named it BackIron for no good reason.
Just look at the bottom right of the page, below “Recent Referrals,” to see a sample of how it can be used. You can also see all referrals in the past 24 hours.
BackIron will display referrers to your website. Just include the .php script on any page(s) you want to track. You need to have a web server that provides PHP and a MySQL database.
Comments welcome!
To install:

The script currently only supports MySQL, but other modifications may be easy.
Usage:
include(‘backiron.php’);
Options:
$output_type = [ “none” | “short” | “all” ] — Default: Short
$output_number = number — Default: 25
$output_min = number — Default: 2
Examples:
1) To display the top 15 referrers (with a minimum of 5 refers).
$output_type = “short”;
$output_min = 5;
$output_number = 15;
include(‘backiron.php’);
2) To Track referrals only
$output_type = “none”;
include(‘backiron.php’);
The MySQL table srtucture should be as follows:
#
# Table structure for table `bi_refer_table`
#
CREATE TABLE bi_refer_table (
refer_name text NOT NULL,
refer_title text NOT NULL,
count int(11) NOT NULL default ‘1’,
time int(11) NOT NULL default ‘0’,
keycount int(11) NOT NULL auto_increment,
refer_full text NOT NULL,
PRIMARY KEY (keycount)
) TYPE=MyISAM;
Enjoy!


ChangeLog
v0.1 first version – 3/6/03
v0.11 Bug fix, ability to turn off “Unknown” from display – 3/7/03
v0.12 Added total hits, reworded text – 3/7/03
v0.13 [..] more link – 3/7/03
v0.14 Set to display correct number if unknown and local are off. 3/9
v0.15 Added exclude list. 3/9
v0.16 Set to aggregate google refers from multiple countries 3/10

Advertisements

Filed under: Website

Pages

Archives

%d bloggers like this: