sonesay
Jun 25 2008, 01:27 AM
| | On my site I have built a basic counter for tracking how many visits I get. Unfortunately I'm not sure how to go about distinguishing bots from legit visitors so I end up counting every visit including bots. This does not give an accurate count of visits to my site. How I went about doing it was just basically having a session variable set flag once a user visited the site. Its very basic and If that session flag is not set then just insert their IP into the database table which is then counted for the total of visits. I probably should of looked at already made scripts for this since the problem is most likely solved but I want to ask if anyone has any information on this ready. |
Reply
rvalkass
Jun 25 2008, 07:21 AM
You have two choices. The first one is to look at the user-agent being used by the browser. Googlebot's is "Googlebot", and the other search engines use a similar sort of thing. Use the help pages on each search engine's site to find out the user-agent used by their bot, then just don't count their hits (or mark them in the database as bots). However, bear in mind that people can change their user-agent to whatever they want, so this method will not be 100% reliable (although I can't see why someone would set their user-agent to a search bot...) The second choice is to use DNS lookups. Use the IP address of the visitor, do a reverse DNS lookup to get the host name. If it is a search engine's domain then it is likely to be a search bot. Google has more instructions here: http://www.google.com/support/webmasters/b...mp;answer=80553
Reply
minimcmonkey
Jun 25 2008, 05:11 PM
I really dont think its worth spending time worrying about that. Infact, most websites count bots as hits. It would be hard to remove ALL hits from bots, so you could just leave it.
Reply
optiplex
Jun 27 2008, 02:56 PM
Oh, thats gonna be hard. You can check the clients user-agent, and let a background script scan his ip for common proxy ports, such as 8080. Maybe you could check the refferer? Or, if you want the client to fill in a form use a JAVA form, that would be much harder for a bot to response. Anyway, I dont think you determine if a client is 100% human. - optiplex (tell me if you found the solution okay?  )
Reply
sonesay
Jun 28 2008, 06:19 AM
Thanks for the information. I been reading some articles on this and there seems to be no clear cut way for doing it and there are a number of methods. I just went with a few checks its not 100% but its good enough for now. 1. check if user agent is a google bot or any other known bot. 2. check if ip is already flagged to be ignored 3. insert into db the hardest part was thinking it through the code was not awfully too long.
Reply
Recent Queries:--
php determine search bot - 3.43 hr back. (1)
-
how to determine a bot - 32.17 hr back. (1)
-
php track visits of bots - 81.03 hr back. (1)
-
php bot check - 84.36 hr back. (1)
-
php javascript visitor tracking bots - 110.18 hr back. (1)
-
get dns of visitor with php - 131.75 hr back. (1)
-
how many unique visitors bots - 139.00 hr back. (1)
-
code to check user is real and not bot - 151.45 hr back. (1)
-
determine if google bot is on my site - 172.62 hr back. (1)
-
how to tell if an ip is a bot - 189.98 hr back. (2)
-
bot visitor - 194.68 hr back. (1)
-
php get visitor dns - 196.32 hr back. (2)
-
php determine bot client - 201.88 hr back. (1)
-
php determine google bot - 224.64 hr back. (1)
Similar Topics
Keywords : determine, visitor, legit, bot, ideas, determine
- Php::while Problem
any ideas? (6)
Learning Php methods
good books/ideas out there? (9) I'm looking to start learning some PHP this summer, I've got a good grip on HTML, given that
I never read a book on it, and my friend taught me. I'm good in logic and math, and taught
myself CSS, I only know a tad of javascript, but now I'm getting ready to go to the real stuff.
HTML and CSS don't allow me to do enough, I want to learn PHP, but I'm not sure I can teach
myself off of help sites anymore, this seems a bit complicated. One of my friends is learning PHP,
too, so it will be an advantage to bounce ideas off each other. Anyway, I'm w....
Looking for determine, visitor, legit, bot, ideas, determine
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for determine, visitor, legit, bot, ideas, determine
*MORE FROM TRAP17.COM*
|
advertisement
|
|