|Description||Ever wondered if people are clicking on links in your pages to goto other web sites ? and how many ? and where they're "calling" from? Well that is what this script does, you can select specific urls on your page to be redirected to this script which keeps track of the date, time, and what domain the user was logged on from that clicked them. This script will also work with the random image displayer script so that you can keep a tab of how many people are actually going to your sponsors from your site. A recent update will also keep a numeric count of hits too.|
|How it works||
There are at least 3 files needed in order for the script to operate ..
To call this script, first select the links that you want to have tracked. example :
<A HREF="http://www.searchsd.com">Click here</A>
will now become ....
<A HREF="http://technotrade.com/redirect.cgi? http://www.searchsd.com">Click here</A>
(replace technotrade.com with your domain and location of the script)
What we did here is call the redirect.cgi script and send it the URL where we want to go. The data files have to already exist on your server and be chmod'd to 666. The script will then append a line to the end of the first file, containing the date, time and domain & URL of the user that called the script. The second file will be updated by incrementing the count for each URL passed to it. In our case, the data files are called hits.txt and counts.txt. You can change the names of these files by modifying the source cgi script. After the data files are updated, the script then takes then takes the user to the selected URL.
Note for first time installation, we initialized the "hits.txt" file by just hitting enter or typing in a line that says "Domains .. DATE/Time .. etc." As for the "counts.txt" file , we initialize it by putting in "URL,HITS" on the first line (the comma here is important).
Now let's try a sample .... On the left are three URLs that are redirected via the redirect.cgi script. Click on any of the links as many times as you want and hit [BACK] on your browser to come back to this page. When finished, take a look at the "hits.txt" file that was used by clicking the link to it on the right. You'll see the links that you visited at the very bottom of the file. Note: you may need to hit reload on your browser or clear your cache to see changes in the hits.txt file. You can also look at the "counts.txt" file which will contain the URLs followed by the number of times they were visited.I've temporarily disabled updating hits.txt on the version on my server (file was getting too big).