Google Analytics is an incredible tool that can track a phenomenal amount of useful information about your visitors. However, when your site is new, or if you just happen to spend a lot of time on there yourself, your numbers will be skewed as they are tracking you, the site admin, as well.
There’s two simple workarounds that will allow you to continue collecting stats from your visitors, but ignore any logged-in users (note that you must be logged in for both of these methods to ignore you).
Using A Code Snippet
The cleanest method in my opinion is to add a little code snippet in your footer.php as it does not bloat your installation with a plugin:
Open up your theme editor so that you can edit footer.php. Find the wp_footer() call (shown in line 01 below) and add the remaining lines below it, substituting your own Google Analytics tracking code (available from your Google Analytics dashboard – hit Edit next to the site in question, and then Check Status on the next page) in the lines highlighted in grey (which is my own tracking code).
It’s a very simple piece of code which wraps your Google Analytics code in a conditional statement, which checks whether the user is logged in or not. If they are, it skips over the tracking code, otherwise it uses it as normal.
Using a plugin (Google Analytics for WordPress)
The Google Analytics for WordPress plugin is the only plugin you need when it comes to using Analytics with WordPress. Among the many options is one to skip over tracking logged-in users. You can also specify which roles you want to track (Authors, Editors, Administrators etc.).
On your Settings Page (select Settings > Google Analytics from the menu at the side of your dashboard), scroll down to the Advanced Settings section and the very first option is the one you’re interested. Select the minimum role that you want your tracking code to ignore (i.e. selecting Subscriber will ignore all logged-in users, but selecting Administrator will only ignore those with Administrator privileges). Save your settings and you’re away.
I visit my own site a lot to check things over and make design changes, so I get a lot of page hits that in my opinion should be omitted. Are you in the practice of ensuring that logged-in users are not being tracked for Analytics?