AdSense Injector: automatic, no hassle insertion of AdSense ads in node content

The AdSense Injector module allows administrators to specify automatic insertion of AdSense ads into a node full-page view, or, if desired, after teasers in frontpage or taxonomy list views.

It provides centralized control of:

  • Ad format, channel, and group attributes for all inserted ads
  • Full control over allowed node types (for example, you can choose to never insert ads into image nodes, or forum nodes, etc.)
  • Minimum word count control for full-page node views: if a node doesn't have the minimum word count, ads won't be inserted.

AdSense Injector also respects the AdSense module visibility settings - if you have set visibility options in the AdSense module, AdSense injector will insert ads only into the paths you have chosen to allow.

Rationale

Why is this useful? In my experience, this simplifies certain important aspects of ad insertion and placement.

Traditional approaches:

  • Modify your theme's node.tpl.php or other template file(s) in order to inject ads on every node view.
    What happens if you have multiple sites or use multiple themes, or use custom per-node-type template files (node-book.tpl.php, node-image.tpl.php etc)? Now you have to edit, test, and maintain multiple template files, and, if the theme is updated to fix bugs, you have to merge in your changes.
  • Hand-edit each node content and use inline [adsense:x:y] inline filter tags.
    This gives tremendous flexibility in layout, but creates a maintenance nightmare if you should wish to alter your channel or ad layouts site-wide.
  • Use block insertion into the theme's template regions.
    This is great if your theme's regions provide the flexibility you want - it seems that themes vary somewhat in the regions they provide, and those regions aren't always in the places you want - so once again, you are back to tweaking theme template files if you want to place the ads near or in the content.

Usage

AdSense Injector uses (and requires) installation and proper configuration of the AdSense Module in order to function properly. Please install, configure, and test the AdSense module before you install Adsense Injector.

Examples

See it in use at http://exodusdev.com and http://www.roadcarvin.com

Coming soon:

  • Theming/CSS tricks
  • Examples
 
 

Drupal is a registered trademark of Dries Buytaert.