Tuesday 13 July 2010

How To: Monetize Your Wiki with Google's AdSense

A popular method of monetizing Wikis, and websites in general, is by adding Google's AdSense advertising units, which opens up the very common question: How do I add AdSense units to my Wiki? As far as I'm aware there is no *official* Google extension to allow the displaying of AdSense units (If you know of one please do leave a link in the comments to this post!) but there are several extensions available that do the job:

To download Extension:Google Adsense 2 click here and download the compatible package for your MediaWiki version from the drop-down box. Once you've downloaded the package, unzip it and upload it to your Wiki's /extensions folder. Once uploaded copy the following code to the bottom of your LocalSettings.php file:

require_once( "$IP/extensions/GoogleAdSense/GoogleAdSense.php" );
$wgGoogleAdSenseClient = 'replace this with the client name';
$wgGoogleAdSenseSlot = 'replace this with the slot name';
$wgGoogleAdSenseID = 'replace this with your ID';

If installed correctly, the extension should appear on the Special:Version page on your Wiki.

No comments:

Post a Comment