as soon as I did the basic content negotiation filters in PHP so that it would send the appropriate headers
if the client supported XHTML as well as only outputting the <?xml if the client supported XHTML, I
doesn’t exist in XHTML, after all.
The fix was simple, replace the current four line
inclusion code with:
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");
var script = document.createElement("script");
script.src = gaJsHost + "google-analytics.com/ga.js";
will work fine, unless of course you have no head tag. In which case you should replace
getElementsByTagName(“head”) with getElementsByTagName(“html”).