The ABC's of A/B Split Testing

Posted on March 2, 2007 11:23 AM by Joel Comm

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.

See Also

Google Adsense Secrets - Feb 12, 2005
Kontera - Sep 21, 2005

3 Comments For This Post

  1. Senjaya Says:

    Fantastic!
    Where was you get the code from?
    Amazing, Brilliant...
    Best Affiliate Man #1 In the world!

  2. bookfinance Says:

    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!

  3. CarlosM Says:

    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.

Leave a Reply

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Verification (needed to reduce spam):

Advertise Here

Subscribe to JoelComm.com, Free!

Subscribe to JoelComm.com via RSS

Subscribe to ASK.JoelComm.com via RSS

Subscribe to Joel's YouTube Channel

 

Or, subscribe via email:

Name:
Email:


Joel's Twitpic Photo Stream

See all photos

Advertise Here

INFORMATION

Joel Comm is an Internet entrepreneur who has been online for over 20 years. In 1995, Joel launched WorldVillage.com, a family-friendly portal to the web which enjoys thousands of visitors each day. Joel is the co-creator of ClassicGames.com, which was acquired by Yahoo! in 1997, and now goes by the name Yahoo! Games. Since then, Joel's company, InfoMedia, Inc., has launched dozens of web sites which offer online shopping, free stuff, website reviews and more. Joel is the author of many popular books, including the NY Times Best-Seller, The AdSense Code. He regularly makes appearances at Internet marketing conferences and seminars.