There are three ways of getting Google's rank info
1. use filters
2. add server-side (PHP,etc.) code to extract rank from referrer and
inject into customvar
3. add client-side code (JS) to extract rank from referrer and inject
into customvar
So for a generic solution, you would use #2 or #3. #3 is probably the
most generic since it doesn't depend upon server-side implementation.
See this article and read the comments also.
http://yoast.com/track-seo-rankings-with-google-analytics/
Another options is to sign up for the excellent ZoomRank service. Then
you can get ranking for other engines and also get average weekly and
monthly historicals.
Chris Harrington
ShufflePoint, Inc.