Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 .
Comment | File | Size | Author |
---|---|---|---|
#1 | statistics-extended-2.patch | 6.69 KB | SiliconMind |
statistics-extended.patch | 6.55 KB | SiliconMind | |
Comments
Comment #1
SiliconMind CreditAttribution: SiliconMind commentedI'm sorry, i've just noticed that i had attached a wrong patch file :/
here is correct one.
Comment #2
samirnassar CreditAttribution: samirnassar commentedSince this has new features it won't go into Drupal until Drupal 7. Reroll against HEAD please.
Comment #3
gpk CreditAttribution: gpk commentedRelated: http://drupal.org/node/18013.
[update - the URL alias is now working for the Statistics Filtering project. http://drupal.org/project/statistics_filter ]
Comment #4
gpk CreditAttribution: gpk commentedResetting version.
Comment #5
spiffyd CreditAttribution: spiffyd commentedI 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
Comment #6
gpk CreditAttribution: gpk commentedThe patch is trying to amend a file called "6.x/statistics/statistics.admin.inc". Maybe edit the patch to remove the leading 6.x/
Comment #7
spiffyd CreditAttribution: spiffyd commented@gpk
Thanks! Your suggestions worked. However, I should note that the patch should be placed in the modules directory and not anywhere else.
Comment #8
gpk CreditAttribution: gpk commentedYes, 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.
Comment #9
spiffyd CreditAttribution: spiffyd commentedAs basic as it seems, this patch NEEDS to be in CORE. It's a must...
Comment #10
SiliconMind CreditAttribution: SiliconMind commentedsorry 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.
Comment #11
millions CreditAttribution: millions commentedIs it possible to use this patch for drupal 5.x?
Comment #12
gpk CreditAttribution: gpk commentedNot 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.
Comment #13
spiffyd CreditAttribution: spiffyd commented#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...
Comment #14
Dave ReidHas 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.
Comment #15
spiffyd CreditAttribution: spiffyd commentedDave,
What's the difference between the Statistics Advanced Settings module and this patch? Is the module compatible with Page Caching in 6.x?
Comment #16
Dave ReidCheck 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.
Comment #17
kattekrab CreditAttribution: kattekrab commentedIs this a dupe of #696: Add filter to logs and referrer lists ?
Comment #18
SiliconMind CreditAttribution: SiliconMind commentedBasically 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 :(