I just started using Google Analytics (GA) to monitor my Web site, and I had a problem knowing where to put the Google script code on the site.
I was originally putting it inside each individual post. But that was causing a problem with having to remember to maintain it for each post. It also didn’t cover some of the generated content such as my Category pages, Search pages, my subscription pages, and a few others. I also found that my pages weren’t showing up under GA analysis.
I started researching and found that for WordPress, a good place to put the GA script is in the footer.php file, right in front of the /body statement at the bottom of the code. Once I put the script in footer.php, my Web pages started showing up in Google Analytics tracking.