This is simple patch that allows users to exclude certain traffic from statistics. It allows you to:

  • Exclude system administrator (UID1)
  • Exclude site administrators
  • Exclude traffic that originates from the same IP as the site itself
  • Exclude users
  • Exclude IP addresses
  • Exclude user agents

These extended statistics settings are extremely useful for small sites or sites that are just starting up. They allow you to exclude from statistics all the traffic generated by site administrators or by search engines. All you need to do is visit admin/reports/settings page and setup all new features. UID1 and users with administer site configuration permission are excluded by default .

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SiliconMind’s picture

FileSize
6.69 KB

I'm sorry, i've just noticed that i had attached a wrong patch file :/
here is correct one.

samirnassar’s picture

Version: 6.2 » 7.x-dev

Since this has new features it won't go into Drupal until Drupal 7. Reroll against HEAD please.

gpk’s picture

Version: 7.x-dev » 6.2
Status: Needs work » Needs review

Related: http://drupal.org/node/18013.

[update - the URL alias is now working for the Statistics Filtering project. http://drupal.org/project/statistics_filter ]

gpk’s picture

Resetting version.

spiffyd’s picture

Version: 7.x-dev » 6.x-dev
Priority: Normal » Critical

I am using 6.3. I ran your patch (statistics-extended-2.patch) and it doesn't work. Suggestions?

Here's the result:

can't find file to patch at input line 4
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |diff -urp statistics/statistics.admin.inc 6.x/statistics/statistics.admin.inc
> |--- statistics/statistics.admin.inc 2008-01-08 10:35:42.000000000 +0100
> |+++ 6.x/statistics

gpk’s picture

Version: 6.x-dev » 7.x-dev
Priority: Critical » Normal

The patch is trying to amend a file called "6.x/statistics/statistics.admin.inc". Maybe edit the patch to remove the leading 6.x/

spiffyd’s picture

Status: Needs review » Closed (fixed)

@gpk

Thanks! Your suggestions worked. However, I should note that the patch should be placed in the modules directory and not anywhere else.

gpk’s picture

Status: Closed (fixed) » Needs work

Yes, the patch is not in the right format to be applied from the main Drupal folder, i.e. it's not how it should be.

Re-opening the issue since although your problem is fixed, this feature is not in core yet nor has been rejected by the community.

spiffyd’s picture

As basic as it seems, this patch NEEDS to be in CORE. It's a must...

SiliconMind’s picture

sorry for malformed patch file - patching drupal is not the thing i do on daily basis ;)

anyway, i'm quite overrun with a lot of work now - can someone please reroll this patch for D7? It seems like this might come in handy for some users. unfortunately i won't be able to install D7 and create new patch for some time :(
if someone needs a bit of motivation: i've been using this patch on my D6 for some time now. it performs very well as long as you keep your filters up to date (mainly user agent filter). using it makes statistics Just Work™ for small sites with low number of visitors.

millions’s picture

Is it possible to use this patch for drupal 5.x?

gpk’s picture

Version: 6.2 » 7.x-dev
Status: Needs review » Needs work

Not sure if the patch will work on 5.x, even after accounting for #6.

But #3 http://drupal.org/node/255769#comment-837557 may provide a way forward.

spiffyd’s picture

Version: 7.x-dev » 6.x-dev
Category: feature » bug
Priority: Normal » Critical

#1's patch works wonders but it generates an error as described here: http://drupal.org/node/362012

In short, it's not compatible with NORMAL page caching. Someone should look into this...

Dave Reid’s picture

Version: 6.x-dev » 7.x-dev
Category: bug » feature
Priority: Critical » Normal

Has anyone here seen the Statistics Advanced Settings module? BTW, this is not a bug report, it's a feature request. New features can only be accepted for 7.x, so please don't change the version.

spiffyd’s picture

Dave,

What's the difference between the Statistics Advanced Settings module and this patch? Is the module compatible with Page Caching in 6.x?

Dave Reid’s picture

Check out the features on the project page. If there's not a feature you want for 6.x, file a feature request and I'll take a look at it. And yes, it's compatible with normal page caching.

kattekrab’s picture

SiliconMind’s picture

Is this a dupe of #696: Add filter to logs and referrer lists

Basically it's the same issue. Only that #696: Add filter to logs and referrer lists is just a discussion on what to do instead of providing real solution ;) Right now I'm playing with D7 and will probably provide appropriate patch for it. Unfortunately I don't think it will be included with the official drupal release :(