2005
Randomly Display Different AdSense Ad Layout
Sponsored Links
As an AdSense publishers, one of the solution to avoid your visitor’s ad blindness problem is by rotating your AdSense color palette. This is legal and allowed by Google. Infact, they also tell you how to create an AdSense ad code which automatically has different color template on each reload.
From the AdSense Optimization Tips page:
You may find that colors that stand out without overshadowing your content are better for your site than colors that blend in so well, the ads are practically invisible. However, you may find that colors that blend in completely perform better. However you choose your color palettes, make sure that it complements the color scheme of the page. Also, rotating color palettes is a simple way to add variety and freshness to your ads. All you need to do is hold down the Control key and select up to four color palettes when generating your ad code in the Ad layout code page of your account.
You can read my other article here for tips on selecting a good color combination for your AdSense ad.
Back to the ad-blindness problem. Other than using the color rotation technique, you can also try to randomly display different AdSense ad layout. I already use it on this site for couple of weeks, and I got significant increment in CTR (and earning, of course).
In my site, I use three different AdSense ad layouts. Well, actually two. First, the banner layout, 468×60. Second, the rectangle, 300×250. And the last, the same 300×250 rectangle, but with an extra image on the left side. To accomplished this, I only use a simple PHP script to randomly select which ad layout to display.
There’s nothing special with the technique. I just put each of the three AdSense ad code above on different file, then create a PHP function to automatically select on of the script and display the code inside (using PHP include statement).
Here’s the step-by-step instruction:
- Choose the ad layout you want to randomly display, copy and save each of them on a different file. For example, we’ll create two files. First, ads_1.inc, which contains code for AdSense 468×60 ad unit. And the second, ads_2.inc, which contains code for AdSense 300×250 ad unit.
- Create a new file. Write down the following PHP code.
< ?php
$x = (rand()%2)+1;
if ($x == 1)
include ('ads_1.inc');
else if ($x == 2)
include ('ads_2.inc');
?>Save the file as random_ads.php.
- Now everytime you wan to display a random AdSense ad layout, you only need to write this:
< ?php include('random_ads.php'); ?>Done.
Of course, this is not the best or the most effective technique to obtain a random AdSense ad layout. But I think this is the easiest one :d
If you don’t want to use it to display random ad layout, you can use it to rotate your ad color palette. Remember that AdSense ad code only support up to four different color palette to rotate. If you want more, for example six different color palette, you can first create the code for four different color palette and save it to ads_1.inc. Next, create the code for the last two different color palette and save it to ads_2.inc. Now with the same random_ads.php code above, you can get six different AdSense color palette rotation.
Have fun with AdSense :d
And while you're here, why don't you check out our other articles:
Pssst! Most people are coming to this page searching for: 


Thanks for the tip! You inspired me to write a short article on this subject on my new blog:
http://makeagreatwebsite.blogspot.com/
Banner blindness seems to be very challenging, very common problem, so anything we can do to reduce it helps a lot!