Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I have a site which is developed by perl and javascript. Some how i would like to find out the pages visited by a visitor and his/her ip address. Is it possible to find out the visitor/unique visitor? Can any one please tell me to find out the web page statistics (ip address and visited page info ....) Thanks in advance.

Replies are listed 'Best First'.
•Re: web page statistics
by merlyn (Sage) on Mar 27, 2003 at 16:27 UTC
    Unique visitor counts are not possible. Ever. Any logging package that tells you they have it are lying.

    You cannot possibly know how many visitors are coming in from behind a corporate firewall, a home NAT'ed network, or AOL, because there's no 1-1 correlation between these users and their IP address, as the fake log analyzer people would have you believe. (It's actually even worse for AOL, because one user will appear to be coming from dozens of IP addresses at the same time.)

    So, get over it. You can't get that info. Stop asking. Your life will be simpler. {grin}

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Not even with cookies (provided the visitor allows cookies and does not delete them afterwards)? Of course the information would not be found in the acces-log, but would need to be gathered directly at the level of the web-pages.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

        If the page is cached at a corporate firewall (or AOL), the second hit (with the different cookie) never gets to you, so you can't tell you had "another" hit.

        Proxies and caches. They're not going away. In fact, they're being used in greater numbers. So "unique" hits is not possible even more-so now that before.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.

      Its just too bad the pointy-haired bosses of the world don't see it that way. (Going through this at work right now). Actually though I'm trying to get this stat package installed, it claims to detect the AOL proxy stuff and its written in Perl so it must be cool .. right? :)

      Chris

      Lobster Aliens Are attacking the world!
Re: web page statistics
by zby (Vicar) on Mar 27, 2003 at 15:56 UTC
    Just ask the administrator of the web serwer for the logs. And then analyze them with for example analog or webalizer.
Re: web page statistics
by Super Monkey (Beadle) on Mar 27, 2003 at 16:00 UTC
    Depending on what server you are running, you should be able to find this information in the server logs. For instance, if you are running Apache look in /web/logs/access_log.
      Super Monkey Thanks for your reply. Is it possible to find out the unique visitor using access_log file? Is this the only way to solve the problem? Thanks