There are two methods of inserting the analytics tracking code into a wordpress website.
1. Edit the header.php file and insert the code manually – Not Recommended. This works fine but using option #2 is better. If you update your theme you may loose the analytics code if you use this method.
2. Use the Google Analytics for WordPress Plugin – This will make sure your analytics code is update proof plus you can turn off analytics tracking for logged in users. This will prevent all sorts of data from being gathered that should not be included in your Google Analytics data. Think about what WordPress authors do to average time on site, bounce rate, page loads etc.
There a few other great features in the Google Analytics plugin you may not know existed. Posts on these topics are coming soon.
- How to track WordPress tags and categories in Google Analytics
- How to track WordPress Author’s in Google Analyitcs