GetDotted Domains

Viewing Thread:
"Help with a Hit Counter"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Wed 15/05/02 at 14:39
Regular
Posts: 787
I'm trying to build a really advanced hit counter/web traffic analyzer. So far, it tells me lots of stuff like cookie/java/javascript support, browser, os, country of origin etc etc.

I'm trying to add a function so that it will tell me how long a user has spent on the page, but I can't work out how to do it.

The problem is that the hit counter is designed to work on a single page, thus information can't be gathered on other pages of the site. Also, it needs to give me the information even if they leave the site altogether.

After reading through lots of articles and manuals online, I know it has something to do with Session Variables and Cookies (i think!), but I dont know how to use them, or if Freeola servers support this feature!!

Please help me if u can!
Wed 15/05/02 at 14:39
Posts: 0
I'm trying to build a really advanced hit counter/web traffic analyzer. So far, it tells me lots of stuff like cookie/java/javascript support, browser, os, country of origin etc etc.

I'm trying to add a function so that it will tell me how long a user has spent on the page, but I can't work out how to do it.

The problem is that the hit counter is designed to work on a single page, thus information can't be gathered on other pages of the site. Also, it needs to give me the information even if they leave the site altogether.

After reading through lots of articles and manuals online, I know it has something to do with Session Variables and Cookies (i think!), but I dont know how to use them, or if Freeola servers support this feature!!

Please help me if u can!
Wed 15/05/02 at 17:03
"Darkness, always"
Posts: 9,603
Save yourself time and hassle, and use someone else's work:

http://support.zeus.com/products/v3/webalizer.html

usage statistics per page, per session per anything you please.

IB
Thu 16/05/02 at 17:01
Posts: 0
Thing is though, I'm trying to build my own, coz then i can customise it as much as I want - add new features, delete others, improve etc etc. Anyone have any ideas how to do the visit duration thing?

Turbonutter, I saw on your site you have used a session ID in one of URLs - is that sort of what I need to do???? Please help...
Fri 17/05/02 at 18:53
Regular
"IT'S ALIVE!!"
Posts: 4,741
If you find one thats already been made then you can cut it out/re-write it and use it in your script, then you'll know it works and have the knowldge.
Fri 17/05/02 at 19:23
Posts: 0
The problem is that most of the hit counters out there use server-side scripting, as does mine. This means that if I find a site that uses a hit counter like this, I can't get the script as it has already been processed.

Does anyone here know CGI and PHP quite well, because I am writing mine in PHP as I know quite a lot, but I have found a CGI script that will tell me what I need to know? Anyone?
Fri 17/05/02 at 19:39
Regular
"whoneedsatagline?"
Posts: 194
OK, if you want to know how long a user has spent on a page, then you're going to need sessions. When one script generates the page, then it should store the date and time in a session variable. The next script to be invoked will be able to work out the difference.

But why would you want to do that? How meaningful is that information? If I visit a page and leave it showing while I make a cup of coffee, then is that useful to you? And as far as I know, there's no way of handling the situation where someone just closes the browser on that page - your server side script will never get the chance to look at what's going on.

Maybe I've not understood your aim, but on the face of it, you're looking for info that isnt reliable or meaningful ...
Fri 17/05/02 at 20:45
Posts: 0
My aim is that once I have got an array of visit durations, I can make an estimate of how long people will spend on the page, and if the actual time is significantly more than this, it will be exluded as anomalous. The remaining times will then be averaged to get an idea of how long people will spend on the page. Script can also be added to rule out people refreshing after 1 second etc. Basically, I will be able to use the data to say for example:

They spent on average 46 seconds on my page. There are 200 words on the page, so they have probably read all of it. If they are not visiting other pages, then I need to improve the text.
Sat 18/05/02 at 15:45
Posts: 0
I'm not sure to what degree this could be considered an invasion of privacy.. but ignoring that aspect, what you're looking for could probably be better implemented in Javascript.. pass the amount of time between onLoad(); of the page and onClick(); of a link.. (the implementation of this could get messy though..)

I dislike session IDs, they usually make it impossible to bookmark anything. Which is bad.
Sat 18/05/02 at 15:46
Posts: 0
Let's finish my first paragraph now..

.. as a variable to the end of a url. Like http://url/default.php?section=foo×pent=19

Maybe.
Sat 18/05/02 at 19:23
Posts: 0
The problem with that is that it only works if they click on a link. If they just type in an address or go to a bookmarked page, then I don't get my data... :(

I was thinking it may be possible to use a combination of PHP and JavaScript (e.g. etc etc).

Does anyone here know CGI well?? If I sent you a CGI Script, could you find the relevant section, and sort of explain how they've done it in CGI, coz then I could put it into PHP. I have a script that does this in CGI, but I don't know CGI at all - some of it is quite complex, so I can't try guessing based on similarities with PHP...

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Top-notch internet service
Excellent internet service and customer service. Top-notch in replying to my comments.
Duncan
Just a quick note to say thanks for a very good service ... in fact excellent service..
I am very happy with your customer service and speed and quality of my broadband connection .. keep up the good work . and a good new year to all of you at freeola.
Matthew Bradley

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.