Hi all, this is my first post but I've been lurking for some time and learning a lot

I couldn't see an area of the forum dedicated to testing so posted this here.

So here's the problem I am facing.

I run about half a dozen Word Press blogs that are monetized with Adsense. I want to split test variations of ads in real time. (I used to split test by running variations for a week recording the results in a spreadsheet and then testing a variation but this wasn't all that accurate as condition can change over the course of a week).

I have tried a couple of scripts to do this using javascript e.g.

<script type=”text/javascript”>
var random_number = Math.random();
if (random_number < .5){
//your first ad unit code goes here
} else {
//your second ad unit code goes here
<script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>

I've also tried another version using PHP which essentially does the same thing but I can't insert either of these directly into a Word Press post or page, as it strips the formatting. I've also tried about a dozen insert javascript plugins today but nothing worked.

I have seen themes that can do this but they don't offer ad placements within content just top of page, bottom of page and sidebars. Personally I have found ads under the first paragraph and near the end of an article do much better.

I don't really want to run multiple pages and serve the ads 50/50 just to test Adsense ads. Just wondering if anyone had any suggestions.