Get best price on Apple iPhone 11 | ||||||||||||
|
||||||||||||
|
PHP: How to Test Google AdSense Ads (and Improve Your Revenue)Improve your Google AdSense revenue by using this simple, free PHP code to quickly test different ads and identify the better paying ones.
Why Test AdSense Ads?Change the settings your Google AdSense ads and you are likely to increase your revenue and click-thru rates. Google lets you vary many settings including colors of links, borders, text, backgrounds, as well as ad sizes and shapes. Furthermore, you have lots of choices about where to place the ads on your pages.You could run one type of ad for a few weeks, then modify it, run the changes for a few more weeks, and then compare results. That takes too long for me. I wrote this script for myself. It lets you test different formats simultaneously and start getting side-by-side results the same day. This article is written specifically for Google AdSense. You likely can modify it for other ad programs. To use it with other ad networks, focus on the the general approach explained here because it will likely apply to other advertisers. Notable Differences Between Version 1 (This Article) and Version 2The Nature of the Testing Code: Version 1 (this article) uses an older format of implementing Google ads. Version 2 uses the new format of implementing Google AdSense ads. Both formats work, but Google no longer provides the option to generate the old version of the ad code that is used and explained on this page 1. AdSense help has an overview of the new system.What is Tested: Version 1 tests an ad with a border versus an ad with no border. Version 2 tests different positions for your ad and content. How to Test AdsSelect Two Different AdsFor our example, we will test an ad block with a border vs. an ad block without a border. This page has a white background, so when I say no border I set the color of the border to white (RGB value of FFFFFF). To make your border disappear, set your border color to match your pages background color.Take a quick look at the two ads formats we are evaluating in our code before we get too deep into the explanation. Only the border color is different. Everything else remains the same so we do not confuse and confound the test. (The channel ID assigned by AdSense changes, but that is not part of the appearance of the ad. It is for your tracking purposes discussed below.) Here, we are testing border vs. no border. You could just as easily vary the color of the links, or color of the URLs, or size of the ad. Building the Ad Testing CodeLog 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.)In your web page, generate a random number of 0 or 1. We use this number to serve up one of two AdSense ads. When the number 1 is generated, display an ad with no border, else display the ad with a blue border.
<?php
srand(time()); $random = (rand()%2); ?> In your AdSense account, generate the AdSense code for the first channel. Our first channel has no (a white) border. Paste it in to your web page code. Then, back in AdSense, generate the code for your second channel, selecting the appropriate custom channel and setting the border color. You will build something like the following: To make it easier to see below, the border color we are varying is in bold text.
<?php
if($random == 1) //test with white border (no border) { ?> <script type="text/javascript"><!-- google_ad_client = "pub-2911253224693209"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel ="2621593367"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "0000CC"; google_color_url = "FFCC00"; google_color_text = "000000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <?php } else //test blue border around ads { ?> <script type="text/javascript"><!-- google_ad_client = "pub-2911253224693209"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel ="5760339755"; google_color_border = "336699"; google_color_bg = "FFFFFF"; google_color_link = "0000CC"; google_color_url = "FFCC00"; google_color_text = "000000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <?php } ?> Let the ads run. In your reports you will see roughly equal numbers of 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 (adtest.txt) View page with both ads showing so you can see the differences. How To Run More Sophisticated Tests of AdSense FormatsJust like we tested two different border colors, we could have varied another setting. For example, if you want to see whether black link titles perform better than blue, set one color:
google_color_link = "003366";
and a second color:
google_color_link = "000000";
You can run a more complex test, with, say, three options for a single variable. Modify the random number generating portion of the code to generate a 0, 1 or 2. You should test only one variable at a time (holding all other variables constant). If you test too many variables, you do not know what is performing better. When you get more comfortable with custom channels and with testing various ad formats, you can get more sophisticated with your tests and how you use my little PHP script. The type of test we just did is called an A/B test. If you are beefing up your dev skills or your resume, A/B testing is worth learning. In fact, I will write it up in a future tutorial. AdSense Terms and Conditions require not modifying the JavaScript or other programming provided to You by Google in any way. The above ad test does not modify Googles code. We are simply randomly serving up one of two scripts. When you look at the HTML source for each format that PHP generates, the scripts are exactly what AdSense generates. We have not modified Google JavaScript or programming in any way. Ad Testing Code Version 2Version 2 provides code, examples and an explanation for how to test the performance of your ads with different positions for your ad and content.
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |