Abstract views, PDF views and Download Stats Made Public 😶


Hi @Dilan_Rostam , I just think you can help me out. A very new to OJS 3.0.0. and am trying to just achieve what you did here http://aro.koyauniversity.org/article/view/ARO.10113

Can you take me through step by step; telling me which code to put where.

Thanks in advance


Sorry what are you referring to, Do you mean Article Metrics?

Our journal is OJS 2.8, so the process will be different in OJS 3x,

In OJS two there plugin which we did activate and tempered the main template file as instructed by others here.


Yep, Article metrics. What plugin is that? the one showing counters and graphs under each article. And how you did it.

this one


Here is my journal https://www.iprjb.org/journals/index.php/EJBSM/issue/view/80


Hi @otuya1,

there is an explanation on how to install the article level metrics (ALM) plugin for OJS 2.4.8 in this thread: Where are the ALM plugin in OJS

But you are using OJS 3 so I think you will not be able to use the ALM plugin as it is not (yet) ported to OJS 3 (see: Database upgrade failed OJS 2.4.8 to 3.0.0 )



Thanks @hermann for the response. Is there a work around to just display the counters for views and downloads wothout ALM?

I found the following code on this forum:

View Counter: {translate key="article.abstract"} | {$article->getViews()} | and

{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
{$galley->getGalleyLabel()} | {$galley->getViews()} |

I pasted in my /public_html/journals/templates/frontend/objects/article_details.tpl but it showed nothing. infact everything in if/else didnt show.


here is what appears https://www.iprjb.org/journals/index.php/EJBSM/article/view/58


Hi @beghelli, I used your script above but it could not work for me. Am running ojs3.0.0. see the out put below:


and here is your edited version of your exact code, just added a few html.

 View Counter: {translate key="article.abstract"} | {$article->getViews()} | times, Article PDF |
{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
{$galley->getGalleyLabel()} | {$totalViews} | times

Kindly assist. my journal is here https://www.iprjb.org/journals/index.php/EJBSM/article/view/78


Hello @otuya1,

It’s been a while since I am not working with OJS code base anymore, but looking at https://github.com/pkp/ojs/blob/master/templates/frontend/objects/article_details.tpl (the template file that actually it’s used to render part of the front end article page) I think the code should still work.

As I said originally, the code needs improvement if you think about the display, but the logic is correct.

The reason why you have no stats could be due to a problem while processing the stats. I think this entry is still relevant: My published file views or statistics reports shows no data. What do I do? in this case. You might want to check it out.

Also, I think OJS 3 is shipping with a built in stats visualization, with a nice graph, etc. You can activate that in the plugins management, generic, under the usage statistics plugin settings. I think that’s a better way to go than changing the code manually.

EDIT: I looked at the master branch, which is the most recent code. I should be looking at the OJS 3.0 stable branch, which better reflects the code of your version, but it doesn’t change the things I said. Just to clarify :wink:



Hi @otuya1
You can read carefully this thread OJS Usage Statistics
I did, here it looks in my journal, http://jurnalbeta.ac.id


I just activated UsageStats in OJS. I use 2.4.8.X

Under files, I have usageStats/usageEventLogs. This shows some logs from the past when the plugin was activated (98 files). I just re-activated the UsageStats plugin and a log entry was created in the usageEventLogs folder.

My issue is that I do not see any stats in the abstract and PDF for recently published articles. It shows 0. Some of the old articles show a number for abstract and galley view, and others do not.

Can OJS show stats it never collected? :grinning:

I need help to solve this issue. If you can help, please do.

My base url is http://www.multiplejournals.com.

I recently started accessing the website via https protocol when I login to OJS. Does it matter?

Once logged in, I accidentally hit the Reload Scheduled Tasks to have the OJS process the Log file, and then hit the Enable the Arcon Plugin (first time doing this). The page kept loading, and loading, and finally give me a 500 error.

I noticed these folders were newly created: processing, archive, stage, and reject. All the old logs moved under archive. I think there was an old log in processing. I ended up deleting the newly created folders (had backup of all the logs). These was ScheduledTasks, I cannot remember if it was a folder or what.

Can OJS re-create these folders again?

I disabled and enabled Acron Plugin, the page loads fine but does not create the folders it initially did when I first activated it. I do not get any 500 error when I hit reload scheduled tasks (only got it once)

How do I process the log files again?

How do I see stats of new articles?

How do I see stats of all old articles?

Please, help.



Hi @newone

Hmmm… I cannot see your journal – the URL is not working…

OJS Usage Statistics plugin logs access to some journal pages and the log files are created in the folder usageStats/usageEventLogs.
One needs either a Cron job or Acron Plugin in order to run the journal scheduled tasks, also the scheduled task of the Usage Statistics plugin, that does the processing of the log files i.e. calculating the statistics and saving them in the DB table metrics. The Usage Statistics scheduled task is run one time per day.
When processing starts, the log file is moved to the folder usageStats/stage and usageStats/processing. After the log files are processed i.e. statistics calculated and saved, the log files will be moved to the folder usageStats/archive (if the processing was successful) or usageStats/reject (if an error occurred when processing).
If you use the code above, to display the statistics on the article page, you can only see the statistics that were calculated from the log files – if there were no log files i.e. if the access to the journal articles was not correctly logged and processed, you cannot see any statistics/numbers.
You can rebuild/re-process the log files: you will have to move them into the folder usageStats/usageEventLogs and start/trigger the scheduled task (note that the scheduled task is run only one time per day, so that you might have to wait for a day).
When old log files are processed correctly and will see the statistics of those articles in your DB table metrics. When new log files (containing access to new articles) are processed correctly, you will see their statistics in the DB table metrics. If you add the code mentioned above in this thread, you and your users will see the statistics also on the article page.



Hi @bozana,

I did not include the URL. There is multiple journals. I just want to be able to see the stats once logged in, and the authors who publish their paper to be able to see their stats.

Acron plugin is activated. The Usage Stats plugin is activated. The systems re-created the folders again. The “Stage” and “Processing” directory are empty. The “Reject” directory is empty. The “Archive” directory has all the log files. The “usageEventsLog” has the log for today.

How do you activate the Scheduled tasks?

There is “scheduledTaskLogs” directory under “Files”. It has the following: crossrefautomatic, dataciteautomatic mEDRAautomatic, PKPPLNDdepositTask, Reviewreminder, Subscriptionexpirtyreminder, Usagestatisticsfileoadtask

I did check the Usagestatisticsfileloadtask, and I see the following. Is this processed correctly?

[2017-08-15 09:10:38] [Notice] Task process started.
[2017-08-15 09:10:43] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141107.log was processed and archived.
[2017-08-15 09:10:47] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141130.log was processed and archived.
[2017-08-15 09:10:52] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20140925.log was processed and archived.
[2017-08-15 09:10:58] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141112.log was processed and archived.
[2017-08-15 09:11:03] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141003.log was processed and archived.
[2017-08-15 09:11:06] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141210.log was processed and archived.
[2017-08-15 09:11:09] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141005.log was processed and archived.
[2017-08-15 09:11:15] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141117.log was processed and archived.
[2017-08-15 09:11:21] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141016.log was processed and archived.
[2017-08-15 09:11:25] [Notice] File /home/xxxx/files/usageStats/processing/usage_events_20141010.log was processed and archived.
[2017-08-15 09:11:30]



Hi @newone

It seems like everything is working fine. You can take a look in your DB table metrics – the calculated statistics (for each log file) are saved there.
In the DB table scheduled_tasks you will see when the scheduled tasks are latest run.

The Usage Statistics scheduled task should be run once per day. Thus you should have the log file of the current day in the folder usageEventsLog. After the scheduled task is run, the file processed successfully and statistics saved in the DB table metrics, it will be moved to the folder archive.



I have been following the thread you send but after waiting for 3-4 days, I realized that the counter is still zero.

How do you tell if your metrics table is recording the required data?

Below is my db screenshot as at now.


The metrics are of assoc_type 256 and 259 only. I cant see the 515(for galley) and 1048585(for abstract views) which are my main interest.

My journal: https://www.iprjb.org/journals/index.php/AJEP/article/view/438

Kindly help


I have been following the thread you send but after waiting for 3-4 days, I realized that the counter is still zero.

How do you tell if your metrics table is recording the required data?

Below is my db screenshot as at now.

The metrics are of assoc_type 256 and 259 only. I cant see the 515(for galley) and 1048585(for abstract views) which are my main interest.

My journal: https://www.iprjb.org/journals/index.php/AJEP/article/view/438

Kindly help


Hi @otuya1

Hmmm… Which OJS version are you using? – it seems like you would be using 3.0, which is old i.e. a log of changes and bug fixes were done since then. Thus, if so, could you first upgrade to the most recent OJS 3.0.2 release?

Else, could you take a look in those log files to see if there are any article or galley view URLs?
Are the log files successfully processed and moved to the folder archive?



Hi @bozana
Am using OJS 3.0.0.
Will the upgrade temper with my current custom styles and data?


There is an upgrade guide for upgrading from ojs 2.4.X to 3. but i want to move from ojs3.0.0 to ojs3.0.2


Hi @otuya1

I am not sure about your custom styles. It would be best if you could test the upgrade on a test environment/installation first and first when everything is OK do it on the production system.
Also, do not forget to backup everything before doing/testing the upgrade!!!
If the upgrade fails, you should get the backuped version again, fix the problem and do the upgrade again (on that fixed backuped version).
The upgrade can be done as usual, I think:
You should take the new source code, adapt/copy the config.inc.php, use/copy your public and files folder, double check that all files permissions are correct, and do the DB upgrade (with the command “php tools/upgrade.php upgrade” from your OJS folder).

I hope I haven’t forgotten anything :-