Skip to main content
Home

idFlorin – TinyDrop Modules

Main navigation

  • Home
  • Tinydrop Modules
  • Custom Modules
User account menu
  • Contact

Breadcrumb

  1. Home
  2. Custom Modules
  3. Statistics Counter for Drupal 11: Free Analytics Upgrade

Statistics Counter for Drupal 11: Free Analytics Upgrade

Statistics Counter for Drupal 11: Free Analytics Upgrade
Statistics Counter for Drupal 11: Free Analytics Upgrade

If you're building with Drupal 11 and want flexible, modern page view tracking, you may have noticed that the version of the Statistics Counter module on Drupal.org is only compatible with Drupal 10. Fortunately, a Drupal 11–ready version is now available for free on GitHub, offering enhanced architecture, modern PHP practices, and seamless integration with Drupal's event and service systems.

What Is the Statistics Counter Module for Drupal 11?

This enhanced version of the Statistics Counter module is built specifically for Drupal 11 and is not available on Drupal.org. It provides a developer-focused foundation for tracking node views using Symfony Event Subscribers and Drupal’s service container.

Unlike the Drupal 10 version, this fork or reimplementation supports the latest changes in Drupal 11, offering better long-term support and adherence to modern best practices.

Key Features

  • Drupal 11 Compatibility: Fully updated to work with Drupal 11 core and PHP 8.2+.
  • Event-Driven View Tracking: Listens for node view events via StatisticsCounterSubscriber.php.
  • Views Integration: Use statistics_counter.views.inc to display view counts in Drupal Views.
  • Service-Based Architecture: Clean statistics_counter.services.yml for dependency injection and overrides.
  • Modern Composer Support: Easily integrated into your Composer workflow.
  • Free and Open Source: Download from GitHub, licensed under GPL.

How It Differs from the Drupal.org Version

FeatureDrupal.org VersionGitHub Version
Drupal 11 Compatibility❌ No✅ Yes
Event Subscriber Support❌ Limited✅ Full
Modern PHP Practices❌ Older✅ PSR-4, Symfony
MaintainerCommunityidflorin
Download LocationDrupal.orgGitHub

Note: If you’re running Drupal 11, do not install the Drupal.org version—it may not function properly or even install cleanly.

Installation Instructions

  1. Clone the module into your custom modules directory:

    git clone https://github.com/idflorin/statistics_counter.git web/modules/custom/statistics_counter
  2. Enable the core Statistics module:

    drush en statistics
  3. Enable the Statistics Counter module:

    drush en statistics_counter
  4. Customize the StatisticsCounterSubscriber.php file to define your custom logic.
  5. Use Drupal Views to display and sort content by view count.

Use Case Ideas

  • Trigger Events Based on View Count: Alert or flag content when it crosses a threshold.
  • Highlight Popular Content: Show “Top Articles This Week” using Views.

Final Thoughts

The GitHub-hosted version of the Statistics Counter module is a must-have for Drupal 11 developers who need customizable, reliable, and modern content view tracking.

Unlike the outdated Drupal.org version, this implementation embraces Drupal 11’s architectural improvements—like services, events, and dependency injection—to give you total control over how views are counted and acted upon.

Ready to upgrade your content analytics in Drupal 11?

Download the module from GitHub

and start building smarter view tracking today.

Image gallery
Statistics Counter for Drupal 11
Statistics Counter for Drupal 11

Tags

  • Statistics Counter
  • Drupal 11 page views
  • Drupal content tracking
  • Drupal 11 statistics module
  • Custom Drupal Modules
  • Drupal 11 Statistics Counter Module
  • Drupal 11

Category

  • Custom Modules
  • Add new comment
By idflorin , 30 May 2025

Latest news

How to Build a Minimal Drupal 11 Module from Scratch
Node Body Validation Module: Born from Necessity, Built for Control
Manually Install APCu for PHP 8.4 in aaPanel (Ubuntu 22.04)
Simplify Your Drupal Media Workflow: The Image Alt to Title in Media Image Module
How to Apply a Patch to a Drupal 11 Module Using Composer

Pagination

  • 1
  • Next page
Syndicate

Footer

  • Contact
Powered by Drupal