I am looking for a code so me and my partner can share adsense, since adsense don't allow 2 accounts..
You could always just set up channels or just use php $oddarray = array(1,3,5,7,9); $rand = rand(0,10); if(in_array($rand, $oddarray)){ $adsenseid = 'insertidhere'; } else { $adsenseid = 'insertidhere'; } PHP: If you have this query in your header file and then when you copy the code from google you can just change the bit that says publisherid to <?php echo $adsenseid; ?> and you have a 50/50 chance of which publisher id will be used.
Sorry yeah I forgot the adsense code was a JS What you would need to do in this case is copy the full adsense script for each account and put that in the if statement. So in pseudo code it would be <?php if(in_array($rand,$oddarray)){ ?> full adsense script from account a <?php } else { ?> full adsense script from account b <?php } ?> PHP: