inicio mail me! syndicate

How to share Google Adsense revenue with your Wordpress authors

Before we get started I want to make it clear that this is a method for dummies. There are no files to download, no big fancy template changes or anything. No, this is a simple php command that rotates the Google Adsense client ID.

If you’re on the hunt for a plugin to do this, you can try this one. The AdSense Sharing Revenue and Earnings System looked brilliant and from reading the features I was certain it was exactly what I needed. The problem is the download doesn’t seem to work. I followed the instructions perfectly and the plugin simply will not show up in the admin panel. Being a guy who doesn’t have a lot of time in life… I moved on.

I needed something fast and simple. Something the every day blogger using Wordpress would understand and implement with little or no effort. After sifting through several forum threads, talking with folks back and forth via private message, and searching the heck out of the Internet I think I might have found a simple solution.

I can’t guarantee this will work for you, but it certainly worked for me and I was amazed at how simple it is. So far it also appears to be totally legit with the Adsense TOS. I even contacted the Adsense team and everything is a green.

OK, let’s get started!

Basically, you’re going to add a simple php command into your php template anywhere before the Adsense code.

This is the small bit of code you want to add into your page templates.

if (rand(1,2) == 1) {
$adsenseid = "pub-123456789";
} else {
$adsenseid = "pub-987654321";
}
?>

–MAKE SURE YOU PUT THE CODE BEFORE THE ADSENSE CODE–
On the blog I used to test this I had the Adsense code in the sidebar. Because it was in the sidebar I needed to find the sidebar php line and put the new rotator code in before it.

Then you have $adsenseid which is either yours or your other author’s adsense ID so you can insert it in the adsense code:

Your Adsense code should look like this:


google_ad_client = "Adsense id command goes here";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";

That’s it that’s all! Now your blog should be rotating ads with a 50/50 split between the two authors. You can also add more than two client id’s so having multiple authors is not a problem.

The only downside to this method is it doesn’t give your authors any control over the client ID or any stats. In my opinion though, it’s worth it if you’re on the hunt for a quick and easy fix.

My first concern was that it was against TOS where it says something along the lines of “though shalt not edit Adsense code”. However, we’re actually just taking one part of the code, in this case the client ID, and putting it into a different file. This is why to date this method is acceptable.

That concern is now gone and we rotate Adsense on a plethora of blogs that I manage.

Hope this helps!

-Eric

Hawaii SEO said,

October 31, 2006 @ 3:03 pm

Brilliant!

ZNITCH Search Engine 2.0 said,

November 10, 2006 @ 12:03 am

AWESOME! so then…

how do i do the 50 50 adwords split based on WHO WROTE a story. imagine i have 99 authors who all write at different volume. nobody writes exactly the same amount as the next guy. so we have to do the php based on author

RSS feed for comments on this post · TrackBack URI

Leave a Comment