Google is very protective of its AdSense code. Start changing bits here and there and you can't expect to keep your account open for very long.
But there's one exception to that rule and it's a very important one. You can put this code on your Web pages:
<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>
replacing the lines after the // with the codes for two different ad units. This is all approved and above board. Google writes about it on its AdSense blog.
What will that code do?
It will swap the two units randomly so that each unit is shown for half the time on your Web page. Put two different channel codes in each of those units and make sure that only one characteristic is different in each of the units. After a week or so of checking your channels, you'll be able to see which unit brings the best results.
Google calls it A/B testing and it's a great way to choose between two different criteria, whether that's two choices of unit size, two choices of font color, two choices of position or whatever it may be.
But that's also why it's important to have a test page. You don't want to be testing different options across your entire site. If your original choice was the best, you'll lower your income for the entire site. Use A/B testing on one page, monitor the results, then roll out the winner across the rest of your pages. It's a fast way to optimize your site.













March 3, 2007 03:35 AM
Fantastic!
Where was you get the code from?
Amazing, Brilliant...
Best Affiliate Man #1 In the world!
March 3, 2007 04:10 AM
Great post! I must have missed this one. I have you on my blog reader to read your updates, just need to go through your archives more thoroughly. Your blog is one of my favorites!
March 3, 2007 11:33 AM
Be careful when using such kind of code for A/B split testing!
It's based on random code, so there's no guarantee "that each unit is shown for half the time"! As you don't control the process (it's random) it can show 90% of the time one unit over the other and it will give you wrong results!
When using the above code check how many times each unit was shown and clicked and do your math to get correct results.
The article Joel referred is at
http://adsense.blogspot.com/2006/08/abcs-of-ab-testing.html
and there are some important notes that you must also follow when running an A/B test.