How do I configure the Google Analytics Code to prevent administrator or author access to Wordpress administrative areas from being counted?
How do I configure the Google Analytics Code to prevent administrator or author access to Wordpress administrative areas from being counted?
Most likely the plugin you use already has this option. I use Yoast SEO, considered one of the best on the market, and it already has this option to prevent counting administrators.
If you want to do this on hand, here goes:
Install the plugin link
Insert the Footer tab:
<? if (!is_user_logged_in()) { ?>
<script type="text/javascript">
...GOOGLE ANALYTICS CODE...
<? } ?>