# The REAL Way to Optimize AdSense

Optimizing the position, color, and size of AdSense Ads is confusing. The REAL way to optimize AdSense for clicks and revenue is using variations and measuring the results. Surf this site for examples.

For this article we will be using these 5 channels to measure our Ads performance (create channels). To keep things simple, we will only be dealing with 1 Ad. On this site, it is the Ad displayed at the top of each single post.

1. aa-left: Applied to Ads positioned on the LEFT. (5425469877)
2. aa-right: Applied to Ads positioned on the RIGHT. (8764678159)
3. aa-green: Applied to Ads using the color GREEN. (1086701393)
4. aa-blue: Applied to Ads using the color BLUE. (4994136137)
5. aa-red: Applied to Ads using the color RED. (7420006237)

The italicized number above is the numerical name for the channel, this is what is used in the AdSense javascript.

Each Ad will be positioned on the left or the right, and will also be using 1 of the 3 color channels. Separate multiple channels with a +, so an Ad on the left and using the color green would have this code:

On this site the AdSense javascript code is placed inside a <div></div> block that has a class of "FR" or "FL" which determines whether the ad floats to the right or floats to the left.

<div class="FL">
</div>

<div class="FR">
</div>

So for my site, I edited the single.php WordPress Theme File so that if the post ID is an even number the position is on the left, and if the post ID is an odd number the Ad position is on the right. Here is the code to determine if its odd or even.

<?php
\$className='FL';

if((\$post->ID % 2) == 0) {
\$className='FR';
}
?>

The color of the Ad is randomly generated using this code.

<?php
\$CPD=rand(1,3);
if(\$CPD==1) { // blue
}
else if(\$CPD==2) { // green
}
else { //red
}
?>