Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Discussions > Troubleshooting > New ga.js not working with ASP or Blogger ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  18 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
AnalyticsPro Google employee  
View profile  
 More options Dec 18 2007, 6:39 pm
From: AnalyticsPro
Date: Tue, 18 Dec 2007 15:39:18 -0800 (PST)
Local: Tues, Dec 18 2007 6:39 pm
Subject: New ga.js not working with ASP or Blogger ?
If you're having issues installing the ga.js on either an ASP site or
Blogger, please use the following code instead:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://
ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-
analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxx-xx");
pageTracker._initData();
pageTracker._trackPageview();

(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!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Girdwood  
View profile  
 More options Dec 18 2007, 8:30 pm
From: Andrew Girdwood
Date: Tue, 18 Dec 2007 17:30:04 -0800 (PST)
Local: Tues, Dec 18 2007 8:30 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
You need to make sure you close the </script> tag after the last
pageTracker call too.

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://
ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-
analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxx-xx");
pageTracker._initData();
pageTracker._trackPageview();
</script>

On Dec 18, 11:39 pm, AnalyticsPro wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philipp Lenssen  
View profile  
 More options Dec 19 2007, 7:19 am
From: Philipp Lenssen
Date: Wed, 19 Dec 2007 04:19:19 -0800 (PST)
Local: Wed, Dec 19 2007 7:19 am
Subject: Re: New ga.js not working with ASP or Blogger ?
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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ijd  
View profile  
 More options Dec 19 2007, 8:18 am
From: ijd
Date: Wed, 19 Dec 2007 05:18:54 -0800 (PST)
Local: Wed, Dec 19 2007 8:18 am
Subject: Re: New ga.js not working with ASP or Blogger ?
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Ruscoe  
View profile  
 More options Dec 19 2007, 8:58 am
From: Tony Ruscoe
Date: Wed, 19 Dec 2007 05:58:49 -0800 (PST)
Local: Wed, Dec 19 2007 8:58 am
Subject: Re: New ga.js not working with ASP or Blogger ?

> Why not hide javascript from old browsers (and fussy validators) using
> the comments hack? It would save all the unescaping.

That wouldn't have stopped the Nested Script errors in ASP though.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Accettura  
View profile  
 More options Dec 19 2007, 11:13 am
From: Robert Accettura
Date: Wed, 19 Dec 2007 08:13:35 -0800 (PST)
Local: Wed, Dec 19 2007 11:13 am
Subject: Re: New ga.js not working with ASP or Blogger ?
Generally for xhtml you'd use:

<script type="text/javascript">
  // <![CDATA[
    your code goes here
 // ]]>
</script>

That will always validate in xhtml 1.0 strict as well as xhtml 1.1,
unless you've got a CDATA in your js... but that's easy to fix by
splitting it.

On Dec 19, 8:18 am, ijd wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bridgeman  
View profile  
 More options Dec 19 2007, 2:21 pm
From: Bridgeman
Date: Wed, 19 Dec 2007 11:21:03 -0800 (PST)
Local: Wed, Dec 19 2007 2:21 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
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://".

Any idea what is causing this to happen?

Thanks for any input,

Adam


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CX  
View profile  
 More options Dec 19 2007, 4:16 pm
From: CX
Date: Wed, 19 Dec 2007 13:16:00 -0800 (PST)
Subject: Re: New ga.js not working with ASP or Blogger ?
ASP returns an error that the scripts are nested, Instead:

Use a VBScript Sub to write all your ga.js.

'Example with page title
Call WriteGoogleAnalitycsCode("Page Title")
'Example without page title
Call WriteGoogleAnalitycsCode("")

Sub WriteGoogleAnalitycsCode(pageTitle)

response.write("<scr" & "ipt type=""text/javascript"">" & vbcr)
response.write("var gaJsHost = ((""https:"" ==
document.location.protocol) ? ""https://ssl."" : ""http://www."");" &
vbcr)
response.write("document.write(""\<script src='"" + gaJsHost +
""google-analytics.com/ga.js' type='text/javascript'>\<\/
script>"" );"
& vbcr)
response.write("</scr" & "ipt>" & vbcr)
response.write("<scr" & "ipt type=""text/javascript"">" & vbcr)
response.write("var pageTracker = _gat._getTracker(""UA-xxxx-xx"");"
& vbcr)
response.write("pageTracker._initData();" & vbcr)
response.write("pageTracker._trackPageview(")
If LenB(pageTitle) <> 0 Then response.write(Chr(34) & pagetitle &
Chr(34)) End If
response.write(");" & vbcr)
response.write("</scr" & "ipt>" & vbcr)
response.write("" & vbcr)

