Regarding the placement of the GA code, it largely depends on your goals: Putting the code at the top of the page will count more views of partically loaded pages as well, whereas the position at the end might miss some “fly by” visits. The longer the overall page load time, the bigger the difference can get.
So, if you are mostly interested only in counting “real” visits, it is often best to place the code at the end of the page. If you want to come most closely to the numbers your log files will tell you (or you have some advertisers you’d like to impress), the code should be places at the top (and therefore executed early on pageload). In addition, GA statistics will only work for users that do not disable JS in the browser. Therefore, undercounting is a normal behaviour.
Markus
(Hey, this is my 700. post ... hope it is helpful for someone 😊 )