This module uses AJAX to count file downloads. It's optimized for medium to large sites (such as my own site, OpenGameArt.org) where the total number of file downloads might be in the hundreds of thousands or even millions. Using this module has some advantages and some limitations versus other methods of counting downloads:

Advantages

  • No redirect is required, and file download links are never changed, which means the user won't need to rename their file to something sensible when they download it.
  • Likewise, no passthrough is required, so you don't lose the speed benefit of public file downloads. (Note that this module has not been tested with private downloads, but I see no reason that it wouldn't just work.)
  • Hooks directly into Drupal's file storage system (rather than relying on filename), so different files that happen to have the same name are counted separately.
  • Remembers downloads for a limited time to avoid double counting.
  • No log analysis is required, and the download counter is updated instantly when a file is downloaded.

Disadvantages

  • Clients that don't execute JavaScript (such as users running NoScript) won't be counted.
  • AJAX can't truly track file downloads, per se. What AJAX can track is clicks. Left clicking on a file always initiates a download, but certain file types (such as images) require that you right click on them to download them. This module assumes the intent of a right click is to download a file, so in some cases a download may be counted when it didn't actually happen. This is an inherent limitation, not a bug. Please do not report it as such.

Notes

Just to be clear, this module is meant for cases where scalability and ease of use outweigh the need for absolute accuracy. The statistics that this module provides are pretty good, but they are by no means perfect. As always, use this module at your own risk.

Note that I developed this module for my own use and I am releasing it into the wild unmaintained and completely as-is. Feel free to submit bug reports and feature requests, but there's a strong possibility that I won't have time to address them. I would be happy to pass off maintainership to another person, provided that person is using the code on a sufficiently large site that it can be continuously vetted for scalability.

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • caution No further development
    No longer developed by its maintainers.
  • Project categories: Media, Integrations
  • chart icon21 sites report using this module
  • Created by bartk on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases