AdSense Explain A/B Testing

Posted By Darren Rowse 11th of August 2006 Adsense

The Official AdSense blog has posted a short tutorial on how to implement an A/B Test with your AdSense ads.

An A/B test sets up two different types of AdSense ads that rotate on your page in different configurations so that you can test which one works best for your site.

For example you could set it to track how two different color schemes perform in the one ad position or how different sized ad units do.

The first thing to do when setting up such a test is to set up two channels to track your results. Then use the javascript code below to rotate the ads.

Here’s the javascript code that they suggest you can use to run an A/B Test with your AdSense:

<script type=”text/javascript”>
var random_number = Math.random();
if (random_number < .5){
//your first ad unit code goes here
} else {
//your second ad unit code goes here
}
</script>
<script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>

Replace “//your first ad unit goes here” with your ad code inside the first set of <script></script> tags.

It’s an experiment that is well worthwhile and it’s nice to see AdSense are making it possible. I’m sure however that there would be a more automated way to do it. For example they do allow publishers to rotate up to four color schemes in their ads at present – it’d be great if we could assign a different channel code to each color scheme to track it – in effect this could be a similar test.

Exit mobile version