I like to place analytic code like:
var stat_site_ids = id || [];
statid.push();
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.statistics.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
<noscript><p><img alt="Mystat" width="1" height="1" src="//statistics.com/image.gif" /></p></noscript>
How to include this code into JS file as it will not be correct due to <noscript> and other elements?