What I did is to place the <script>
part of the code in the HEAD
section and <noscript>
part at the end of the BODY
section. Why?
If the Javascript is enabled, and if it is important to you to count every hit to your page, no matter if the page has been fully loaded or not, this will still work.
If the Javascript is not enabled, the <noscript>
part will also be executed, without causing the disturbance in the dom model layout (on my page, it added some bogus height to that 1px image, for god knows what reason) and, most importantly, it WILL validate in the W3C HTML validator. If you leave the noscript part in the head section, the img tag within noscript will cause a validation error.