User Agent Library Question |
[eluser]tinawina[/eluser]
I have a click-tracking scenario in place that is getting clobbered by robots. I have a robots.txt file in place and that is helping somewhat. I am wondering about how best to deploy the User Agent class. If I wanted to ensure that robots -- good or bad ones -- do not access a part of my site, would the following code do the trick? Code: if ( ($this->agent->is_browser() === true) || ($this->agent->is_mobile() === true) ) I know that there is a check specifically for robots ($this->agent->is_robot()), but the list of robots in the config for user agents is short, and robots are cropping up all of the time. I'm wondering if this would be more of a catch-all. Thanks for any help/insight!
[eluser]tinawina[/eluser]
Ok - I've been doing a lot of reading up about robots today.... Here's where I've landed. We want to prevent up-ticking a page-view count by one when a robot visits the page. We do want good robots (eg., google) to index the page, however. I put this code in place in my page-display controller a little earlier today and am feeling better about things. My approach is to check for a definite robot (definite meaning it is saved to my /config/user_agents file already) or a potential robot that I need to investigate and save to my config file if appropriate. I sure would appreciate a heads-up from anyone out there who sees a problem or potential "yikes!" with this approach: Code: $this->load->library('user_agent'); I updated our /config/user_agents file so that it now includes the following robots (will be updating this as needed from here on out): Code: 'askjeeves' => 'AskJeeves', Does this look like I've got it all handled? Thanks for any help! |
Welcome Guest, Not a member yet? Register Sign In |