• Resolved Pedro

    (@petredobrescu)


    Hello again,

    I’ve set up my custom theme to display the post views as recorded by JetPack. While I do see them correctly in the “Site Stats” section, they only show up on the site with delay (~24 hours). You can check this here:

    https://www.g4media.ro

    None of today’s posts have the post views, while all yesterday’s posts do have the page views displayed. Is there any limitation around this? I’ve used this piece of code in the theme:

    if (function_exists('the_jatpack_views') and the_jatpack_views(get_the_ID()) > 0) { echo the_jatpack_views(get_the_ID()); echo ' vizualiz?ri ';}

    Please let me know if I should alter the code in any way in order to be able to also display the post views for today’s posts.

    Thank you!
    Pedro

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support KokkieH

    (@kokkieh)

    Hi Pedro,

    Those views should update every time your site syncs with Jetpack’s servers. I checked your site on our end, and it appears it hasn’t synced for over 23 hours. I’ve started a full sync on your site which is currently running. Please give that a few hours to complete and then check if the counts on your most recent posts have updated.

    If this keeps on happening there might be a problem with how your site is syncing with our servers, but let’s first see if doing a full sync updates things, and then we can take it from there.

    If you don’t see any change within the next few hours, please let me know.

    Thread Starter Pedro

    (@petredobrescu)

    Hi @kokkieh,

    Thanks for looking into this. Unfortunately, the situation is the same, today’s posts are missing the page views, while yesterday’s are ok.

    Is there anything that I should do in the settings or somewhere else, in order to trigger a more often sync of data? Is it only scheduled once per day? How is this sync done, using a cron-jpb? If yes, are there any filters/hooks in order to make the sync more often?

    Thank you!
    Pedro

    Hi @petredobrescu,

    Thanks for checking. We’ve been looking into this further and have concluded the issue is actually being caused by the function you are using, rather Jetpack sync.

    If you are seeing delays when using this particular function, we recommend checking how it was built. For example, caching could be coming in to play and causing the delays you are seeing.

    Is it only scheduled once per day? How is this sync done, using a cron-jpb?

    Sync happens via cron. After the first full sync, it is triggered by site changes made from your WordPress.com account or from the WP Admin dashboard. So in short, this process is handled automatically.

    Thread Starter Pedro

    (@petredobrescu)

    Thanks @gemmaevans, that is correct, it was an issue with that function, which I have fixed. The posts now get their page views within 1-2 hours which is more than acceptable.

    Thank you!
    Pedro

    Great to hear you were able to get this fixed, thanks for keeping me updated ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t display today’s posts views’ is closed to new replies.