Want to Boost Adsense Earnings? Then Start Testing.
- Posted by B Jones on October 28th, 2007 - Comment on this Post »
When it comes to increasing Adsense earnings, the 3 factors that influence CTR the most are:
- Ad Location
- Ad Format
- Ad Colors
There are endless possibilities and combinations for these 3 factors, and finding the right ones can have a huge impact on your earnings. The problem is that it’s not easy to find the right combinations of these factors. Sure, you have guidelines that countless blogs, and even Google have given to help you, but the truth is, there is no one magic combination of colors, location and format. Your site is unique, therefore, you’ll need to find the combinations that will work and perform best for you.
To do this, you need to experiment and test different ad variations on your site, and today, I’m going to show you a fast and efficient way to do this using PHP and custom Adsense channels. For this to work, you’ll need a page that can execute PHP. For this tutorial, I’ll assume you’re using Wordpress.
(If you would like to use this tutorial, but can’t use PHP, I’ve included a Javascript example at the bottom of the post, which will also work great for testing different versions Adsense on your site.)
1) The first thing you’ll need to do is pick a location on your site where you want to test. You should pick a location where you are already running an Adsense ad.
For this test, we’ll be working with a leaderboard size ad in the the header of a page ( in wp, header.php), but you can do this anywhere you have an ad you’d like to test.
2) Create some custom Adsense channels. You do this in your Adsense account, under “Adsense Setup” > “Adsense for Content” area when you make new ads.
Lets keep this simple and start with only 2 channels, but once you get going, you can simultaneously test as many channels as you want to.
One of the ad variations should be the size and color configuration that you are currently using. This will be your control configuration, and you can compare all new configurations to it.
For the second channel/ ad, you should start with the current configuration, and make one change to it.
Here is our current configuration: Channel A, the control:
And here is channel B. I changed the border color from FFFFFF (white) to 999999 (gray)
You can pick whatever color you want. Don’t be afraid to try something different. That’s the point here.
You should have 2 ads now, each with their own Adsense channel, something like this:
<script type="text/javascript"><!--
//2007-010-28: test channel A
//-->
</script>
<script type="text/javascript"
src=" http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
And one for test Channel B:
<script type="text/javascript"><!--
//2007-010-28: test channel B
//-->
</script>
<script type="text/javascript"
src=" http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
3) Now we’re going to get started with the PHP. The script we’re going to use is very simple, and just randomly displays 2 different ads.
This is what it looks like before we add our 2 Adsense variations. Study it for a minute. Read the comments, and see if you can understand it.
<?php
$ad_num = rand(1,2); //create a variable, $ad_num, a random number between 1 and 2
$adsense_ad[1] = 'FIRST AD GOES HERE'; // holds our first ad
$adsense_ad[2] = 'SECOND AD GOES HERE'; // holds our second ad
echo $adsense_ad[$ad_num]; // prints or echoes our ad, depending on the random number
?>
And here’s what it looks like when we add our 2 Adsense ads.
<?php
$ad_num = rand(1,2); //create a variable, $ad_num, a random number between 1 and 2
$adsense_ad[1] = '<script type="text/javascript"><!--
//2007-010-28: test channel A
//-->
</script>
<script type="text/javascript"
src=" http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'; // holds our first ad
$adsense_ad[2] = '<script type="text/javascript"><!--
//2007-010-28: test channel B
//-->
</script>
<script type="text/javascript"
src=" http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'; // holds our second ad
echo $adsense_ad[$ad_num]; // prints or echoes our ad, depending on the random number
?>
4. Start Testing.
Open your header.php, and replace your existing Adsense ad with the new PHP test code.
5) Check your results to declare a winner
After a day or so of testing, you should be able to log in and check the results. You’ll have to go into the advanced reports section, and view the custom channel report. When doing tests like this, the more pageviews you have, the more accurate your test results will be. So if you don’t have a winner yet, wait a little longer.
6) Repeat
Choose the ad that performs best, and for the next test, create a new channel, make another change to the ad colors, and test it against the winner of the first test.
Adding more ad variations:
If you would like to, you can easily modify the script to add more than 2 ads, and If you can test on over 1000 pageviews per day, I’d definitely recommend doing this.
All you need to do is add more $adsense_ad array items, and adjust the rand() function (random number generator) so it returns a number in the range of the adsense_ad[] array.
For example. If I want to test 4 ads at once, I just change the second parameter in the rand() function to 4, and add 2 more $adsense_ad array items, that contain the new ads.
<?php
$ad_num = rand(1,4); //create a variable, $ad_num, a random number between 1 and 2
$adsense_ad[1] = 'FIRST AD GOES HERE'; // holds our first ad
$adsense_ad[2] = 'SECOND AD GOES HERE'; // holds our second ad
$adsense_ad[3] = 'THIRD AD GOES HERE'; // holds our third ad
$adsense_ad[4] = 'FOURTH AD GOES HERE'; // holds our fourth ad
echo $adsense_ad[$ad_num]; // prints or echoes our ad, depending on the random number
?>
Javascript Alternative
If you would like to try this, but can’t use PHP, here is a good Javascript alternative.
<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>
When using this template, remember to replace “//your first ad unit goes here” with your ad code inside the first set of <script></script> tags, like so:
<script type="text/javascript">
var random_number = Math.random();
if (random_number < .5){
//2007-010-28: test channel A
} else {
//2007-010-28: test channel B
}
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
The official Adsense blog has a little bit more on using the Javascript method, as well as more on A/B testing. See it here.
October 29th, 2007 at 10:12 am
Great stuff man. Keep those articles coming!
October 29th, 2007 at 2:58 pm
Simple but great code! However I think it is necessary to be patient and make testing during two weeks at least for more accurate results.
October 29th, 2007 at 9:49 pm
@fontadoni
Thanks. Will do.
@Omar
That’s a great point. The amount of traffic will determine how long you need to test for.
Wait until you have a few thousand pageviews.