Argmax Economics world
ArgMax
Economics News, Data, and Analysis

Tuesday May 13, 7:38 am [5293072]
links in new windows
 + Home | + Articles/Blog | + News | + Economists | + Links | + Glossary | + Stuff | + About

BackIron Referral Tracking Tool

Posted by John Irons at March 06, 2003 06:16 PM

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

Posted by John Irons at March 06, 2003 06:16 PM

Trackback Pings

TrackBack URL for this entry:
http://www.argmax.com/cgi-bin/mt4/mt-tb.cgi/271

3 Comments

sam said:

Using MySql 3.23.43
That table create statement doesn't work - I think because one column is called 'key' - a reserved word...

John Irons said:

I've changed the documentation to name the column 'keycount' rather than 'key'. The program should still work...

Any idea what this php error is about?

Fatal error: Cannot redeclare opendatabase() (previously declared in backiron.php:103) in backiron.php on line 103

Advertisement


   
What I'm Reading

The Difference
by Scott Page

The Wealth of Networks
by Yochai Benkler

The Pro-Growth Progressive : An Economic Strategy for Shared Prosperity
by Gene Sperling


 

Recent Referrals
Sites that sent visitors over the past 0.05 hours. Total: 0 tracked referrals. Top 25 referrals, with minimum of [2].

[..] more...

Powered by backIron


 

© Copyright 1997-2008, John S. Irons, Washington DC. All rights reserved.
Please see the User Agreement and Privacy Statement page for site policies.