OJS 3.1.1.2 Views (Abstract, PDF, XML, EPub) showing 0

We have journals which are showing 0 for all views no matter how much activity each article receives.

Screenshot%20from%202018-08-28%2000-43-37

We run runScheduledTasks.php every hour via a cron job and I’ve also run it manually but it has no effect.

I did implement some of the suggested solutions in Article statistics showing 0 abstract views and 0 PDF downloads - #133 by bozana but haven’t had any success getting the Views to work.

I also ran the suggested sql query against scheduled_tasks and records are being found.

Is there something I can try and debug in the code base which may give an indication as to the problem?

Thanks Hayden

Dear PKP team. Just doing a quick follow-up here. We are displaying zeros to the world which is not ideal. Can you please assist @bozana @asmecher

@haydenyoung and @MichaelGuthrie can supply any info if needed.

Hi all,

Are you using a plugin to add the view counts to the sidebar?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Are you using a plugin to add the view counts to the sidebar?

From what I can tell,no. It looks like some code added to a theme called defaultManuscript (screenshot attached)

Some kind of customized code for displaying views:

<div class="item views">
<div class="label">
Views
</div>
<div class="value">
<ul style="list-style: none; padding: 0; margin: 0;">
<li style="padding: 5px 0;">{translate key="article.abstract"} <span class="task_count" style="display: inline-block;width: 20px;height: 20px;margin-left: 0.5em;border-radius: 50%;background: #ddd;line-height: 20px; text-align: center; font-size: 12px; float: right;">{$article->getViews()}</span></li>

{if is_a($article, 'PublishedArticle')}{assign var=galleys value=$article->getGalleys()}{/if}
{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
<li style="padding: 5px 0;">{$galley->getGalleyLabel()} <span class="task_count" style="display: inline-block;width: 20px;height: 20px;margin-left: 0.5em;border-radius: 50%;background: #ddd;line-height: 20px; text-align: center; font-size: 12px; float: right;">{$galley->getViews()}<span></li>
{/foreach}
{/if}
</ul>
<sub>Views and downloads are with effect from 11 January 2018</sub>
</div>
</div>

I think there has always been a problem with this since the upgrade from 2.4 to 3.x although it has worked across versions for some journals. Is it an API incompatibility?

Thanks

Hayden

Hi @haydenyoung

Are your usage stats log files processed and archived correctly? Do you have the correct entries for that particular article in your DB table metrics? Could you post what you get when you execute this SQL: select * from metrics where submission_id = 5350 ?

Best,
Bozana