Drupal 7: Do not count visits of bots or spammers

If you use the statistics module (in core in Drupal 7) to show how many times an article was read, there are two problems with that number

  1. also bots and spammers are count
  2. if you reload the page (e.g. with F5) the number is incremented

SOLUTION TO 1.

Browse to 

MYWEBISTE.com/admin/config/system/statistics

and check

"

Then only users who have javascript enabled are counted. Bots most of the time are not jusing a browser, hence have no javascript and will not be counted.

 

SO FAR NO EASY SOLUTION TO 2.

this seems to be a major issue in Drupal 7, see  this Drupal post. One easy solution might be to not use the statistics module, but rely on the google analytics module.

blog_tags: 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <img> <br> <p> <span>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Code snippets in <code>...</code> or <source>...</source> automatically will be pretty printed.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Target Image