Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web analytics script

Status
Not open for further replies.

electricphp

Programmer
Feb 20, 2008
71
US
I need a good web analytics script that does not use a third party server. Something that I could install on my site using javascript and ASP or simply ASP, but I do have an access database to use. Hotscripts.com has tons of web analytics scripts under both ASP and PHP. The problem is that they all seem to require the pages to be tracked to be in ASP (or PHP)
Most of the pages on my site are in html, and I don't want to change the structure of the site, just for the web tracking. If I could find a script that just inserts some javascript on each page and maybe collects that data and dumps it into my database that would be ideal.

The most important info in I need is # of hits, referrer url organized by # of hits, and timestamps
 
If I could find a script that just inserts some javascript on each page and maybe collects that data and dumps it into my database that would be ideal.

You're going to need some form of ASP or PHP to perform this task. How else are you going to insert the data into your database? Connect to it via javascript where anybody could view your connection string?

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

Finally, <. is a good thing!
 
yes you will need php or asp to process the data and enter it in the database, but not to track the actual hits.

What I want is a solution like statcounter:

Code:
<script type="text/javascript" language="javascript">
var sc_project=9999999; 
var sc_partition=1; 
var sc_invisible=1; 
</script>

<script type="text/javascript" language="javascript" src="[URL unfurl="true"]http://www.statcounter.com/counter/counter.js"></script>[/URL]

<noscript><a href="[URL unfurl="true"]http://www.statcounter.com/"[/URL] target="_blank"><img  src="[URL unfurl="true"]http://c2.statcounter.com/counter.php?sc_project=9999999&amp;java=0&amp;invisible=1"[/URL] alt="javascript hit counter" border="0" /></a> </noscript>

You add this snippet of code to every page and then their server keeps track of everything. I want to do the same but on my server.
 
<img src="[!]counter.php?sc_project=9999999&amp;java=0&amp;invisible=1"[/!] alt="javascript hit counter" border="0" />

From the looks of what you've posted, I believe the magic happens in the part I highlighted. Unfortunately that's the page that you need on your server and you have no way of getting it from them.

Either way, this really should be asked in a php or asp forum as the guts of the solution are not javascript related.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

Finally, <. is a good thing!
 
I know that you stated you wish this to run on your own server but may I ask why? You seem to want to reinvent the wheel.

You could use Google Analytics to do what you wish, else you could simply get hold of a program that will read your site's logfiles and produce reports. There are a number of free options out there.

You could, if using Apache (I know it better than IIS), just have it parse all html pages as PHP and then have a snippet of code included which would call the script that does the logging. Again, though, you are replicating something the server is already doing (i.e. keeping log files). Either way, you will need the pages to fire off some kind of script using a server side language such as ASP or PHP - even if that is done via Javascript, as GA and Statcounter do.

If the goal is to provide 'live', relatively easy to understand statistics then I can think of no better options than Google Analytics or StatCounter.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
kaht, you're probably right, I should be asking this in this in the asp forum.

The reason why I don't want to use google analytics is very simple. Google is gobbling up the Internet. I would rather keep the stats private. Statcounter charges for anything over 100 log entries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top