This module provides web content providers with the means to earn revenue from visitors by displaying ads from Google AdSense™ advertising service on their sites.

Why should you use it:

  • AdSense for Search and Drupal are incompatible as both use the 'q' query for different purposes. Using this module, you can display the search results in your site.
  • The module provides easy-to-use ad blocks.
  • You can easily disable the ads for certain roles.
  • Provides simple controls for troubleshooting the ads before going live with the site.
  • If Google changes some minor details in the script, your code can be updated site-wide just by upgrading the module.
  • Protects you from displaying more ads in a page than the maximum allowed by Google (check current disabled)
  • If you want to do ad revenue sharing, there's really no other option

Why shouldn't you use it:

  • Strictly speaking, this module is not in compliance with the AdSense TOS, since you're not exactly copy-pasting the script code in your site. No one has ever reported being banned because of using this module, and Google knows of its existence, and seem not to mind.

Drupal 8

The Drupal 8 version abandons the sub-modules approach of previous versions, as it is expected that the class loader will not load unnecessary classes.

At this moment, the following already works:

  • Page-level ads
  • Content ads using the current ad code (post 2007)
  • Custom Search engines
  • Old code content ads (pre 2007)
  • Old code search
  • Upgrading config settings from Drupal 7 to Drupal 8

The following does not work yet:

  • Revenue sharing
  • Upgrading blocks from Drupal 7 to Drupal 8

Drupal 7

The Drupal 7 module is composed by the following sub-modules:

  • AdSense core: Common module stuff. Required, but useless without an ad generator module.
  • Managed ads: Ad generator that produces the same ad script code as currently generated by Google.
  • CSE Search: Generates a Custom Search Engine form and the results page.
  • Ads (old): Ad generator using the old script generated by Google upto 2008, but which is still supported by Google for displaying ads.
  • Search (old): Generates a Search form and the results page using the old method which allowed the user to select the domain being searched.
  • Revenue sharing (old): Enables the site owner to share the revenue between page authors in a configurable percentage. Only works with the old ad generator modules.

The module provides an API for selecting the publisher ID to be used to display ads.

Please read the README.txt that is included in the module for more details.

Modules used (when available)

User Referral


Initial development by Khalid Baheyeldin of Many enhancements by João Ventura.

Google™ and AdSense™ are registered trademarks of Google, Inc.

Project information