I do not really understand why they don’t support this themselves, but Google Analytics will not track keywords for Google image search. Instead it just shows up as “referrer”. A site I’m webmaster for, Swing and the City, gets a lot of image search exposure (funnily for an image that is gone since August, Google also needs to work on their index, too), so it was a bit odd to have images.google.com show up as top referrer but not “organic search”.

Here’s the code I use to fix this:

var r=document.referrer;
if(r.search(/images.google/)!=-1 && r.search(/prev/)!=-1){
 var e=new RegExp("images.google.([^\/]+).*&prev=([^&]+)");
 var m=e.exec(r);
 pt._addOrganic("images.google","q",true);
 pt._setReferrerOverride("http://images.google."+m[1]+unescape(m[2]));
};
pt._addOrganic("maps.google","q",true);
pt._addOrganic("forestle.org","q",true);
pt._trackPageview();

Note that image search is more complicated than the maps and forestle search engines I also add for keyword tracking. The original query is encoded in the “prev” parameter, and the easiest (or only?) way to get working tracking is to use the ReferrerOverride function of analytics.

Note: this is not a straight copy & paste, since I use this code in a compressed and encoded (for injection into the page via DOM ops) form. So no guarantee of syntax completeness. You’ll need to adjust it to your variable naming anyway (I use “pt” instead of “pageTracker”). This is just to show you the use of unescape on the “prev” parameter for this purpose.