Ojs 3.1.1 Usage Statistics not working

I have latest ojs 3.1.1 installed and working, however some plugins not working specially Usage Statistics it’s important for me so i wanna know what’s wrong!

The strange thing is that plugin “Recommend Articles by Author” is working despite that it uses Usage Statistics!

Also " Display submission statistics chart for reader" is checked and i have “references” metadata field active and working

so any one can tell me what’s wrong?

Hi @mhkutb

So I assume the plugin Usage Statistics is enabled and set up, correct?
Do you have any data in your DB table metrics?
Is your usage logging functioning correctly? – The access to some journal pages is logged in the sub-folders in the folder usageStats in your files folder. Do you see the log files there? – The current log file should be in the sub-folder usageEventLogs and those that are successfully processed are in the sub-folder archive.
For the log files to be processed either a cron job or Acron plugin is needed. Do you use a cron job or Acron plugin i.e. is Acon plugin enabled?


Thank you for attention …
Yes plugin Usage Statistics is enabled and set up
Acon plugin is enabled

DB Table Metrics Have Many Lines Like That:
usage_events_20180421.log 2 2 259 1 1 2 515 5 20180421 201804 2 NULL NULL NULL ojs::counter 1

i have such files under Usage event logs folder : “usage_events_20180428.log”
and yes such files in archive folder : usage_events_20180421.log
all with kb spaces such 1kb or 4kb

the strange thing is that there is no any sign in the UI as if the Usage Statistics is disabled

you may enter the journal and see yourself

thank you

Hi @mhkutb

Hmmm… yes… everything seems to be fine…

I see you are using a theme different than default. What theme are you using? – You can see it as journal manager under Settings > Website > Appearance > Theme and/or in your folder plugins/themes/. If you use a theme other then default or if you have made any changes in the code: do you have this line in your overwritten file article_details.tpl: ojs/article_details.tpl at ojs-stable-3_1_1 · pkp/ojs · GitHub? – That is the hook, the plugin UsageStatistics is using to display the graph, s. also ojs/UsageStatsPlugin.inc.php at ojs-stable-3_1_1 · pkp/ojs · GitHub. So maybe something is missing for that graph to be displayed appropriately.

Do you have any entries in your DB table metrics where assoc_type = 515 (submission file)?


Can this fix be suitable to fix the problem in this discussion.

I just used it to patch my installation to display the graph.

Best regards,


Thanks @anupent! :+1: Yes, this might be the problem…

1 Like

I see that before while i was searching for solution but i don’t have “classes/plugins/Plugin.inc.php” in my ojs3 installation in folder “classes/plugins/” i have only this files:

i don’t know where to put that fix!

i’m using Bootstrap3 Theme not modified, i also tried the original default theme … same problem

it is in the:

1 Like

I did the fix and it works like charm, you was really great help thank you and thak you bozana for support

1 Like

Many thanks! It works! :+1:

1 Like

Do you know if this is still an issue for OJS 3.1.2-1 the latest one as of today? Some of our journals statistic do not work. attached are screenshots.

Thanks for any help!





So I agree with the previous poster (dung). We had our OJS installation upgraded from to just this month and the Usage statistics stopped working. Pointers on what could have caused this issue? Any help will be appreciated!

1 Like

@mhkutb hi there,

can you please share what fix did you apply to resolve issue?

best regards,


@talknshare hi,

we are making some progress here
[OJS 3.1.2-1] Journal statistic - #5 by dung
if you need help post back to us.


1 Like

Thanks! I was following your thread and checked the base url, which is not a problem I guess for me. After the update, it is just a flat line. Do you think PHP version 7.3 could be the problem? I have reverted back to PHP 7 and ran the cron, but still no difference. Do you have any suggestions for me? Is it possible to install a fresh usageStats plugin and would that make a difference?

@talknshare hi, what is your ojs issue? What is your ojs version? New installation or upgrade if so upgrade from what version?

I don’t think php 7.x is a problem.

A flat line in config file is not good. Correct that.

How did you run the cron? How could you confirm if cron did actually run?

Usagestats reinstallation probably won’t help.

Do answer my questions!


Thank you, @dung. We recently upgraded our installation from to to At that point, the article statistics were being recorded, as you can see in the chart below. snip_20190622183133
As you can see the version was working fine and started recording the views. But then when we upgraded to (current), it stopped recording.

Yes, changing php to 7 didn’t do anything, so I now have PHP 7.2 running. The hosting provider gives us access to use cron, through cPanel. I ran the cron script there, and the system emails us once the cron job is completed. So I suppose I can count that as job done. I checked the base_url in the config file and it is correctly set. Do you know what could give this problem? Thank you!

Open your ScheduledTasks database table where you will see when and what tasks are executed by ojs 3.1.2-1.

Let me know. We just passed this issue.


Do you have Acron plugin installed?
Did you turn on ScheduledTasks = On in ojs configuration file?