PHP ClickTrack - MySql - PHP4 - Apache 1.3.x - Jerry Allen
History 0.9 1st public showing...

Please use the mailing list for any questions
or concerns about this utility. Private email
will most likely go unanswered...

If you would like to know if users are clicking through
your search engine, and what they are searching for
this may be for you...

It would be great to track both the querys
and the clicks... 
click.php3 does this, what I would like to see
is some additional intelligence in udm...
This is my goal,
"Track the clicks on urls, in the url record,
and be able to "weight" the urls based on clicks
along with content etc. during search."
 
This is a very simple start:

The enclosed code only tracks the 1st click search
specs, but updates the click hits on additional clicks
it could be modified to track every click seperately
but it would most likely over load a busy site.

As always your mileage may vary, there are no guarantees!
Backup your UDM setup completely before modifying anything.

You have been warned...

That being said,

Create the "clicks" table in your database using
mysql database_name < sql.txt
If you change the database name or table name,
verify you update this information in sql.txt and
in the click.php3 files BEFORE running the above.

In the <!--res--> section of your search template file,
change the line that reads:
<b>$DN.</b> <a href="$DU" TARGET="_blank"><b>$DT</b></a>[<b>$DR</b>]<DD> 

to:  (below has NO line wraps in it...1 line)

<b>$DN.</b> <a href="./click.php3?site=$DU&spec=$q" TARGET="_self">
<b>$DT</b></a> [<b>$DR</b>]<DD>

This will cause the search returned urls to be sent back to your search
server's click.php3, and logged in mysql and updated with an
additional "click" when they are hit again, and the user will be
redirected with a header to the target url. You will be able to tell
somewhat by the search spec and compairing with qtract just how "good"
the searches are, and how helpful they are to your users by KNOWING if
the user is clicking through the search engine.

The next "release" will attempt to include some click data in the returned
html, displaying the number of clicks that particular url has had and
possibly some modified "weight" specs in UDM config to put the highest hit
urls at the top of your search returns, or consider them to be "better".

Good Luck!

Jerry Allen
UNIX Systems Administration
Panhandle Networx (Among many others)
