There's several ways to approach this, of course. Essentially, you read the server log file and check the REFERER field for traffic from the search engines. When you locate an entry, you need to parse the REFERER's query string for the user search query. From there, it's up to you to decide what to do with that information. For several reasons, I'd suggest that you filter out common words like "the", "a", "an", "who", "what", "where", "if" "and", "but", etc. so that you don't needlessly track them as individual keywords. Then you need to decide if you want to track entire search queries, or just the individual keywords. As I say, there's lots of ways to do this. The best thing is to just dig in and see how it goes for your project. I'm sure you can find server log parsing scripts out there to get you started. Good luck!