I thought I’d just share a little technique I use on my sites for optimizing my Adsense ads. It’s a quick and easy way to keep track of whether one Adsense color performs better than another, or whether one size performs better than another.

The first thing you’ll need to do is make sure you have 2 separate Adsense channels created for the site you’ll be running the test on. Then you’ll want to modify the page code itself.

The following code(using PHP) is used to generate a random number of 0 or 1. You may place this at the beginning of your page’s code:


< ?
srand(time());
$random = (rand()%2);
?>

Then you’re going to want to replace this line in your Adsense ad:

google_ad_channel =”74745145343″;

with something like…

< ?
if($random == 1)
{
?>
google_ad_channel =”74745145343″;
< ?
}
else
{
?>
google_ad_channel =”2682548234″;
< ?
}
?>

The code above simply picks which Adsense ad channel to use based on whether the random number picked was a 0 or a 1. Using pretty much the same code as right above, you’re then going to want to pick an attribute to apply this if…else statement to:

< ?
if($random == 1)
{
?>
google_color_link = “660000″;
< ?
}
else
{
?>
google_color_link = “4A525A”;
< ?
}
?>

That way, whenever it randomly generates a number, it uses the same color and channel together. You could modify a number of attributes including link color, description, URL, and even the size of the ad. You can watch your Adsense results running side by side during the day instead of having to run one campaign for a week, and then another campaign for a week.

It’s nothing big, but it’s a useful little bit of code I use when evaluating what colors and sizes to use.

Do you like this article? Submit it to Blogosphere News!