Posts Tagged ‘videoegg’

Optimizing Advertising for Social Networks

Thursday, April 17th, 2008

This comes from an interesting post by Jesse Farmer. There is no clear winner amongst ad networks for social applications on Facebook, MySpace, etc. The only real way to know is to find out for yourself.

Using PHP, you can randomly show ad codes from multiple ad networks with equal probability. Check the cash and find out which works best for you!

function get_random_ad_code() {
    $ad_codes = array(
        'lookery'     => 'Your Lookery ad code',
        'adblade'     => 'Your AdBlade ad code',
        'socialmedia' => 'Your SocialMedia ad code',
        'rockyou'     => 'Your RockYou ad code'
    );

    return $ad_codes[array_rand($ad_codes)];
}

echo get_random_ad_code();

If you want to take it to the next level, you can write more complex algorithms to weigh the ads in favor of the network that works best for you, but that’s outside the scope of this article (for now.)