Well, the HTTP_USER_AGENT will not often be faked to look like google, so I see no reason why you could not implement this to get an accurate result.
Or, you could gethostbyip(); the IP, and use regular expressions to see if it contains the string "googlebot", or whatever google's bot's hostnames contain.
Dont hold me to it though! Its just a guess!