Home     RSSRSS

Split test your Adsense ads

June 20, 2009 by Naman Bagga | Filed under Blogging, Tech Talk, Web D.

Split testing (also known as A/B testing) your ads is a great way to determine which ad format is best for your website. Regular visitors of my blog would've noticed (if you don't use ABP) that the ad at the top of the sidebar is sometimes a large ractangle (336x280) and sometimes a rectangle (300x250). Well, this is a part of a split test I've been conducting for some time. This post will explain how you can split test your Adsense ads.

First of all you need to create two similar Adsense units like a 338x280 and a 300x250 unit or a 160x90 or a 160x600 unit and a 120x600 unit. You may also create two units of the same size with a different layout or format. This depends on what aspect you want to test. Create a separate channel for both these units for the purpose of tracking their individual stats.

Now comes the main part, implementing the split test code. There are many methods to implement the split test code. All of these use conditional statements along with some function to generate a random number. I'll give two popular methods to split test Adsense ads. Both more or less work on the same principle.

The Javascript Method

This is the basic syntax of the split test using Javascript-

<script type="text/javascript">
var random_number = Math.random();
if (random_number < .5){
<! Add first ad code below>

}
else {

<! Add second ad code here>

}
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Note that it is against the Adsense program policies to edit the ad code. I thought this method was against the Adsense policies when I started writing this post. But then I came across this post on the Adsense blog which mentions that they talked to their policy folks and they've given permission to publishers to edit the ad code for A/B testing purposes.

As I've mentioned, I used to think that the Javascript method was against the Adsense program policies so I decided to use some other method. This method was the PHP method.

The PHP Method

This method doesn't insert any bit of code between the ad code. So naturally there is no question of it being against the Adsense program policy. Note that your server needs to support PHP for this method to work. If you are using WordPress, your host definitely supports PHP(duh!). This is the code for the split test using PHP

<?php $splitIt = rand()&1; echo "<!-- $splitIt -->"; ?>
<?php if ($splitIt == 0) { ?>

<! Insert 1st ad code>

<?php } ?>

<?php if ($splitIt == 1) { ?>

<! Insert 2nd ad code>

<?php } ?>

Using both these methods both the ads will show up almost 50% of the times the ad is shown. You can now compare the performance of both the ad units and decide which one you want to use. You can also further split test the better performing ad with another ad.

My Results

I've been conducting a split test between 338x280 and 300x250 rectangles for quite some time now. The result of the test was mixed. The 300x250 unit and 338x280 unit both have good CTRs but the 300x250 unit has a slightly better CTR. But what attracts me towards the 338x280 unit is that at a decent CTR it gives a much higher CPC which effectively leads to better earnings than the 300x250 unit. I need some more time before which I can decide which size is the best for my blog.

Note that different websites show different results on split testing. The best way to know which format is the best for your site is to split test ad units. I'll update this post once I get a concrete result of my split testing experiment.

← Previous

One Response to “Split test your Adsense ads”

  1. [...] Split test your Adsense ads | Naman Zone http://www.namanb.com/2009/06/split-test-your-adsense-ads.html – view page – cached #Naman Zone RSS Feed Naman Zone Atom Feed Naman Zone » Split test your Adsense ads Comments Feed Naman Zone MY FIRST POST SocialSpark Review-For Advertisers Ordered a Dell Studio 15 — From the page [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe RSS

Canonical URL by SEO No Duplicate WordPress Plugin