M.O.S. Studios Posted February 20, 2010 Share Posted February 20, 2010 I have a counter that counts hits on my: home page, each product & my check out. after reviewing I realize that I have a of hits just on my homepage. it might just be because no want goes past that section OR because of web crawlers and bots. anyone know how to check for that??? here is my code if it helps. <?php SESSION_START(); if(!$_GET){$pages = 'index';} elseif($_GET['page']=='store' && isset($_GET['prod'])){$pages = $_GET['prod'];} elseif($_GET['page']=='checkout'){$pages = 'checkout';} if(is_null($_SESSION['count'][$pages]) && is_null($_SESSION['testing']) && isset($pages)){ include("admin/common/link.php"); $query = "INSERT INTO `count` (`ip`, `page`, `date`) VALUES ('".$_SERVER['REMOTE_ADDR']."', '".$pages."', '".mktime()."')"; mysql_query($query); $_SESSION['count'][$pages]=1; mysql_close($link); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/192719-counter-weed-out-bots/ Share on other sites More sharing options...
teamatomic Posted February 20, 2010 Share Posted February 20, 2010 The first place to start is your access log. If it does not already, alter the conf file for your server to include the user-agent. If you are not able to alter the conf file or through your admin panel able to set your manner of logging then you will have to do it yourself. That is where to start to ID a bot, also make sure your site has a robots.txt file to guide bots for what folders to traverse. While you may not think you need one any well behaved bot will leave your site if they cant find a robots.txt file. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/192719-counter-weed-out-bots/#findComment-1015225 Share on other sites More sharing options...
ignace Posted February 21, 2010 Share Posted February 21, 2010 Instead of keeping track of hits manually use Google Analytics instead it provides you with much more information and allows you to set-up funnels and goals http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55580 Quote Link to comment https://forums.phpfreaks.com/topic/192719-counter-weed-out-bots/#findComment-1015764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.