The "special variables" are going to be pretty dependant upon the specific end result you're actaully to acheive. As such, it's pretty hard to say which one's you'll definitely need or not need. I've got a useage tracker/hit counter class posted up on my site which you might find useful as a starting point. It stores hit totals per day and per month, tracks return visits, internal site navigation (optionally, no display for those coded yet), referring address links, search engine referals and the queries used. Stats can be displayed in bar graph (requires GD module) or raw html table formats. Full API docs (JavaDoc format) for both the useage tracking and included database abstraction layer classes are include in the download. The address is:
http://www.mithril.ca/code/php/lib_useage_track.php
HTH.
geoff