Manage ad zones, rotate ad blocks by weight, schedule campaigns, and track impressions and clicks. Supports image banners, raw HTML/JavaScript snippets, and Google AdSense units.
- Ad zones — named placement areas identified by a slug (e.g.
sidebar-top,after-content) - Three placement modes — manual (call from template), after paragraph N, or any registered hook point
- Ad blocks — image, HTML/script, or Google AdSense per zone; multiple blocks rotate by weight
- Scheduling — optional start and end dates per block; blocks outside their window are silently skipped
- Weighted rotation — assign higher weight to blocks that should appear more often
- Impression and click tracking — atomic counters; click tracking via redirect (
/ads/c/{id}) - Reports dashboard — all-time stats per block with CTR; overall summary totals
- Settings hub card — quick stats in the admin settings hub
- Contensio CMS core
- PHP 8.2+
- Laravel 11+
-
Require the package:
composer require contensio/plugin-ads-manager
-
Run migrations:
php artisan migrate
-
The plugin registers itself automatically via the Contensio plugin system.
{!! \Contensio\AdsManager\Support\AdManager::render('sidebar-top') !!}Replace sidebar-top with the slug of your ad zone.
When creating or editing a zone, set Placement to After paragraph and enter the paragraph number. The plugin hooks into contensio/content/body and injects the ad after the Nth closing </p> tag in post content automatically.
Set Placement to Hook and enter any registered CMS hook name (e.g. contensio/frontend/post-after-content). The ad renders wherever that hook fires.
| Type | Description |
|---|---|
| Image | An <img> tag rendered from a URL; optionally wrapped in a click-tracking link |
| HTML / Script | Raw HTML or JavaScript pasted directly, rendered as-is |
| Google AdSense | Paste your AdSense <ins> unit; impression tracking is skipped (Google handles it) |
Clicks are tracked via a redirect: /ads/c/{blockId}. The block's click_count is incremented atomically, then the visitor is redirected to the destination URL (302). This route requires no authentication.
| Table | Description |
|---|---|
contensio_ad_zones |
Zone definitions: name, slug, placement config |
contensio_ad_blocks |
Block content, weight, schedule, impression and click counters |
AGPL-3.0-or-later. See LICENSE.