Extension:GoogleAdSense

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Google AdSense

Release status: unknown

Implementation Tag
Description This extension allows you add Google search, Google text ads with different Google channels.
Author(s) Paul Gu
Last Version 1.2 (January 06, 2007)
MediaWiki 1.8.2 and up
License No license specified
Download [1]
Example [2]

Contents

[edit] What's AdSense?

Google AdSense is the program that can give you advertising revenue from each page on your website—with a minimal investment in time and no additional resources.

AdSense delivers relevant text and image ads that are precisely targeted to your site and your site content. And when you add a Google search box to your site, AdSense delivers relevant text ads that are targeted to the Google search results pages generated by your visitors’ search request.

Details can be found at Google AdSense Tour.

[edit] What can this extension do?

This extension will allow you to add all types of Google AdSense as you need. It can display AdSense for content with specific channel, AdSense for search, and Referrals. Also you can put AdSense anywhere in your content page by using <google></google>.

Usage:

  • To display AdSense for search
    • <google></google> will show a Google search
    • <google>mediawiki</google> will show a Google search with "mediawiki" in the search field
  • To display AdSense for content
    • <google>WIKI</google> will display a WIKI channel
  • To display Referrals
    • <google>REF</google> will display a Google AdSense Referral on your web site. (i.e. <google>CH01</google>)

As you can see from the example, it's very flexible and easy to add any type of Google AdSense according your need.

The source code can be downloaded at paulgu.com, under projects

[edit] Installation&customization

Here are the very simple steps:

  1. Download the extension file, and unzip it into your extensions directory. It should create a folder called GoogleAdSense with files named GoogleAdSense.php and Settings.php.
  2. Add the following to the end of LocalSettings.php:
include_once('extensions/GoogleAdSense/GoogleAdSense.php');

To customize the extension, open the Settings.php file and replace $clientID with your client ID and add REF ID and channel IDs.


[edit] See also

Personal tools