• Resolved scormeny

    (@scormeny)


    I have the Google Analytics code on my site, with the appropriate code in the footer. There are two of us as authors on the site, and the site is new and small, so I am trying to figure out if there’s a way to set things up so that in the footer I can have code that makes it so:

    “If this person is not logged in as an author, include the google analytics code; otherwise, do not include the google analytics code.”

    That way, when the authors of the site are viewing pages on the site after having logged in, their clicks will not be counted by google analytics. But, people who are not logged in, or those who are subscribers but not authors, would be counted by google analytics.

    I would appreciate advice — I am not a PHP-proficient coder, so the simpler the better. Thank you!

    -Sara, [email protected]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Howdy,

    I don’t have the url here with me at work, but a search should turn up at least one google analytics plugin that will ignore admins (by not including the analytics code). If you find one, it may be easily tweaked to ignore any logged in user or certain roles as well.

    Thread Starter scormeny

    (@scormeny)

    Thanks, HandySolo. If you find the link to the specific Google Analytics plugin that supports ignoring admins, I’d appreciate your posting it here! And thanks for giving me the “right way” to think about this (use a plugin, rather than adding php code to the footer).

    Thread Starter scormeny

    (@scormeny)

    I did more research and found the following, which does what I need it to do:

    https://www.semiologic.com/software/google-analytics/

    I also like semiologic’s admin menu bar; Denis de Bernardy seems to know what he’s doing.

    Thanks again, HandySolo!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘only add google analytics code for non-author users’ is closed to new replies.