Following the documentation found here: https://developers.google.com/analytics/devguides/collection/gajs/
I have made a simplest case in an empty html file as such:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXX-2']);
_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>
When I load the page in Chrome with the Google Tag Assistant plugin it says "No HTTP Response Detected" and I all I see in the Developer Tools network tab is the html file load and the ga.js script being downloaded from google. I get the same result in IE, but when I use Firefox I can see the it trying to get __utm.gif from Google which is how I understand that it should work.
I see no errors in the console, why wouldn't this work in IE and Chrome?
Here is the entire html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>GA Test</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-X-2']);
_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>
</head>
<body>
<p>Testing GA</p>
</body>
</html>