I usually use an adaptation of this, to take out the extra code that supports prototype and YUI (my choice is jQuery). This thing is super easy to use:
That's fine if you only need _trackPageview. The Google solution provides more capabilities though. Also, be careful of using 3rd party solution. They don't always work correctly. The jQuery plugin for GA used to cache-bust every request to ga.js, which definitely slows down your page.
Define an anonymous function that takes no arguments, and execute it without assigning it to a variable. It's often used in javascript to keep things out of the global scope.