I am not sure Google Adsense is the right ad network for me. I'd like to experiment with a few other options.

I would like to setup another ad network, say Project Wonderful, and have my site display 50% of its ads through Adsense, and 50% through PW. What's the simplest way to achieve this?

  • Be careful doing ad rotation with AdSense. See the program policies, specifically: "Competitive Ads and Services: ...publishers may not display Google ads or search boxes on websites that also contain other ads or services formatted to use the same layout and colours as the Google ads or search boxes on that site..." (my emphasis on "same layout"). To me this means: If you have a banner area and rotate AdSense and other ads in it, you may be banned. And it's hard to get back in. Nov 21, 2010 at 17:20
  • That said, Google DFP seems to do exactly that, so... Nov 21, 2010 at 17:24

3 Answers 3


The simplest way is to use your server-side scripting language to randomly display either ad network one or ad network 2.

With PHP, you could do something like:

$random = array_rand(array('Google', 'Wonderful'), 1);

if ($random[0] == 'Google'){
    //Display the Google ad code here
} else {
    //Display the Project Wonderful code here

However, it's important to check the Terms of Use for each ad provider to see if the ad networks are compatible. Google, in particular, is a little feisty about what kind of ads they want used in conjunction with AdSense.

  • I ended up coding this in Javascript (I don't have the server side code). I was hoping for something a bit more "out of the box", perhaps a 3rd party site that does this sort of thing and allows for easier management of different ads.
    – ripper234
    Sep 6, 2010 at 19:56
  • @ripper234: If you're relying on JS anyway, then just use AJAX to read a text file on the server containing the script locations. Then when you need to add/remove/edit one of the ad network options, you just add it to the text file and don't have to touch any code. Sep 9, 2010 at 1:29

There are a number of 3rd parties that help manage and optimize advertising on your website:

The benefit of using these services is that 1) you only need to implement one set of tags on your website, and 2) they dynamically optimize your ad placements to select the ad network that will pay you the most revenue.


If you can't implement this in your server side code, you can use something like DoubleClick for Publishers (DFP) Small Business. It's a free hosted ad serving solution and will allow you to do exactly what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.