-----Original Message----- From: rene7705 [mailto:rene7705@xxxxxxxxx] Sent: Monday, May 07, 2012 3:00 AM To: php-general Subject: I need a good access and error log.. Hi. I've been using Google Analytics, and I'm sure I'm using the analytics code correctly, but when I checked my dev server's apache access logs (dozens of hits per day) against what Google Analytics reports (zip, zero, nada), I realized I needed something different. BTW, I'm not the only one to report this problem (https://www.google.nl/search?aq=f&sourceid=chrome&ie=UTF-8&q=google+analyti cs+lower+number) I thought of rolling something of my own, a PHP-MySQL based access+error log, add a viewer for it (http://dygraphs.com/ perhaps), and spend the next month perfecting it.. But before I start coding, I thought it would be better to ask you all what you use to see who's visiting your sites and when. Oh, I need something that will work on shared hosting (php+mysql). Thanks for your input. (and purists; I couldn't think of a better place to post this, as this is a large community of web developers who use the same language as I do. I may even end up writing an opensourced php logging facility for you) -- I have seen and dealt with this for a few companies. I have setup PHP scripting, JavaScript, Perl scripting you name it I have tried it. I have NEVER came up with the same number Google Analytics comes up with. Sporadic behavior from Analytics not tied to a unique browser, OS or time. Almost like random addition values are just added to the total for no reason. I like Google, but the numbers are not real! When I can track each and every visit, site navigation and the numbers do not match. I asked Google for click by click information IP, Time and any other information they could give me. I never got that list to this day. Probably because it would allow me to argue traffic that simply didn?t happen! Suggestions when logging traffic, Avoid JavaScript that relies on the client side to tell you information. Bad Idea!!!!! Use php, perl or any server side language. When logging information remember that apache/.NET process web request and generally the best place to log. It you log at the process you do not need to have scripting in each landing page. Log light information, never request overwhelming amounts of information for each request you may cause horrid loading results. PHP example (Just a simple example, there are many ways to do it) Index.php <?php $query = "INSERT INTO click_log (`ip`,`action_time`) VALUES ('".$_SERVER['REMOTE_ADDR']."','".date("y-m-d H:i:s")."') "; $result = mysql_query($query); ?> I HIGHLY recommend you have a full understand of httaccess or web.config before you attempt logging from them. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php