(replace xxxx-xx with your Google Analytics account number)
The new code passes W3c XHTML 1.0 strict compliance verification,
mitigates Nested Script errors on ASP on IIS, and installs on Blogger
and will be the default code provided within the Google Analytics
interface.
Thanks to everyone who both reported the issue and suggested fixes!
> (replace xxxx-xx with your Google Analytics account number)
> The new code passes W3c XHTML 1.0 strict compliance verification,
> mitigates Nested Script errors on ASP on IIS, and installs on Blogger
> and will be the default code provided within the Google Analytics
> interface.
> Thanks to everyone who both reported the issue and suggested fixes!
Why does Google not validate their code before publishing? The lack of
conformance with the W3C is causing troubles for some products, as
this case shows.
Why not hide javascript from old browsers (and fussy validators) using
the comments hack? It would save all the unescaping. At least it seems
to be accepted by blogger. Not sure if it works (generates data)
though.
i.e.
<script>
<!-- hide javascript
...
// end hide -->
</script>
> (replace xxxx-xx with your Google Analytics account number)
> The new code passes W3c XHTML 1.0 strict compliance verification,
> mitigates Nested Script errors on ASP on IIS, and installs on Blogger
> and will be the default code provided within the Google Analytics
> interface.
> Thanks to everyone who both reported the issue and suggested fixes!
> Why not hide javascript from old browsers (and fussy validators) using
> the comments hack? It would save all the unescaping. At least it seems
> to be accepted by blogger. Not sure if it works (generates data)
> though.
> i.e.
> <script>
> <!-- hide javascript
> ...
> // end hide -->
> </script>
> On Dec 19, 8:39 am, AnalyticsPro wrote:
> > If you're having issues installing the ga.js on either an ASP site or
> > Blogger, please use the following code instead:
> > (replace xxxx-xx with your Google Analytics account number)
> > The new code passes W3c XHTML 1.0 strict compliance verification,
> > mitigates Nested Script errors on ASP on IIS, and installs on Blogger
> > and will be the default code provided within the Google Analytics
> > interface.
> > Thanks to everyone who both reported the issue and suggested fixes!
I've added the new-new GA code, as posted above, to our site and it
returns two errors: "_gat not defined" and "Error: unterminated string
literal.... Source Code:var gaJsHost = (("https:" ==
document.location.protocol) ? "https://".
What would the correct version look like for a HTTP site that is XHTML
1.0 Transitional? We are not running Blogger or ASP and still having
problems tracking/validating.
I had a similar problem when cutting and pasting the code that one of
the strings was split over 2 lines. make sure there are no extra
newlines in the code you have.
> I've added the new-new GA code, as posted above, to our site and it
> returns two errors: "_gat not defined" and "Error: unterminated string
> literal.... Source Code:var gaJsHost = (("https:" ==
> document.location.protocol) ? "https://".
> What would the correct version look like for a HTTP site that is XHTML
> 1.0 Transitional? We are not running Blogger or ASP and still having
> problems tracking/validating.