Have you ever noticed that the loading time of a webpage that references http://www.google-analytics.com/urchin.js slows down drastically?
The solution is very simple. Host the urchin.js file on your server and update your local file automatically once daily.
All you need to do is set up a timer in the Application_Start Event and set it’s Elapsed property to 3500000 (i.e, 58 mins). Then, in the Elapsed event handler just write the following code that updates your local urchin.js file daily at Noon.
How easier can that be?
if (DateTime.Now.ToUniversalTime().Hour == 12)
{
try
{
//download google analytics
System.Net.WebClient client = new System.Net.WebClient();
client.DownloadFile(”http://www.google-analytics.com/urchin.js”, WebConfigurationManager.AppSettings["path"].ToString());
}
catch
{
//do nothing
}
}










