Google Analytics: What is this /NaN thing?
May 31st, 2007 by Ernesto GluecksmannRecently we started setting up our clients with Google Analytics. After Google’s recent upgrades to a more Ajax styled reporting GUI, we found it to be quiet the upgrade. There’s tremendous improvements in layout and flexibility, along with simplified explanations. Very easy for our customers to get in there and get around.
For one of our clients, we started to see the characters “/NaN” as one fo the pages of significant traffic, located in the Content reports. There’s no page called /NaN, it is actually a JavaScript error that means “Not a Number”.
Well, it turns out that this is usually an indication that there’s some other JavaScript on the web page that interfering with the JavaScript that is download from Google. The way to fix this, is to move Google’s code up into the <head> tag of your web page.
We usually add the Google Urchin code at the bottom as indicated by Google, but in this case, the second recommendation it above all other JavaScripts.
Once we did that, Google Urchin code was run first and that fixed our odd /NaN problem.


August 31st, 2007 at 11:24 pm
Thanks for posting this.
We had supposed Google Analystics Experts look at a couple of our client’s site and they never even commented on the funnel showing Nan URLs let alone know the answer!
You have save us a lot of time!
November 19th, 2007 at 3:56 pm
Thanks for this post. I ran into this issue for the first time today and your post is the only answer I could find.
March 10th, 2008 at 7:32 am
I tried your solutions and it didn’t work. My google results when flat and the page was not even working. Do you have any other thoughts regarding the NaN problem?
March 10th, 2008 at 10:56 am
Hmm, that sounds more like a problem with the page itself. Moving your GA code into different positions, should not affect the page. If you’re saying the page itself is now broken, then you may have overwritten some of page’s important tags. And, GA may skip over broken pages if it can’t tell it’s an HTML document. I’ll email you directly.