End Sub


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Dec 20 2007, 2:10 pm
From: ShoreTel
Date: Thu, 20 Dec 2007 11:10:49 -0800 (PST)
Local: Thurs, Dec 20 2007 2:10 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
Or just write the version (HTTP/HTTPS) your site uses and be done with
it, and also XHTML compliant

On Dec 19, 1:16 pm, CX wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bridgeman  
View profile  
 More options Dec 20 2007, 2:46 pm
From: Bridgeman
Date: Thu, 20 Dec 2007 11:46:41 -0800 (PST)
Local: Thurs, Dec 20 2007 2:46 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
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.

Thanks for helping a java newbie! :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ijd  
View profile  
 More options Dec 21 2007, 3:05 am
From: ijd
Date: Fri, 21 Dec 2007 00:05:51 -0800 (PST)
Local: Fri, Dec 21 2007 3:05 am
Subject: Re: New ga.js not working with ASP or Blogger ?
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.

On Dec 20, 4:21 am, Bridgeman wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Dec 21 2007, 1:46 pm
From: ShoreTel
Date: Fri, 21 Dec 2007 10:46:40 -0800 (PST)
Local: Fri, Dec 21 2007 1:46 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
Here's the instructions for bypassing the auto-https detection script.
http://groups.google.com/group/analytics-help-troubleshoot/msg/e712ab...

On Dec 20, 11:46 am, Bridgeman wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
containerantiques  
View profile  
 More options Feb 15 2008, 12:13 am
From: containerantiques
Date: Thu, 14 Feb 2008 21:13:59 -0800 (PST)
Local: Fri, Feb 15 2008 12:13 am
Subject: Re: New ga.js not working with ASP or Blogger ?
When I post the below code on Blogger.com I get the following error

ERROR
Your HTML cannot be accepted: Tag is not closed: <script type="text/
javascript">

What can I do?? Please help.
Much appreciation.

On Dec 18 2007, 3:39 pm, AnalyticsPro wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Feb 15 2008, 2:04 pm
From: ShoreTel
Date: Fri, 15 Feb 2008 11:04:16 -0800 (PST)
Local: Fri, Feb 15 2008 2:04 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
Try wrapping the second part of the code in a CDATA comment like this

<script type="text/javascript">
  // <![CDATA[
    var pageTracker = _gat._getTracker("UA-XXXX-1");
    pageTracker._initData();
    pageTracker._trackPageview();
 // ]]>
</script>

On Feb 14, 9:13 pm, containerantiques wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pilly  
View profile  
 More options Feb 16 2008, 5:45 pm
From: pilly
Date: Sat, 16 Feb 2008 14:45:10 -0800 (PST)
Local: Sat, Feb 16 2008 5:45 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
i tried this but googleanalytics still says that the monitoring code
has not been detected, i paid attention to put it where asked and
checked it after copy-paste. what else could be the problem? (on
blogger)

On 19 Dic 2007, 00:39, AnalyticsPro wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Feb 18 2008, 8:51 pm
From: ShoreTel
Date: Mon, 18 Feb 2008 17:51:03 -0800 (PST)
Local: Mon, Feb 18 2008 8:51 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
That message does not go away immediately. If the code is installed
correctly the message will go away after a few hours, or sometimes up
to 48 hours.

On Feb 16, 2:45 pm, pilly wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pilly  
View profile  
 More options Feb 20 2008, 4:03 pm
From: pilly
Date: Wed, 20 Feb 2008 13:03:49 -0800 (PST)
Local: Wed, Feb 20 2008 4:03 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
nope, still saying that

On 19 Feb, 02:51, ShoreTel wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Feb 21 2008, 3:26 pm
From: ShoreTel
Date: Thu, 21 Feb 2008 12:26:45 -0800 (PST)
Local: Thurs, Feb 21 2008 3:26 pm
Subject: Re: New ga.js not working with ASP or Blogger ?
What's the URL to your blog so we can take a look at your code
ourselves?

On Feb 20, 1:03 pm, pilly wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »