[Solved] Hit count in open journal system

I need algorithm of hit counter in ojs because I want to apply hit counter in open journal system. On each visit of a person on website, the number of hits is incremented by one. I need algorithm or pseudocode of that.
plz help

Your implementation here will depend on how you want to use these counts.

Many folks will use Google Analytics to aggregate their website views there is a “Generic” plugin included in OJS for this.

For scholarly analytics of article usages (such as view/download counts in altmetrics) the COUNTER standard is typically used, and a plugin is provided in OJS to perform these counts.

If you want to display a hit count to your readership, you may want to use code from a third party hitcount service, adding their custom Javascript code in via the Custom Block Manger plugin, or via a local change to a template file in the system.

Good day, everybody! I tried to add hit counter service (Yandex.metrics custom Javascript code) in via the Custom Block Manger plugin. But it cut contents of tag <script>. What can i do to avoid it?

HTMLPurifier will prevent script tags even if specified as within config.inc.php’s allowed_html option:

To add custom javascript, use the Custom Header plugin:

Thanks, ctgraham! But i need informer to be shown. And putting in head section outputs info image in the beginning of the page and i think better it would be in the right sidebar. So i added custom Javascript code in lib/pkp/templates/frontend/components/footer.tpl with “{literal} <script>… </script> {/literal}” syntax.
The remain problem is that firefox doesn’t want to show informer image, though opera shows.

It it turned out that adblock plus was blocking the counter image informer. :sweat_smile: