Hello,
It would be great to have a setting for logged-in users, where the Google Analytics code snippet would NOT be included in the page.
This way, I could nicely ensure that my own frequent visits to my site don’t affect the statistics.
It would take one more setting:
Don’t output the Google Analytics code snippet for this role and higher:
Dropdown: Send Analytics code for everyone – Admin – Editor – Author – Contributor
Then, depending on the setting, during output, the Google Analytics code snippet will be sent after testing:
current_user_can
activate_plugins (admin)
moderate_comments (editor)
publish_posts (author)
edit_posts (contributor)
Next to the setting, a small warning might be needed:
Filtering is based on the following WordPress capabilities:
(since the set of capabilities of a role may be customized on some sites…)