First time here? Check out the FAQ!
3

Disable Google Analytics for administrators.
 

I've been trying to think of a way to disable administrators from being tracked by Google Analytics. I don't want my analytics data tainted with my daily visits to check up on things, especially since traffic to my site is so low right now.

There are a number of solutions out there for excluding oneself on the Google Analytics side, but they all require some rather fragile workarounds (excluding a specific IP address, setting a cookie, etc.).

But then I realized that this problem could be solved much more reliably on the Askbot side: Simply do not display the Google Analytics Javascript for the administrator.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
todofixthis's avatar
1.3k
todofixthis
asked 12 years ago, updated 12 years ago

Comments

1

Ok, will do the the next version. It's quite simple actually.

Evgeny's avatar Evgeny (12 years ago)
see more comments

2 Answers

1

How about just using google opt-out browser plugin from Google? https://tools.google.com/dlpage/gaoptout

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
apg's avatar
167
apg
answered 11 years ago
link

Comments

see more comments
0

You can right now delete the google site verification key to disable the tracking.

We also can add the "enable/disable" switch too.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago
link

Comments

This would work globally, but I prefer to disable it only for specific users (in this case, just me). In other words, Google Analytics should not be keeping track of my activities on the site, but it should be tracking everyone else.

todofixthis's avatar todofixthis (12 years ago)
1

Ah, I see what you mean now, it is a very good idea. I am thinking of just automatically disable tracking for the admin accounts, what do you think? Would you ever want to track the administrators visits? Still, your anonymous visits will be counted - can't preclude that.

Evgeny's avatar Evgeny (12 years ago)

That sounds plenty sufficient to me (I can't think of a case where you'd want to disable GA for a non-admin user anyway). It might be good if there were an option to enable/disable tracking of admin activity; once the site reaches critical mass, admins will likely (hopefully) spend just as much time participating in the community as they do moderating; at that point it might actually be more useful to include admin activity in GA.

todofixthis's avatar todofixthis (12 years ago)
see more comments