January 30, 2008
Speed Up Google Analytics Load Time
Ask Apache wrote a very useful article on how to increase the speed of your Google Analytics script on load time. Everyone knows that it slows down at certain times when there are millions of people trying to access it, but there is a solution.
If you download it locally, you can run it off your own server. Google does not recommend this because the code on their server give you the latest features. The solution, write a cron script that runs every week (every day if you are nervous) that will remove the script from your server “wpget” the new file and set the permissions.
#!/bin/sh
cd /path/to/your/javascript/
rm -f urchin.js
wget http://www.google-analytics.com/urchin.js
chmod 644 urchin.js
exit 0;
At the time of this post I have not changed my live blog, but I finished it on my test blog and it works great. Will be making the change soon.
