Is it possible for a visitor to go onto google and whatever term they used to find me on Google will be relevant to the ads? For instance: If I searched for 'fishing poles' on Google, can I take that information and serve ads relevant to fishing poles? My whole point is to display the most targeted ads possible for the traffic I get from Google.
You can use the referrer information to parse out the search query used to find your site. Then, save it in a session and use the info on all the pages the person is navigation to.
eregi('google\.com(\.\w+)?/search\?.*q=(^&+)',$_SERVER['HTTP_REFERRER'],$regs); urldecode($regs[2]) would contain your search query.
To cover a wider range of search engines, see the code in this wordpress plugin (it is generally applicable for any php application). You could then possibly put the query keywords into the google_page_url variable (if using adsense). Not sure if it still works for urls that aren't actually real, but it used to!
That tool didn't seem to work on any of my wordpress blogs. I activated it and placed the code on my singlepost.php and page.php pages but I just got errors or it wouldn't show up.
If you already have a fishing pole page that has been indexed by Google, you can 301 to it based on an examination of the search terms Google passes in the referer header. However, this may upset Google since you're serving different pages to various users than you are to the indexer. You can also just draw a relevant page on the fly, but that wouldn't get you such well-targeted ads. And it's still upsetting to Google.
If you have their SOAP API Key, you can use it to make 1,000 SOAP queries per day, but they've stopped dishing them out. Besides, if you screen scape it, you will get googled banned if someone visits your page and constantly refreshes it! Jay