ojstat 1.4, google analytics alternative, matomo alternative, plausible alternative

Today, July 1st, 2022, I release OJStat version 1.4. In this article, I share with you what improvements OJStat has made, along with a short tutorial on how to install or upgrade your OJStat to this version. The first important thing to say here is that upgrade to OJStat 1.4 is only possible if you are using OJStat version 1.3. Therefore, if you are using older OJStat version (e.g., OJStat version 1.2), you will need to upgrade to OJStat 1.3 first then continue to 1.4.

ojstat is a new statcounter alternative

Improvements

OJStat has been improved in its security, performance, and features. Most of the improvements were suggested by web developer and OJS experts in the PKP Comunity Forum. I would like to thanks to them because their suggestions have motivated OJStat to reach this better state.

Security Improvements

Different to the earlier versions, this version is designed in MVC structure where the security features are easily added into the scripts and variable sanitizing becomes easier. Every inputs either in POST and GET are sanitized before being executed either to be inserted into database or printed on the screen. This shuts the door for SQL Injection, XSS, or other malicious practices.

Performance

The simplicity that OJStat offers consequently reduces the requests to the server and therefore increases the performance. OJStat now loads faster and with new technologies of the modern browsers, pages are cached to avoid unnecessary requests when particular pages are reloaded. The use of Ajax in several requests also help the users to use OJStat features without reloading a page.

Features

OJStat version 1.4 brings new features to us among others:

Multiuser

ojstat is a new alternative of google analytics

If in the previous versions one user handles all the journals registered in OJStat, now it is not necessarily the case. In this version, OJStat can manage users with different roles (administrator and users). Administrator has a role to manage all the journals while users are created by the administrator to manage particular journals assigned to them. This feature helps us to decrease our working time while increase our team-working.

Widget Generator

how to show journal metric in OJS

Widget generator works to generate a selected widget code. Therefore, the users do not need to hardcode the widget. All they need to do is to select what data to show (visit, country, system and device, etc.) and what type of widget they want to use (chart or table). A live preview of the selected widget will show and enable users to modify the size of the widget, the frameborder of the iFrame and also the scrolling attribute.

Detailed Report Page

the best statcounter for OJS

As we know, the report page is a page accessible publicly by the visitors so that they can see the metrics and statistics of the journal. In this version, the report page is made to serve more details of the journals including journal description and journal manager.

A live demo of OJStat version 1.4 report page can be seen here.

Page View Duration

With page view duration, we can easily see not only the time of visit but also how long each page has been viewed (in seconds).

There are more features of OJStat version 1.4 that I do not mention on this page but users can take benefits of when they start using OJStat.

Tutorials

Install

To install OJStat, we need to create an empty database in cPanel, create a database user, and connect the user to the database. This should be clear for people who has access to cPanel. OJStat should be uploaded on the OJS root directory with any folder name but should not be inside another folder.

There is a file that you need to modify, config.php, that is located in the folder App/config/config.php.

This file contains some constants like:
  1. BASEURL: the URL of your OJStat (e.g., https://yourjournaldomain.com/ojstat) assume that ojstat is the name of folder you use to hold the OJStat core files;
  2. DB_HOST: the hostname of your database (e.g., localhost:3306);
  3. DB_USER: the username of your database;
  4. DB_PASS: the password of your database;
  5. DB_NAME: the name of your database;
  6. SETUP: by default, it is set to true so that you can run the setup process. After setup is completed, you shoudl change the constant value to false so that you can access the login page.
  7. OJSTATART: by default it is set to true so that you can see updates from OJStat blog. If this affects the page loading time, you can set this constant value to false.

After creating the database, uploading OJStat, and modify the configuration file, you can now enter your OJStat URL. OJStat will redirect you to SETUP page. From there, you can read the SETUP detailed instructions. There are three steps in installation SETUP that will automatically performed by the system. All you need to do is to click the respective buttons provided on the SETUP page.

Upgrade

As I have mentioned earlier, only OJStat version 1.3 can be upgraded to OJStat version 1.4. This should be clear for us if we are using OJStat older than version 1.3.

The configuration is similar to Install but there are additional steps in upgrade. After checking the tables and fields integrity, we need to continue with unnecesary fields removal, administrator account creation, and most importantly, data synchronization.

Before upgrading, it is very important to:

  1. Backup both the OJStat core file and database to your local computer;
  2. Set the memory_limit size and maximum_execution_time to a reasonable value;
  3. Run the upgrade gradually.

The Setup Page itself contains a very detailed instruction for fresh installation and upgrade. Therefore, I will not go into detail in this article.

Changes

The consequences of upgrading to OJStat version 1.4, you will need to change several things in your OJS journals, among others:

  1. The script tag: you will need to replace the script tag in each journal (in OJS);
  2. The widget code: you will need to replace the widget code with the one you get from the Widget Generator.

Additional Information

If you are upgrading your OJStat, make sure that:

  1. You have synced all the journals data when you run the SETUP;
  2. You create at least a user to handle the journals and assign the user through Edit Journal;
  3. You edit the journal configuration thourgh Edit Config (this is not config.php).

I hope that OJStat helps you in recording, reviewing, analyzing, and reporting your journal statistics. Now, download the latest OJStat and enjoy.

Update:

OJStat 1.4 Online Visitor Widget Fix

I was made aware that the Online Visitor Widget in OJStat version 1.4 keeps showing 001.  I have checked the script of online.php in the public folder. The problem was located in the variable naming. Please update that particular file with the new one.

Download OJStat 1.4 Online Visitor Widget Fix 

Instruction:

  1. Download and extract the Online Visitor Widget Fix;
  2. Login to cPanel and locate your OJStat folder;
  3. Go into public folder Replace the old online.php with the new one.
Thank you.