So I want to enable google analytics in a website application, so I have the code in the script tag itself. Is it better to have the code directly in the tag:
<script>
(functions(variables)google objects (morevariables), links);
</script>
Or is it better to have it in the form of:
<script src="link to where a js file with the exact same code as above is hosted"></script>
With three things in mind:
- Load Time (Normal page load as well as number of calls)
- Security (I doubt this is an issue, as people will have easy access to that code either ways, and I don't think its particularly confidential)
- google analytics should obviously catch everything properly.