I use the next code from Google for Analytics:
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '############']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
And I use minify library for merging all JS files into the one. And I want to include ga.js to it. Can I use ga.js from my server and how?
Sure you could use it from your server. Just download it and include it locally instead. It’s even already minified. The thing is, you probably don’t want to do that. Such a file is usually distributed from a CDN. There are a couple of advantages to this:
You can read Google’s word on that.
In short, juts leave it on GA’s servers.