As you know ad blindness is one way a site can lose money. Visitors to a site get used to the stationary colors of an ad, then over time they don’t notice the ad anymore compared to everything else on the site.

I wrote a similar article dealing with Auction Ads in reversing ad blindness. Now, I’ll show how to do it with AdSense in WordPress.

Google doesn’t allow any modifications of their code so, we can’t actually go into the AdSense code and insert a custom PHP code. Instead, we’ll take the long route and do it on the safe side so, we won’t have to piss off Google.

Take a look at an AdSense code below. I circled the format size of the ad in red and I circled the header link code in orange. In this method, you’re going to be using multiple AdSense blocks so, make sure all of the ad codes are in the same format. When using multiple AdSense codes, pay attention to the google_color_link line, make sure each code has a different color of your choice in that line.

Plug-ins Required
You thought you wouldn’t have to use any plug-ins, huh? Lolz, we’re going to need plug-ins. We need two plug-ins to make this method easy as possible

The first is the Exec-PHP. That plug-in is required to call a PHP function within the post, to call up the AdSense code. In WordPress you cannot enter <?php ?> so, we need that plug-in.

The second plug-in that’s required is none other than the popular AdSense-Deluxe, thank you Acme Technologies.

Install the Plug-ins
Upload the plug-in files to wp-content/plugins directory in your WordPress server and activate them in your WordPress admin’s page.

Setup the Ads
Now that we have both plug-ins installed, it’s time to set up the AdSense ads. In your WordPress admin page go to Options > AdSenseDeluxe. On that page choose “Add New”; take a look at the image below.

 

Insert your AdSense code in the white box underneath where it says “AdSense code”, duh :P. Take a look at the code below. As you can see I added few other codes before and after the AdSense code, so words would wrap around the ad. You don’t have to add the extra code, you can just add the AdSense code, but it looks better if you have the words wrapped around.

<table align="right"><tr><td>
<script type="text/javascript"><!–
google_ad_client = "Your AdSense code";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250×250_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "003366";
google_color_text = "000000";
google_color_url = "7F7F7F";
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td></tr></table>

After you have done that, on the far left box give that AdSense code a name, where it says “Name”; as you can see I’ve chosen “adblock1″ for the name. After you have done that, on the far right side click on the button where it says “Add AdSense Block”.

Now that you have added your first block, do it again four times, but every other time make sure a different color is chosen in the google_color_link line (ex. 000080, 880000, etc). By doing so, every other ad block will have a different link color. Also give similar names to each ad with sequencing numbers such as “adblock2″, “adblock3″, “adblock4″, “adblock5″.

Now, when you are writing a post, insert the following code in the beginning of your post.

<?php
$title[0] = "1"; // AdSense 1
$title[1] = "2"; // AdSense 2
$title[2] = "3"; // AdSense 3
$title[3] = "4"; // AdSense 4
$title[4] = "5"; // AdSense 5

$randomize = rand(0, 4); // Change four to how many arrays you
have

?>

Then insert the call code
<!–-adsense#adblock<?php echo ($title[$randomize]); ?>–->
within your post, and you should see your ad block come up with random colors.

If you gave your AdSense ads names other than the ones I recommended, adblock1, adblock2, etc. then place those names after the “adsense#” call code. If you didn’t give your AdSense ads different names then stick with the exact code from above.

To see an example of what I’ve done, refresh this page to see the random colors on the ad at the beginning of this post. If you don’t see any ads then click on the title of this post to see it on a single page.

This doesn’t have to be within any posts, you can display AdSense ads with random colors in your blog’s sidebar if you wish. I hope this helps, try it out. Tell me what you guys think.


Like this article? Subscribe to the RSS feed! Like this article? Subscribe to the FULL RSS feed!
Add to Technorati Favorites Or add this site to Technorati Favorites

9,083 Views