Statistics
OJS records the number of times visitors view and download content. As an administrator, you can configure what statistics are collected, how data is compiled into daily or monthly totals, and whether some statistics are publicly available.
Requests to view and download files are recorded in log files. These files are compiled into statistics daily. OJS filters out bots and double-clicks. On large or old sites, the metrics tables in your database may consume significant disk space โ you can reduce this by keeping only monthly data and limiting geographic data.
To ensure statistics are collected correctly, make sure you have configured scheduled tasks and jobs for your application.
Settingsโ
As an administrator, you can restrict the types of statistics collected. Follow these steps to configure statistics for all journals on your site:
- Login as an administrator.
- Go to Administration.
- Go to Site Management โ Site Settings.
- Go to Site Setup โ Statistics.
Site settings act as a "ceiling" for journal managers. For example, if the site has disabled geographic statistics, managers cannot enable them for their journals.
Downloading Statisticsโ
| Type | Description | Web | CSV | JSON |
|---|---|---|---|---|
| Publications | Views and downloads of articles and their files | โ | โ | โ |
| Issues | Views and downloads of issues (OJS) | โ | โ | โ |
| Homepage | Views of the journal homepage | โ | โ | โ |
| Geography | Views by country, region, city | โ | โ | โ |
| COUNTER | Industry-standard COUNTER 5 SUSHI format | โ | โ | โ |
| Editorial Activity | Submission acceptance/rejection rates, time-to-decision | โ | โ | โ |
| Users | User profiles and roles | โ | โ | โ |
| Reviews | Reviewer names, due dates, comments | โ | โ | โ |
| Submissions | Titles and metadata for all submissions | โ | โ | โ |
| Subscriptions | Subscription data (OJS) | โ | โ | โ |
Publicationsโ
- Login as administrator or manager.
- Click Statistics โ Articles.
- Filter by date, section, or issue.
- Click Download Report.
Issues (OJS only)โ
- Click Statistics โ Issues.
- Filter by date.
- Click Download Report.
Geographyโ
You must enable geographic statistics in Settings first.
- Click Statistics โ Articles.
- Filter as needed.
- Click Download Report โ Download Geographic.
COUNTERโ
COUNTER 5 SUSHI statistics are available via the REST API. COUNTER 4 reports (Journal Report 1 and Article Report 1) can be downloaded:
- Click Statistics โ Reports.
- Click COUNTER Reports.
Editorial Activityโ
Editorial statistics can change significantly depending on the selected date range. Use date ranges that account for the full duration of your editorial review process, ending at least 12 months ago.
- Click Statistics โ Editorial Activity.
- Filter by date and section.
Usersโ
- Click Statistics โ Users.
- Click Export and select the user groups to include.
Reviewsโ
- Click Statistics โ Reports โ Review Report.
Submissionsโ
- Click Statistics โ Reports โ Articles Report.
Recovering Lost Statisticsโ
You may notice historical gaps in statistics data, often caused by misconfiguration, server resource limits, or application errors. Recovery is possible if you have the relevant log files.
Prepare Log Filesโ
Log files must be in the format the application recognises โ JSON entries like:
{"time":"2023-02-27 11:41:14","ip":"87d8edf8...","userAgent":"Mozilla\/5.0...","canonicalUrl":"https://example.org/...","assocType":256,...}
Convert Logs from Older Versionsโ
If your log files look like older-format lines (plain text, not JSON):
php lib/pkp/tools/convertUsageStatsLogFile.php <log>
The old log file will be renamed <filename>_old.log.
Convert Apache Access Logsโ
php lib/pkp/tools/convertApacheAccessLogFile.php <log>
This creates one log file per day in the archive directory.
Reprocess Log Filesโ
Move the prepared log files into the stage directory, then run once per month:
php lib/pkp/tools/reprocessUsageStatsMonth.php YYYYMM
Example โ reprocessing October and November 2022:
php lib/pkp/tools/reprocessUsageStatsMonth.php 202210
php lib/pkp/tools/reprocessUsageStatsMonth.php 202211
Tipsโ
- Never rename log files โ they must be named
usage_events_YYYYMMDD.log. - If
disable_path_info = Onin your config, setPATH_INFO_DISABLED = truein the conversion scripts. - Log files in the
stagedirectory for the current month are processed automatically โ do not move files there unless you intend them to be processed.
Frequently Asked Questionsโ
I don't see any statisticsโ
Statistics are compiled once a day. If you have visited the journal homepage and waited more than 24 hours but still see no stats, check that scheduled tasks and jobs are configured correctly.
Check <files_dir>/usageStats โ processed log files are moved to the archive directory.
Geographic report has no dataโ
The application uses a GeoIP database at <files_dir>/usageStats/IPGeoDB.mmdb. If scheduled tasks are configured correctly, this file is updated monthly.
I upgraded from OJS 2.x and want old statsโ
If you have Apache access logs from that period, you can convert and reprocess them. See Recovering Lost Statistics above.
Downloading a report gives a blank page or memory errorโ
The data set is too large for your server's PHP limits. Try a smaller date range, or increase memory_limit and max_execution_time in php.ini.
Stats seem lower after upgrading from 2.xโ
Since OJS 3.x, the application filters views per the COUNTER Project code of conduct (one view per 30 seconds, known bots filtered). This is expected behaviour and results in more accurate metrics.
- Import & Export โ Export publication and user data
- Scheduled Tasks โ Configure the task runner that compiles stats