A/B Testing with Google Adsense
I made a post previously about this. Giving a php code to use for Adsense split testing. But this
is officially an approved way by Adsense, I wasn’t sure if the other way was… which is why I didn’t use that way. But this way is approved by Adsense.
Tutorial
First, create two channels in your Adsense account. One for the name of each of the color schemes or formats you are going to run against each other. So for example, if you wanted to test a 460 by 60 pixel ad unit with a blue background against the same format with a yellow background, create a channel for each of those, with appropriate names.
Second, paste the following code into the spot you want your ads to appear…
<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>
Now that’s there, time for the final phase.
Go ahead and create the two versions of your ad.
Now simply place each ad code into the spots in the code above, removing the <script> and </script> from the Adsense code. That’s it!
Now you will be able to see by each channel in your account, which ad gets the best CTR. Which ever one does, is the one you keep! and it’s simply an on-going process.