Using PHP to Determine Which Adsense Ad Works Best

I recently read an article that discussed the effectiveness of different adsense ad sizes. The three medium box shaped ads that adsense offers is:

250×250
300×250
336×280

The article mentioned that even though the 336×280 was the largest it wasn’t neccesarily the best performing advertisement since most online advertisers develop their image ads to fit in a 300×250 slot. The author had even said he spoke to one advertising agency representative who says that they’ve never made a 336×280 ad for any of their mainstream advertisers.

The reason this is important is that the more advertisers fighting for a specific ad block size the higher the price of the ad, thus more money for your website.

But how do we test it? How do we know for sure that one ad block out performs the others?

I have set up a php script to randomly display ad block A and ad block B. This is also known as split testing or multivariate testing.

The Code

<?php $splitIt = rand()&1; ?>
<?php if ($splitIt == 0) { ?>
     // Adsense code for ad block A
<?php } ?>

<?php if ($splitIt == 1) { ?>
     // Adsense code for ad block B
<?php } ?>

Make sure when you setup your adsense code that you make two seperate channels so can monitor the results of the two advertisements. For more information about adsense channels check out, Introducing multiple custom channels.

Implement split testing into your site and let us know which advertisements are working best for you. I am currently testing between the 250×250 and 300×250 advertisements blocks. I plan to split test these until April 30th then I will post the results of my test.


Was this information useful?


5 Responses to "Using PHP to Determine Which Adsense Ad Works Best"
  1. [...] you remember back to the post I wrote, Using PHP to Determine Which Adsense Ad Works Best, we explored ways to split test the performance of Adsense with the help of PHP. I had also [...]

  2. dave on November 2nd, 2009

    thanks for the handy tips

    is it against tos to use this php code to rotate between several ads? is there a maximum number that can be rotated between?

    thanks!
    dave

  3. Mark Sanborn on November 2nd, 2009

    Dave,

    Not that I know of.

  4. Charles on December 26th, 2009

    Using the Adsense API coupled with a script such as your’s someone could built a script to automatically display your most profitable ads more often than the ads with a lower click-through rate.

    Unfortunately at this time Google requires over 100k daily page views before they will grant access to the API to extract this data.

    If you have any thoughts on how this data could be gathered from Adsense without the use of their API it would be great to hear your ideas.

  5. Mark Sanborn on December 28th, 2009

    Hi Charles,

    I am almost certain that Google is already displaying the most relevant ads based on the page’s content. After all the more money you make the more Google makes.

    If you were referring to ad placement and ad size a/b testing then you would need to use the script that I have posted here.

    What do you think?