• Home
  • About

szehau's weblog

Life, Internet, Software, Gadgets, Programming and Investments

  • life log
  • internet
  • programming
  • software
  • working holiday
  • gadget
  • project

Adsense Tracker

As I have promised to upload my adsense tracker script at previous post, My Adsense Tracker, finally I have finalized my codes and uploaded it here. At the time I have finished the coding and testing, I found AdsenseLogger. Em… but never mind, at least I have my own tracker.

Adsense Tracker – A tracking script that tracks adsense clicks on one’s website. Adsense tracker gives a general idea on what ad your visitor is looking for.

Adsense Tracker consists of 3 modules:

  1. Tracking scripts with multiple channels supported.
  2. A very simple login page.
  3. Report.
  4. Maintenance.

1. Tracking script with multiple channels supported:

  • Tracking adsense clicks (Ad Unit and Link Unit).
  • Support multiple channels for multiple pages/sites.
  • Track referrer’s and current page’s URL.

2. A very simple login page:

  • Since the script is for personal use only, it requires password only to login

3. Report:

  • Support different time zone by setting the time offset.
  • Group ad by Ad Unit (title only) or Link Unit (keyword only) and click count.
  • Show individual clicks.
  • Generate report based on date range.
  • Generate report based on channel.

4. Maintenance:

  • Purge old transactions to keep database small and for performance wise.
  • Channel maintenance (Add, Rename, Delete).

Requirement:

  • PHP and MySql database.
  • Basic knowledge of editing PHP script.
  • Basic knowledge of MySql’s database administration.

Installation:

  • Download and unzip to a temporary folder. It should only have the following files:
    install.php – Installation page
    login.php – Login page
    maintenance.php – Maintenance page
    report.php – Report page
    setting.php – Setting
    tracker.php – Tracking script
    tracker_js.php – Tracking script (JavaScript)
    style.css – Style sheet
  • Use text editor to open the file setting.php. Modify the parameter in the file as appropiate.
  • Upload all the files to your web’s directory so that you end up with /at/install.php.
  • Create an empty database and run the installation script, e.g. http://www.yoursite.com/at/install.php.
  • Login to Adsense Tracker at /at/login.php and create your own channel, e.g. ‘mainpage’.
  • At the PHP page where you want to track the adsense clicks, insert the following script at the bottom of your page (just before the </body> tag) –
    <?php include_once ('at/tracker_js.php'); ?>
    <?php gettracker_js('mainpage'); ?>
    * where ‘mainpage’ is the channel that you have created at previous step.

Download:

  • Adsense Tracker 1.0 – original

Note:

  • This script is intend for personal use only and not for commercial purposes. You can download, modify and use this script at your own risk.
  • Any comments are welcome.

About Sze Hau

Geek. Love programming. Coffee addicted. Married with a child. Working towards financial freedom.

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

More Posts

5 Essential Things You Need To Have At Your Home During The COVID-19 Pandemic

June 1, 2021 22:15 By Sze Hau

LED Downlight

Troubleshooting A Flickering LED Downlight

February 13, 2016 00:29 By Sze Hau

Repair A Broken iPhone Lightning Cable

January 30, 2016 00:54 By Sze Hau

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • Snippet IT Information technology news, ideas and experiences and opinions