I decided to post a small script, maybe it will be helpful for some.
First of all let me say this script is not ment to spam, it's ment to serve as a tool to help better target ads for adsense, and possibley improve search engine rank if used properly.
"If abused I am sure it could damage your S.E rank"
Step 1 - botcheck.php
Code:
<?php
/// © Copyright 2006 "http://www.gostubby.com" DO NOT REMOVE!///
///Bot names///
$bots = array('Googlebot', 'Yahoo! Slurp', 'msnbot', 'Mediapartners-Google');
/////////////
$any = implode('|', $bots);
///Is it a bot?///
if (preg_match ("/$any/i", $_SERVER["HTTP_USER_AGENT"])){
include "botcandy.html";
}
?>
Step 2 - Create another file "botcandy.html"
This file will contain any html / text you want added
it should be relevent to your website in order to obtain targeted ads.
Step 3: include it in the problematic page to target ads.
Code:
<?php require("botcheck.php");?>
Most of the time your ads are not targeted because google isn't quite sure what your site is about!
What happens is whenever the google bot visits your website it will see a little something extra that your visitors don't see.
Do remember keep the content within the botcandy.html file " spam free " maybe something along the lines of a few paragraphs discribing your website.
It may take awhile before the google bot returns to your website.
To test if the script is working just find any search engine simulator, and enter it's agent name in the above script array.