Exclude Analytics tracking from /admin pages
EvanDonovan - July 6, 2009 - 20:17
| Project: | Google Analytics |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I have noticed that sometimes on large /admin pages, such as the /admin/build/modules page, the whole page will appear to be loaded, but the browser will be frozen and a message will say "Waiting for google_analytics.js". As a result of this, I have decided it would be beneficial to exclude the Analytics code from showing up on admin pages. After all, you don't really need to know usage stats on those, anyway.
Attached is a patch.
| Attachment | Size |
|---|---|
| googleanalytics_no_admin_pages.patch | 1.25 KB |

#1
Setting to "needs review". Also, I thought I should say that this might be related to #336924: Massive page rendering slowdown with many links, but I just now saw that issue & haven't had a chance to test the patch for it yet.
#2
All "admin/*" pages are NOT tracked by default.
#3
Ah, now I see there was a collapsed fieldset for excluding paths.
Has this always been the case though? My exclude path fieldset was empty. I've upgraded the Google Analytics module many times, all the way back from 5.x somewhere and I'm not sure if the excluded paths were in back then. Perhaps they were never set in an update.
Also, I noticed there was a syntax error in my patch - it should be:
if (!empty($id) && _googleanalytics_visibility_pages() && _googleanalytics_visibility_user($user) && arg(0) != 'admin') {in the hook_init implementation.
#4
This path configuration has been implemented in 5.x-1.5. See http://drupal.org/node/262362.
I'm not aware about any missing upgrade path. If you have ran update.php all settings need to be pre-configured properly. Nothing to do by hand. If there is something cluttered now, disable the module, uninstall it and install it again and it's configured like brand new...
Your code change will never go in, so please revert back to the original version.
Make sure you are not running Apache's mod_security with a buggy config... this could be a reason why the install is now cluttered.
#5
Ok, thanks. I reverted my change. I think that we must have just removed that path from the configuration settings without knowing what we were doing. Sorry...
#6
Now you know the reason why this fieldset set collapsed by default :-). You should also be aware about http://drupal.org/node/442846#comment-1511760.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.