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

AttachmentSize
googleanalytics_no_admin_pages.patch1.25 KB

#1

EvanDonovan - July 6, 2009 - 20:18
Status:active» needs review

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

hass - July 6, 2009 - 21:45
Status:needs review» won't fix

All "admin/*" pages are NOT tracked by default.

#3

EvanDonovan - July 9, 2009 - 20:27
Category:feature request» support request
Status:won't fix» active

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

hass - July 9, 2009 - 21:29
Status:active» fixed

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

EvanDonovan - July 9, 2009 - 21:34

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

hass - July 9, 2009 - 21:42

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

System Message - July 23, 2009 - 21:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.