My questions is, do you put Google Analytics Javascript code in the header or at the very bottom of the page (before </body>). I’ve heard people say it’s best to put Google Analytics Javascript code at the very end of your html. Others say its best to put it in the header. Is there a best practice?
My questions is, do you put Google Analytics Javascript code in the header or
Share
Put it in your header. It’s asynchronous so it won’t block your page from loading and by placing it in your header you’ll be more likely to get a accurate stats.