Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides a system for managing and displaying advertisements on your website. It allows you to set up different ad placements, schedule when ads should appear, and track their performance with statistics on impressions and clicks. Expired ads are automatically unpublished.

Basic Ads

This module was developed with the help of Claude AI (from Anthropic).

Provides ad management with placements, scheduling, and display blocks. Includes impression and click tracking with a statistics dashboard, and automatically unpublishes expired ads via cron.

Submit bug reports and feature suggestions, or track changes in the issue queue.

Requirements

This module requires no modules outside of Drupal core.

It depends on the following core modules: Node, Taxonomy, Datetime, Image, Text, Link, Views, and Block.

Installation

Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.

On installation the module will automatically create:

  • A "Basic Ad Placement" taxonomy vocabulary with default terms (Header, Sidebar, Footer, Content Top, Content Bottom)
  • A "Basic Ad" content type with image, link, placement, scheduling, and weight fields
  • A "Basic Ads" View with a block display for placement-based rendering
  • Database tables for impression and click tracking

Configuration

  1. Go to Administration > Structure > Taxonomy > Basic Ad Placement to add, edit, or delete placement terms.
  2. Go to Administration > Content > Add Content > Basic Ad to create an advertisement. Assign one or more placement terms.
  3. Go to Structure > Block Layout and place a "Basic Ad block (by placement)" block in the region of your choice. Select a placement term to filter which ads display, and choose how many ads to show in the "Number of ads to display" field (1–50, default 1). The placed block's admin label is auto-set to Basic Ad: {placement name} so you can tell placements apart at a glance on the Block Layout page.
  4. Go to Administration > Configuration > System > Basic Ads Settings to exclude roles from ad tracking.
  5. Go to Administration > Reports > Basic Ad Reporting to view ad statistics including impressions, clicks, and CTR.

Weighting and rotation

Each ad has a Weight field (range −50 to +50, default 0). Lower weight means higher priority — standard Drupal weight semantics. Each 10 units of weight roughly halves or doubles an ad's relative odds of being picked when there are more eligible ads than the block's "Number of ads to display" setting. Equal weights give a uniform random selection. The selection is cached for 60 seconds and rotates to a new random subset in the next minute, so different ads surface over time without breaking page caches.

Scheduling

  • Leave Start Date empty for immediate display, or set a future date.
  • Leave End Date empty for no expiration, or set an end date.
  • Expired ads are automatically unpublished by cron.

Tracking and privacy

  • Impressions are tracked client-side via JavaScript when ads render in a placement block.
  • Clicks are tracked server-side through a redirect endpoint.
  • IP addresses are automatically anonymized (IPv4 last octet zeroed, IPv6 truncated to 48 bits).
  • Old tracking data (older than 1 year) is automatically purged via cron.
  • You can exclude specific roles (e.g. authenticated editors) from impression and click tracking via Configuration > System > Basic Ads Settings.

Troubleshooting

Ads not displaying:

  • Check that ads are published.
  • Verify the ad placement term matches the block configuration.
  • Check start/end dates are correct.
  • Ensure the block is placed in a visible region.
  • Clear Drupal cache.

Impressions not tracking:

  • Check the browser network tab for /ad/view/ requests to verify the tracking library is loading.
  • Ensure the ad has a placement (tracking only fires when a placement is present).
  • Check that the current user's role is not excluded in Configuration > System > Basic Ads Settings.

Schedule not working:

  • Ensure cron is running regularly for expired ad cleanup.
  • Check your site's timezone settings.
  • Clear cache after changing dates.

Maintainers

Activity

Total releases
19
First release
Dec 2025
Latest release
6 days ago
Releases (12 mo)
19 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.5.0 Stable Jul 11, 2026
1.4.4 Stable Jul 11, 2026
1.4.3 Stable Jun 11, 2026
1.4.2 Stable Jun 5, 2026
1.4.1 Stable Jun 5, 2026
1.4.0 Stable May 28, 2026
1.4.x-dev Dev May 28, 2026
1.3.2 Stable May 22, 2026
1.3.1 Stable May 16, 2026
1.3.0 Stable May 7, 2026
1.2.0 Stable May 7, 2026
1.1.5 Stable Apr 28, 2026
1.1.4 Stable Mar 24, 2026
1.1.3 Stable Mar 24, 2026
1.1.2 Stable Jan 23, 2026
1.1.x-dev Dev Jan 4, 2026
1.1.1 Stable Jan 1, 2026
1.0.1 Stable Dec 5, 2025
1.0.x-dev Dev Dec 5, 2025