We get asked regularly how to add Google Analytics tracking to WordPress sites. A quick search of the WordPress plugins directory shows about 60 results for “Google Analytics” so there are no shortage of ways to add it. The plugin we prefer to use is WP Google Analytics. With WP Google Analytics you can not only add your tracking code easily you can choose to log 404 errors, searches and outgoing link clicks as well as disable tracking for any role you want, like administrators, editors, etc.
To install WP Google Analytics you just need to download the .zip file from the plugins directory, go to your WordPress admin dashboard and navigate to Plugins > New > Upload. Upload the .zip file and activate the plugin. You can then change the settings and insert your tracking code.