UsageStats shows empty graphs

UsageStats shows empty graphs.

Hello everyone, as you can see in the screenshot below there is no information in the graph that belongs to an specific article. I tried to reprocess the logs files as you recomended but it didn’t appear information in the graph. To reprocess I put the logs files in the stage folder as you said but nothing happened.

What could it be?
Btw I’m using OJS 3.0.1 :wink:

I hope someone could help me.
Regards
Julieta

The similar problem appeared in my case after upgrading to ojs 3.0.1. It seems that not all info from logs is processed to metrics table. I have already created an issue on pkp github.

Hi all,

See OJS 3.0.1: Statistics plugin needs additional testing · Issue #2134 · pkp/pkp-lib · GitHub for the github issue.

Regards,
Alec Smecher
Public Knowledge Project Team

@julietavuan, to be sure, that the access is correctly logged, could you please test if the usage is correctly logged i.e. if your usage statistics log files contain all accesses, e.g. to that article with missing statistics. If they are correct, could you then check, if the information in the DB table metrics is correct – if there is the article URL in the usage statistics log files, there should be an entry in the table with assoc_type = 1048585 and assoc_id = <that article ID>. For the correct processing, eventually this fix is necessary: pkp/pkp-lib#2087 fix usage event on article page · pkp/ojs@75ced9f · GitHub
This is a new article i.e. not migrated from OJS 2.4.x, right?
Finally, would it be possible for you to send me your installation i.e. DB dump (with all sensitive data removed) and those usage stats log files (i.e. some of them, that you think are not processed correctly)? – Then I could take a look at it…

Thanks!
Bozana

Hi @bozana !
Here is the SQL result with the last metrics.
In this SQL result you can see the last metrics for an specific journal and the URL directions of three articles.
Hope you can help me!

URLs:
http://revistas.unlp.edu.ar/raab/article/view/3036
http://revistas.unlp.edu.ar/raab/article/view/3037
http://revistas.unlp.edu.ar/raab/article/view/3038

Regards
Julieta

Hi @julietavuan

Just a quick answer, that your data seems to be correct – for example for the article 3036: there are 3 accesses in this year in the DB and if you go to the article page and then view the page source, you will see something like this:
<script type="text/javascript"> var pkpUsageStats = pkpUsageStats || {};pkpUsageStats.data = pkpUsageStats.data || {};pkpUsageStats.data.PublishedArticle = pkpUsageStats.data.PublishedArticle || {};pkpUsageStats.data.PublishedArticle[3036] = {"data":{"2017":{"1":3,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0}},"label":"Todas las descargas","color":"79,181,217","total":3}; </script>
which is correct, but I do not know why the graph is not displayed properly :frowning: I will have to take a further look…

Best,
Bozana

Hi @julietavuan

Ah, I found the bug, in the JS file the current year, for which the statistics should be displayed, is hard coded to 2016, s. https://github.com/pkp/pkp-lib/blob/master/plugins/generic/usageStats/js/UsageStatsFrontendHandler.js#L127-L129 :slight_smile:
Please track this GitHub Issue for the fix: fix hard coded current year in the usage stats JS · Issue #2154 · pkp/pkp-lib · GitHub

Best!
Bozana

1 Like

Hi @bozana
it worked! Thank you for the help! :smile:
Best regards.
Julieta

I have the same problem, the link you have provided is no longer active.
I use OJS 3.1.2-4