Click Tracker [PHP]




Click tracker:

The script can be used to track how many people click on the download
and external links on your website. You don't need to modify each link,
just place a few lines of JavaScript code in the header section of your
website (you should do it only once to track ALL links). The script
creates daily statistics which is stored in MySQL database. You can
select which links to track/not to track by domain name and extension.


Installation:

1. Open admin/init.php file and edit "Config" section:

$ct_host = "MySQL_hostname_(usually_localhost)";
$ct_username = "MySQL_user's_username";
$ct_password = "MySQL_user's_password";
$ct_database = "MySQL_database_name";
$ct_table = "MySQL_table_name";
$ct_replace = true_or_false;
$ct_days_keep = number_of_days_to_keep_statistics;

2. Upload files to the server.

3. Open admin/setup.php script in your browser to create MySQL table.

4. To test the script, open sample.php script in your browser and click sample links therein.

5. To view statistics, open admin/index.php script in your browser.

6. Place the following code in the header section (between tags <head>
and </head>) of your site:

<script type="text/javascript">
var clicktracker_url = "http://www.yourdomain.com/path_to_click_tracker/click-tracker.php";
var clicktracker_domains = Array("", "yourdomain.com", "www.yourdomain.com");
var clicktracker_extensions = Array("doc", "exe", "rar", "zip");
</script>

<script type="text/javascript" src="http://www.yourdomain.com/path_to_click_tracker/click-tracker.js"></script>

The script will track clicks on the links:
(a) to all domains other than those specified in clicktracker_domains variable;
(b) to all files with extensions specified in clicktracker_extensions variable.

This way you can track:
(a) external (outbound) links;
(b) download links.

7. Password-protect admin directory

Instructions are also available in a .txt file!


                   Download Script (click here)

Thanks for visiting my BLOG!


Leave Your Comments !

Recommended Post Slide Out For Blogger