Get best price on Unlocked Moto G Stylus | ||||||||||||
|
||||||||||||
|
PHP: How to Test Google AdSense Ads & Improve Your Revenue (Version 2)This free script quickly identifies which Google AdSense formats result in better revenue and higher click-thrus. It tests
different ads simultaneously so you can start getting side-by-side results the same day. Many sites, including Google,
recommend you test your ads to find the best performing ones for your site. You could run one type of ad for a few weeks, then
modify it, run the changes for a few more weeks, then compare results. That takes too long. Use this script.
How This Test Differs From Ad Test Version 1The script in testing Google Ads Version 1 tested an ad with a border versus an ad with no border. The tutorial and code are still good and can be used. It remains a helpful example.Version 2 (the script on this page) tests different placements (ad locations) on the page for your ad. 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. Version 2 uses the new format of implementing Google Ads. AdSense help has an overview of the new system. How To Test AdSense Ads (Version 2)Test Performance of Ad PlacementI read that ads placed in the top left corner of the content area (content area excludes navagation elements and identity/header sections) performed better than tall skyscraper ads along the left or right side of the content. Tests have shown that a readers eyes go to the top left region of the main content area first.This script tests two ways to place an ad at the top left region of the content. Though these two formats are not much different, I found they resulted in quite different click-through rates. No one say which one will work better for you. Your results will depend on your content and page design. Use my script to test and find out. You will know quickly. You can even use it for another test by picking different two things to test against each other. Lets look at the two ads we are testing by looking at the Google ads above on this page. For content starting below the ad, I refer to the layout as Format 2-A (meaning, test ads version 2 - format A). For content to the right of the ad, I refer to the layout as Format 2-B (meaning, test ads version 2 - format 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, it generates a random number of 0 or 1. 50-50 chance of either. The script uses 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 Testing Ads (Version 2)Log 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 my ad code and publisher ID with yours.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 a different AdSense setting to see what will give you even better click-thrus and revenue. Grab the source code here (adtest2.txt) Related InformationAd Test Version 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.
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |