Forum Moderators: DixonJones
Must it go directly before the closing </body> tag or can it go somewhere in that general area? For example, can I just put it in my website's footer includes file (which precedes the closing body tag in the source code anyway but not directly)?
This would make the installation a whole lot easier. Otherwise, I'll be obliged to go through each and every page on a 150+ page site and install the code manually.
It seems to me that since it's just a Javascript that it should work fine as long as it's in that general area (and before the closing body tag). Somebody correct please if I'm wrong. Thanks.
I think the reason they way you to put it directly before the last body tag is it will keep it from delaying the rest of your page loading if the GA request takes a bit.
Having it at the end also helps to only count visitors that actually let the page fully load.