Statistics download articles / OJS 3.2.1

Hello! I have published (OJS 3.2.1) a new article (3 days ago) and I have included the PDF documents as a galley. But I see that the download statistics are not showing me.

Why doesn’t it show me the download data? What else should I configure?


Hi @gardbeat,

When you visit Statistics > Articles in the backend, do you see any stats being recorded or does it look like the image in this post. If you don’t see any statistics there, try following the recommendations in the reply to that post.

Hi @NateWr,

Access the route and it shows me the statistics. In addition, I access the code of one of the new publications, it marks the view graph, but the counter below (it goes 0 outside the panel, in the capture I sent in the previous post). I attach a screenshot:


And I have made tests of clicking in the PDF, with different IP’s and it does not count them.

When you’ve tested the PDF views, did you do that from November 15 or before? The stats will only go up to the last day that was processed, and that looks like November 15 at the time of that screenshot.

The stats are typically processed once a day, so if it’s late in the day you won’t get November 16 stats until late November 17.

Hi @NateWr,

It happens to me with that article and with others (I uploaded all of them on November 10, 2020), they appear in the statistics (control panel), but then in the web part, I get that "
The download data is not yet available. "

The information dumps, are they past the day, month?

If you notice, there are visits on November 11 and they are not shown.

I honestly don’t understand.

It’s possible that the chart is not getting initialized on the page. Are you using the default theme or a custom theme?

Hi @NateWr,

I am using a custom theme.

What should I do? Because the other statistics of other published numbers do work.

Can you share a link to one article where the chart is not appearing and one where it is appearing?

Hi @NateWr,

Of course:

I await your investigation. Thank you.

Ok, so it looks like the plugin is fetching the statistics for this, but it is written to only retrieve file downloads (galleys). It won’t show views of the article landing page (I just learned that now by looking at the code! :)).

So in this case the frontend display is working correctly because when you look at the stats in the backend, there are no hits for that article in the PDF/HTML/Other columns.

That means we are back to the original problem: why are usage events not being recorded when you look at the PDF? The first step is to figure out if the usage event logs are recording an event. In your files_dir, look for the usageStats/usageEventLogs directory. Open up the current day’s file and see if new lines are added when you visit a PDF.

You can also look in the archives directory at old logs, to see if visits to the PDF of that article have been recorded. If they are in the archived logs, but the statistics are not showing up, then it sounds like there is a problem similar to the problem being discussed in this thread.

Hi @NateWr,

I just did what you told me to do, open a pdf (one of those that doesn’t mark me statistics in fronted) and I get a new line in the .log file (ojsdata/usageStats/usageEventLogs/usage_events_20201119.log)

I don’t know if it will affect, but I have another .log in that same folder.

I check in the files folder (/archives), and there is no registry showing.

So why is it that I don’t show it? Thank you and I look forward to it.

Great, so we’ve confirmed that the usage event is logged. That means there’s a problem with the processing of the log files. For some reason, it is not processing that log entry correctly into the database.

You said that the problem you’re having is all with a set of submissions that you uploaded on November 10, right? Was this through the QuickSubmit plugin, or the Native Import XML, or did you just make the submissions and publish them manually?

Also, can you share the line in the log file that was added when you visited the PDF? (You should anonymize the IP address at the beginning of the line.)

Hi @NateWr,

Yes, it is the same publication that I uploaded all the same day.

Regarding the publications, they were approved in the backend (and assigned to their number) and on the PDFs, they were attached in a “galley” way (publication / galleys / add galleys). - - “2020-11-19 17:51:04” Redes sociales y desarrollo humano | Barataria. Revista Castellano-Manchega de Ciencias Sociales 200 “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36”

I await your response.

Hi @gardbeat,

The line from the log that you’ve provided here is not for the PDF. It is a usage event for the main article landing page. A logged usage event for the PDF would have the following URL:

Do you see any log entries with that URL?

Hi @NateWr,

Article url: Redes sociales y desarrollo humano | Barataria. Revista Castellano-Manchega de Ciencias Sociales

URL PDF: Vista de Redes sociales y desarrollo humano

Sorry for not having the two url. I await your evaluation:

Hi @gardbeat,

We still need to confirm that you’re getting a log entry when you visit the PDF. The log entry that you posted shows a visit to the article landing page, not the PDF. Do you see any log entries that include the URL to the full PDF?

Hi @NateWr,

Hi. Well, I clicked on the PDF again and in the log, it shows me the same URL again. What could that be due to?

So when you visit the article landing page and then click on the PDF link, you only get one additional log entry? You should see two: one for the visit to the article landing page and one for the visit to the PDF.

I’m not sure why the log entry wouldn’t be showing up, but that would explain why you do not have any stats for PDF views.

Hi @NateWr

Indeed, it is as you say. When I click on the PDF, it doesn’t register the url of the PDF, if not, the url of the html.

What can it be?

That’s a good question and unfortunately one that is going to take a bit more investigating than we can offer on the forums. The first place that I would look is inside the usageEvent plugin. I’d want to make sure that the call to get a usage event’s data is actually firing.

That code is here:

I’d recommend putting in some error_log statements and checking your error logs to determine whether or not it is firing when you visit a PDF’s URL.

The next place I would look is in the ArticleHandler::download() method, where the PDF is downloaded. There is an event hook there, ojs/ at stable-3_2_1 · pkp/ojs · GitHub, which should be getting picked up by the usageEvent.