I don't think #2 is possible with PHP, although it might be possible with some other kind of server technology, possibly in apache? You can track what files are being used easily enough, but I don't know how'd you set up specific traking of just one.
#1 is only possible if you put a script on each page in your site to be triggered by the variable passed in the URL (easy enough to add if you already use PHP includes).
You could write it to a file, but if you have access to a db like MySQL, you are better off (IMHO). Anyway, the idea is something like this:
if( isset($my_var) )
{
add_to_log();
}
Adding that to your pages looks for the var you are passing, and runs the add_to_log function you will have to create.
Then, on your page of included functions (or just on that same page if you don't use any functions) you'd have something like:
function add_to_log()
{
//define function here
}
I don't have time to go into the nitty-gritty about fread, fwrite, etc. but you can check them out in the function list on PHP.net. Maybe someone else will finish this off.
Just make sure that the function is included, or defined before you check to see if the var exists.