Add to Google

Determine If Visitor Is Legit Or A Bot - Need ideas on how to determine this

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Determine If Visitor Is Legit Or A Bot - Need ideas on how to determine this

sonesay
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
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
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
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?biggrin.gif)

Reply

sonesay
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



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. php determine search bot - 3.43 hr back. (1)
  2. how to determine a bot - 32.17 hr back. (1)
  3. php track visits of bots - 81.03 hr back. (1)
  4. php bot check - 84.36 hr back. (1)
  5. php javascript visitor tracking bots - 110.18 hr back. (1)
  6. get dns of visitor with php - 131.75 hr back. (1)
  7. how many unique visitors bots - 139.00 hr back. (1)
  8. code to check user is real and not bot - 151.45 hr back. (1)
  9. determine if google bot is on my site - 172.62 hr back. (1)
  10. how to tell if an ip is a bot - 189.98 hr back. (2)
  11. bot visitor - 194.68 hr back. (1)
  12. php get visitor dns - 196.32 hr back. (2)
  13. php determine bot client - 201.88 hr back. (1)
  14. php determine google bot - 224.64 hr back. (1)
Similar Topics

Keywords : determine, visitor, legit, bot, ideas, determine

  1. Php::while Problem
    any ideas? (6)
  2. 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....

    1. 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



Determine If Visitor Is Legit Or A Bot - Need ideas on how to determine this



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE