hi,
PHP Ad Rotator for Integrating Google AdSense with Other Affiliate Programs
I'm offering the source code of a PHP ad rotator below that I wrote to provide more flexibility in optimizing revenue across my blogs and Web sites. Google AdSense is a great program, but what if its ads aren't actually the most financially profitable for my Web sites? What if the ads Google serves up aren't as fresh or interesting as I'd like? What if I want to experiment with mixing ads from the Amazon Affiliate program or NetFlix ads from LinkShare or SpamArrest? What if I want to vary the percentage mix in response to click through reports to increase my returns?
Basically, here are a few AdSense limitations that I wanted to work around:
1. I wanted to integrate rotation of ads from multiple affiliate programs such as LinkShare, CommissionJunction and Amazon to keep ads fresh and optimize revenue from each program
2. I wanted to control and easily adjust the proportion of delivery of ads from individual programs to increase the frequency of profitable ad programs
3. I wanted to deliver ads in different proportion to several different Web sites and blogs that I operate e.g. NewsCloud, Idealog and CommonBits including blogs operated at template-based services such as TypePad. I also wanted to have different ad frequency and ad mix for different sites.
4. I wanted to more flexibly control the size of ads and add or remove ads
5. I wanted to insert my own house ads into my ad mix
6. I wanted to avoid substitution of free charitable ads on my sites
So, I created a PHP class (adServer.class.php) which essentially does everything above and a static PHP file (staticAd.php) that would deliver ads to external Web sites via Javascript or HTML for iFrames.
Now I can review my affiliate reports at the end of the month and increase the percentage delivery of the most profitable programs while easily adding in new ads, removing stale ads while keeping the rotation of my ads fluid and diversified - rather than beholden to a single vendor.