Plugin for reporting pdf downloads

mbtuckersimm
Tue, 17 Feb 2026 18:24:37 +0000
Software Support

Somewhat similar to my previous question, I’m making a plugin that will report views of published articles to an external API.

The plugin needs to react the same way in the following situations:

The user downloads the pdf to their machine.

The user views the pdf in their browser, either via the pdf.js plugin or the builtin pdf viewer in the browser.

In the future, when we have HTML versions of the our articles, we would like the plugin to also report to the API when a visitor views an HTML version.

What are the appropriate hooks to use here? I see the following hooks in pages/article/ArticleHandler.php but I’m not sure which are the correct ones to respond to:

ArticleHandler::download

ArticleHandler::view

ArticleHandler::view::galley

FileManager::downloadFinished

Any guidance would be much appreciated, thank you!

[Edit] Separately from reporting pdf downloads, we also need to report when visitors view the article abstract/landing page. I guess that is the ArticleHandler::view event?

9 posts - 2 participants