|
Posted by Johnny on 10/13/06 20:47
"Kentor" <kentor@gmail.com> wrote in message
news:1160750141.189599.130460@f16g2000cwb.googlegroups.com...
> Hello,
> I'm just trying to figure out the best way of keeping a page count for
> each listing on my website...
> I'd like to show how many page views each page has for a the present
> day/week/month and since listed... and also keep a list of how many
> times it has appeard in the results in total.. but maybe was not viewed
> by the user... not sure how this can be done by using the minimul
> amount of requests from db and the min amount of date checking and so
> on... im also not sure whether i should store ips to check for
> duplicate views or not... i guess not but... i just want some feedback
> and some help if possible
> thanks
>
It isn't hard to do
something along the lines of at say somewhere on your page(s)
<?php
$page_name = "the_name_of_the_page";
include ("the_code_that_saves_the_stats.php");
?>
and in the_code_that_saves_the_stats.php
save the ip, referrer, browser, whatever, etc. and the $page_name to your
stats table in your db.
Then you need to write some scripts to get the data back out and display
it....that's the part that does the day/week/month and since listed...
then when you have a few hits built up, several thousand, you'll find out
about querying and displaying only bite-size chunks so that your display
comes back before hell freezes over.
You'll have such fun and it is very rewarding.
when all php attempts fail or you just can't wait, you could break down and
use google analytics.
Myself I use both, quite different views
Navigation:
[Reply to this message]
|