Abstract views, PDF views and Download Stats Made Public 😶

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 2.4.7.1?

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 - #11 by asmecher )

Greetings
Hermann

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()} |
{/foreach}
{/if}

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 Influence of Order of Reinstatement, Order of Compensationon Human Resource Management Practices in Selected State Corporations in Kenya | European Journal of Business and Strategic Management

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

image

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

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

Kindly assist. my journal is here The Influence of Perceived Organization Support (POS) on Negative Staff Turn-Over (Retention) in African Union-United Nations Hybrid Mission Operations in Darfur-Sudan (UNAMID) | European Journal of Business and Strategic Management

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:

Cheers,
Bruno

1 Like

Hi @otuya1
You can read carefully this thread OJS Usage Statistics - #23 by bozana
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.

-Newone

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.

Best,
Bozana

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?

http://www.domain.com
[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]

-Newone

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.

Best,
Bozana

Hi,
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.

[/uploads/default/original/2X/6/6f7995a3e8a135c68a70c6c9ce40f12aa0093267.png]

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: THE EFFECT OF PRACTICAL SPSS TRAINING ON STUDENTS’ RESEARCH COMPETENCE; A SURVEY OF JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY MOMBASA CAMPUS POSTGRADUATE STUDENTS | African Journal of Education and Practice

Kindly help

Hi,
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.

image

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: THE EFFECT OF PRACTICAL SPSS TRAINING ON STUDENTS’ RESEARCH COMPETENCE; A SURVEY OF JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY MOMBASA CAMPUS POSTGRADUATE STUDENTS | African Journal of Education and Practice

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?

Best,
Bozana

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 :-
Best,
Bozana

Hi,
Thank you for the info but am somehow skeptical doing the upgrade particularly when it hits my mind that maybe the upgrade is no gonna be the solution to the metrics issue. I have seen pple on this forum whose metrics are showing but running the same version i have, others running version 2.4.X. Might there be a different solution to this?

Hi @otuya1

Yes, maybe first to find out the problem.

From my earlier post:
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?

2.4.x is fine – the plugin works there. Could you send the link from the post where the plugin is working with 3.0 version?

Best,
Bozana

Thanks @bozana for quick reply.

My usageStatlogs folder got two files both dated today: See below part of the log file

197.248.78.90 administrative 1 “2017-08-17 23:48:31” https://iprjb.org/journals/index.php/AJEP/article/view/50 200 “Mozilla/5.0 (Windows NT 6.1; rv:54.0) Gecko/20100101 Firefox/54.0”
197.248.78.90 administrative 1 “2017-08-17 23:49:02” Journal of Public Policy and Administration 200 “Mozilla/5.0 (Windows NT 6.1; rv:54.0) Gecko/20100101 Firefox/54.0”
197.248.78.90 administrative 1 “2017-08-17 23:49:26” Journal of Public Policy and Administration 200 “Mozilla/5.0 (Windows NT 6.1; rv:54.0) Gecko/20100101 Firefox/54.0”
197.248.78.90 administrative 1 “2017-08-17 23:49:43” https://iprjb.org/journals/index.php/JPPA/article/view/90 200 “Mozilla/5.0 (Windows NT 6.1; rv:54.0) Gecko/20100101 Firefox/54.0”
112.133.251.73 - - “2017-08-17 23:49:53” Journal of Animal Health 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:09” Journal of Health, Medicine and Nursing 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:29” Vol. 1 No. 1 (2017) | Journal of Health, Medicine and Nursing 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:41” https://iprjb.org/journals/index.php/JHMN/article/download/271/493/1667 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:43” https://iprjb.org/journals/index.php/JHMN/article/download/273/494/1668 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:43” https://iprjb.org/journals/index.php/JHMN/article/download/270/492/1666 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:44” https://iprjb.org/journals/index.php/JHMN/article/download/274/496/1670 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:50” https://iprjb.org/journals/index.php/JHMN/article/download/273/494/1668 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:42” https://iprjb.org/journals/index.php/JHMN/article/download/272/363/1285 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:55” https://iprjb.org/journals/index.php/JHMN/article/download/270/492/1666 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
68.227.248.106 - - “2017-08-17 23:52:00” https://iprjb.org/journals/index.php/AJEP/article/view/50 200 “Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0”
112.133.251.73 - - “2017-08-17 23:51:55” https://iprjb.org/journals/index.php/JHMN/article/download/274/496/1670 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:51:49” https://iprjb.org/journals/index.php/JHMN/article/download/271/493/1667 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:52:05” https://iprjb.org/journals/index.php/JHMN/article/download/272/363/1285 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
66.249.79.30 bot - “2017-08-17 23:53:31” https://iprjb.org/journals/index.php/AJCET/article/download/284/381/1352 200 “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
212.49.65.155 - - “2017-08-17 23:54:37” https://iprjb.org/journals/index.php/IJTS/article/view/29 200 “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:43” Vol. 1 No. 2 (2017) | Journal of Health, Medicine and Nursing 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:49” https://iprjb.org/journals/index.php/JHMN/article/download/276/498/1672 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:51” https://iprjb.org/journals/index.php/JHMN/article/download/276/498/1672 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:49” https://iprjb.org/journals/index.php/JHMN/article/download/301/499/1673 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:51” https://iprjb.org/journals/index.php/JHMN/article/download/303/500/1674 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:54” https://iprjb.org/journals/index.php/JHMN/article/download/301/499/1673 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:55” https://iprjb.org/journals/index.php/JHMN/article/download/302/472/1631 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:56” https://iprjb.org/journals/index.php/JHMN/article/download/303/500/1674 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:54:59” https://iprjb.org/journals/index.php/JHMN/article/download/302/472/1631 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:19” Journal of Health, Medicine and Nursing 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:28” Global Journal of Health Sciences 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:40” Vol. 1 No. 1 (2016) | Global Journal of Health Sciences 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:47” https://iprjb.org/journals/index.php/GJHS/article/download/40/69/208 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:48” https://iprjb.org/journals/index.php/GJHS/article/download/53/85/260 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:50” https://iprjb.org/journals/index.php/GJHS/article/download/96/133/434 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:52” https://iprjb.org/journals/index.php/GJHS/article/download/74/141/466 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:55” https://iprjb.org/journals/index.php/GJHS/article/download/53/85/260 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:54” https://iprjb.org/journals/index.php/GJHS/article/download/77/113/356 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:56” https://iprjb.org/journals/index.php/GJHS/article/download/151/195/682 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:57:53” https://iprjb.org/journals/index.php/GJHS/article/download/40/69/208 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:58:05” https://iprjb.org/journals/index.php/GJHS/article/download/96/133/434 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:58:05” https://iprjb.org/journals/index.php/GJHS/article/download/74/141/466 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:58:14” https://iprjb.org/journals/index.php/GJHS/article/download/151/195/682 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”
112.133.251.73 - - “2017-08-17 23:58:15” https://iprjb.org/journals/index.php/GJHS/article/download/77/113/356 200 “Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36”

In addition to this, my stage and processing folders are empty, very old(more than a month) logs are in archived while most recent logs are in reject folder. What makes them to be rejected?