Google advises putting the google analytics script right before closing the .
However, I would prefer to combine it with the rest my javascript
tag of each page you are planning to track. If you use a common include or template, you can enter it there. To implement tracking code for secure pages (e.g. https://), please read How do I obtain tracking code for secure pages?