Performancing Metrics

Optimizing Adsense for your Blog

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.

Categories: General

This post was written by . You can visit the for a short bio, more posts, and other information about the author.


Comments Closed

Comments

  1. Joe says: 7/18/2005

    Uhh …. modifying the Google AdSense code is against the Terms of Service, and may cause you to have your account shut down.

  2. Jacob says: 7/18/2005

    This doesn’t modify the Google Adsense code. All it does is randomize the Channel and color that is displayed. All the processing is done on the backend, not visible by anybody. This is not in anyway against Google’s TOS.

  3. JD says: 7/18/2005

    Jacob,

    A more compact way to do this would be:

  4. Lee says: 7/19/2005

    I have found in the past that to get any real good idea of what works best, you need to run with it for a few days – different people visit at different times. For example, lesser experienced users may only visit in the early evening – those people are more likely to respond to an ‘obvious ad’, whereas experienced users may visit during working hours – and they are likely to click on ‘blended ads’.

    I would be interested in hearing what kind of results you find from your approach though, it’s certainly not something I’ve though of!

    On the subject, I actually posted a few of my own Adsense Tips the other day.