Overview') ."\n"; $output .= t('

This module provides web site admins the factility to display Google AdSense ads on their web site, thus earning revenue.

') ."\n"; $output .= t('

Prerequisites

') ."\n"; $output .= t('

You must have a Google AdSense account before using this module. If you do not have an account, then please consider using the modules author\'s referral link, which provides us with a referral fee from Google at absolutely no cost to you. This page also contains various useful links and resources on AdSense, and how to optimize your site for it.

', array('!url' => 'http://baheyeldin.com/click/476/1')) ."\n"; $output .= t('

Supported formats

') ."\n"; $output .= t('

The following ad formats are supported:

') ."\n"; $output .= $formats ."\n"; $output .= t('

Configuration

') ."\n"; $output .= t('

To use this module, you need to do the following first:

') ."\n"; $output .= "\n"; $output .= t('

Displaying AdSense ads

') ."\n"; $output .= t('

There are several ways to display ads, summarized as follows:

') ."\n"; $output .= t('

Ads can be displayed in pre-defined blocks, in custom blocks, in content or in any phptemplate based theme.

') ."\n"; $output .= t('

Using blocks

') ."\n"; $output .= t('

The easiest way to get started with this module is to use one or more of the pre-defined blocks.

') ."\n"; $output .= t('

Visit the blocks configuration page, and click on the configure link of one of the AdSense blocks. You must select a format, a group, and a channel.

', array('!url' => url('admin/build/block'))) ."\n"; $output .= t('

Enable the block, and specify a region for it to be displayed in.

') ."\n"; $output .= t('

Using custom PHP code

') ."\n"; $output .= t('

To display ads, you call the function @function and supply it with the following arguments.

', array('@function' => 'adsense_display()')) ."\n"; $output .= "\n"; $output .= t('

To display ads in blocks, add a new block, make its type "PHP", and enclose it in PHP tags.

') ."\n"; $output .= "
\n";
  $output .= "print adsense_display('120x600', 1, 2);\n";
  $output .= "
\n"; $output .= t('

If you want to make sure that you do not get errors if the AdSense module is accidentally disabled or deleted, then use the longer form:

') ."\n"; $output .= "
\n";
  $output .= "if (module_exists('adsense')) {\n";
  $output .= "  print adsense_display('120x600', 2, 4);\n";
  $output .= "}\n";
  $output .= "
\n"; $output .= t('

Using themes

') ."\n"; $output .= t('

You must use a phptemplate-based theme to display ads from within the theme. This requires some familiarity with PHP. Edit the appropriate .tpl.php file in your theme directory, and add:

') ."\n"; $output .= "
\n";
  $output .= "print adsense_display('468x60');\n";
  $output .= "
\n"; $output .= t('

Make sure you enclose it in PHP tags.

') ."\n"; $output .= t('

You could also use the longer format that protects you against deleting or disabling the module:

') ."\n"; $output .= "
\n";
  $output .= "if (module_exists('adsense')) {\n";
  $output .= "  print adsense_display('120x600', 2, 4);\n";
  $output .= "}\n";
  $output .= "
\n"; $output .= t('

Using tags

') ."\n"; $output .= t('

The tags feature allows placement of ads anywhere in the content. Please note that content here means any part that is passed through Drupal\'s filter system. Text in the slogan, mission, and footer is normally not filtered the same way as text in nodes, so you cannot put tags in those places.

') ."\n"; $output .= t('

To enable the tags feature, you have to enable the "AdSense tag" filter in the input format you are using (such as Full HTML or Filtered HTML) from Administer -> Site configuration -> Input formats. Then you have to insert the appropriate tag in your node where you would like the ad to appear.

') ."\n"; $output .= t('

Note that filters sometimes may have conflicts, and changing the order can make AdSense work in some cases.

') ."\n"; $output .= t('

The tag syntax comes in these variants:

'); $output .= t('
1. [adsense:format:group:channel]
') ."\n"; $output .= t('

Where:

') ."\n"; $output .= "\n"; $output .= t('

All fields are required, unlike when using the @function function above.

', array('@function' => 'adsense_display()')) ."\n"; $output .= t('

Example:

') ."\n"; $output .= "
[adsense:468x60:1:2]
\n"; $output .= t('

Display a 468x60 banner with the colors defined in group 1, and with channel ID 2

') ."\n"; $output .= t('
2. [adsense:block:block_id]
') ."\n"; $output .= t('

Where:

') ."\n"; $output .= "\n"; $output .= t('

This allows more fine grained visibility control via the block mechanism. The block does not need to be enabled, and therefore will be hidden from the sidebars and other regions. The title of the block will not be displayed.

') ."\n"; $output .= t('

All fields are required.

') ."\n"; $output .= t('

Example:

') ."\n"; $output .= "
[adsense:block:7]
\n"; $output .= t('

Display the ad code of the block with ID 7.

') ."\n"; $output .= "\n"; $output .= "
3. [adsense:flexiblock:location]
\n"; $output .= t('

This is provided for backward compatibility, but will be deprecated in a future release. Use the normal block filter instead.

') ."\n"; $output .= t('

Where:

') ."\n"; $output .= "\n"; $output .= t('

All fields are required.

') ."\n"; $output .= t('

Example:

') ."\n"; $output .= "
[adsense:flexiblock:2]
\n"; $output .= t('

Display the contents of the flexiblock in location 2

') ."\n"; $output .= t('

Revenue sharing

') ."\n"; $output .= t('

For revenue sharing, each author gets a predefined share of ad revenue from clicks occuring on nodes they authored.

') ."\n"; $output .= t('

In order for the user to be credited they must have a Google AdSense account. As a site admin, please advertise the module author\'s referral link, which provides us with a referral fee from Google, at absolutely no cost to you. This page also contains various useful links and resources on AdSense and how to optimize your site for it.

', array('!url' => 'http://baheyeldin.com/click/476/1')) ."\n"; $output .= t('

Each user must enter their Google AdSense client ID in the profile field you defined above.

') ."\n"; $output .= t('

AdSense clicks

') ."\n"; $output .= t('

AdSense clicks are now tracked, and the IP address and timestamp are recorded for each click. This should help with fraud detection. There are three reports under Administer -> Logs: the default one shows click details, "By date" shows the number of clicks per day by day, and "Top pages" shows the top pages of a site that get clicks, the total number of clicks it got, and the last click date/time.

') ."\n"; $output .= t('

Note that there are some potential limitations with click tracking:

') ."\n"; $output .= t('