![]() |
||||||||||
|
||||||||||
|
PHP: How to Test Google AdSense Ads and Improve Your Revenue Part 2This is a newer version of my free PHP script and tutorial for testing Google AdSense ads in order to help you identify which ad format performs better for you. How This Test Differs From Ad Test Part 1Testing Google Ads Part 1, tested an ad with a border versus an ad with no border.Part 2 tests different positions for your ad and content. I even use the code explained here to generate the ads at the top of this page. Refresh the page and you have a 50-50 chance of getting the alternate ad format. Part 2 uses the new format of implementing Google Ads. AdSense help has an overview of the new system. Ad Test Code Part 2Test Performance of Ad PlacementI read that ads placed in the top left corner of the content area (excludes navagation elements and identity/header sections) performed better than tall (skyscraper) ads along either side of the content. The top left region of the main content area is where a readers eyes go first.Part 2 tests two ways to place an ad at the top left region of the content. Though these two formats are not much different, they resulted in different click-through rates. I cannot say which one will work better for you. Your results will depend on your content and page design. Test and find out. Then modify the ads to test two other formats. Lets look at the two ads we are testing by looking at the Google ads above on this page. When the content starts below the ad, I refer to the layout as Format 2-A. When the content is positioned to the right of the ad, I refer refer to the layout as Format 2-B. Refresh this page in your browser. You have a 50-50 chance of getting the alternate ad layout. If you do not get a different layout, refresh again. If that still does not work, your browser might need a hard refresh. How the Ad Test Script WorksFirst, generate a random number of 0 or 1. Use this number to serve up one of two AdSense ads. When the number 1 is generated, run Format 2-A, else run Format 2-B.Notes:
Building the Code for Ad Test Part 2Log into your AdSense account and create 2 custom channels for your site. One channel for each format you are going to test. (Adsense help explains how to set up custom channels.)Next, in your AdSense account, generate the AdSense code for Format 2-A. Paste it in to your web page code. Then, back in AdSense, generate the code for your Format 2-B (using the second channel), selecting the custom channel you want. Copy and paste the scripts that Google generates into the sections of ad code code below, replacing your ads with mine.You will build something like the code below. Note: I used HTML tables to get the ad and content layout. I could have used stylesheets, but thought HTML tables were the easiest to explain and illustrate the concept.
<?php
srand(time()); //first generate the random number $random = (rand()%2); if($random == 1) //use Format 2-A { ?> <!-- start Google ad --> <script type="text/javascript"><!-- google_ad_client = "pub-2911253224693209"; google_ad_slot = "7837762649"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- end Google ad --> <?php } else //use Format 2-B ?> <table border="0" cellspacing="5" cellpadding="2" align="left"><tr><td> <!-- start Google ad --> <script type="text/javascript"><!-- google_ad_client = "pub-2911253224693209"; google_ad_slot = "0483297374"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- end Google ad --> </td></tr></table> <?php } ?> Let the ads run. Your reports should show roughly equal numbers for each ad being served up. When you determine which format is better, try changing another setting to see what will give you even better click-thrus and revenue. Download the code source (adtest2.txt) Related InformationAd Test Part 1 testing provides another example of testing Google ads as well as an introduction to testing ads.Notes about testing ads provides more insight into the testing process and a note about the fact that this PHP script complies with AdSense Terms and Conditions.
|
| © 1997-2008. astonishinc.com All Rights Reserved. |