Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: open
In both cases, I have always been getting 404 as client would try to load ga.js script from the local server, rather then from Google’s site where the client is supposed to go.
Anyhow, my main problem is that I get such 404s:
I wonder if I could “fix” the script by changing this part:
src='" + gaJsHost + "google-analytics.com/ga.js'
into something like this:
...so I ensure the client goes to Google to load the script.
I get an email every time 404 occurs and I like that. But, those GA related 404s are really annoying.
I did ask Google directly, and posted a question under AdWords some tie ago, but no help or explanation has come out.
Any comment is much appreciated.
The source I have put here is how it is from GA. I wonder if site search being turned on could cause it. I'll check with them.
In regards of the local call, I was afraid of doing it as I saw extra references back to Google, with relative paths (new GA script).
I’ll see if I can fix it by still having it going to Google.com
Thanks again for clarification.
Changing the call to go directly to Google should fix the issue and should be how it was given to you originally in google analytics.
I too would like to see confirmation on this. The original GA code from Google is given to you like this...
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
var pageTracker = _gat._getTracker("UA-0101010-1");
We have continual challenges in this area with a small percentage of 404s being generated throughout the day on various sites that use the new GA code. I too have previous topics on this that were never really answered.
Personally I believe it is a fail safe to prevent your page from being delayed if there are any performance issues from the GA servers. With the old code, if you had it before your primary content, the page would be delayed while the GA code finished loading. I think the new code provides a fail safe that if the GA server takes too long, it returns a 404 and appends the URI where the 404 took place. I also get emails...
In fact, I just got four of them from one site. Pesky little buggers. ;)