Taken from Stack Overflow
You ALWAYS have to worry about collissions of variables defined in the
global scope in JavaScript, REGARDLESS of whether you minify your
scripts or not. Use a functional closure wrapper to wrap your code if
you want to minimize chances of collission.
The problem is that it can conflict with other scripts of course you can use variables and closures to ensure this doesn't happen but the other problem which is not included in the answer on overflow is that its calling upon an external JavaScript which can slow down the min JavaScript file.
Below is the standard usage of the Script and as you can see it calls upon a external JavaScript:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_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>
Due to the fact it is calling upon an external script I would be say you are best not serving it within a main JavaScript as its raises problems of conflicts and would prove little gain because of the external file.
I believe the best you can do is minify the inline code which will save around 400 bytes like so:
<script>var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];(function(d){var g=d.createElement('script'),s=d.scripts[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document))</script>