I am trying to track hits to classic asp pages which are used as include files within other asp pages. I am using LogLog as my web analytic tool since I wanted something simple and which runs behind the firewall. What I observed was that LogLog does not track the included files. It will only track the main asp page where I have all the included files. (Note: I have added script to all my .asp files) We want this info so that we can get rid of all unused asp pages in our website which have been lying around for years without anyone using them.
Asked
Active
Viewed 344 times
0
-
the include file directive is server side, the browser is NOT aware of the include, so if you want to track each individual file you'll need to 'add' that to you browser detection system... – Paul Jul 12 '12 at 20:13
2 Answers
1
Using Google Analytics, you track exactly what you want, including specific events or ajax loadings.
You decide when you want to add a hit to the category of your choice, so you can easily add a hit when you load an included page.

Denys Séguret
- 372,613
- 87
- 782
- 758
-
I cant use Google analytics since we want some analytics tool which doesn't send usage usage data to an external server (outside our firewall). Thank you. – Abhi Jul 13 '12 at 17:58
1
If you want to get rid of unused pages you could try this solution:
add to every asp the following code:
application.lock
aspname = "ASPTRACKER-" + "a.asp" ' Or "b.asp" etc...
if (clng(application(aspname)) = 0) then
application(aspname) = 1
else
application(aspname) = application(aspname) + 1
endif
application.unlock
in your global.asa make sure that the application on end event writes all these application values (starting with ASPTRACKER-) to file.... voila the usage counter of each file
code not tested so there may be a typo...

Paul
- 1,068
- 11
- 29
-
I have a.asp included in b.asp. I put in both a.asp and b.asp the following line of code for testing. Response.Write(Request.ServerVariables("SCRIPT_NAME")). But the result was that it printed b.asp twice. What I expected from your code example was that I would see a.asp and b.asp printed. Sorry if I am missing something. I am a newbie to classic asp. – Abhi Jul 13 '12 at 19:06
-
Haha, and I'm a fool... my mistake. Of-course it print outs b.asp twice... I was wrong, I will look up the variable to actually deliver the filename... should be somewhere in a debug file... hang on... – Paul Jul 13 '12 at 19:18
-
If I changed the code. By my knowledge the true filename (not the file which includes them all) is only available in case of an error. Which is not the case here... so you must include the actual filename yourself.... sorry about that. – Paul Jul 13 '12 at 19:26