• Resolved dorier75

    (@dorier75)


    Thanks for [koko_analytics_counter]

    But can we have an explanation? What does the number correspond to?

    For our site it indicates 4622 and this day we had 246 visitors…

    and this number does not change.

    Instead, we need a shortcode that displays the number of visits for the day and another for the number of pages viewed…
    In short, shortcodes which correspond to the information in the plugging statistics, do they exist?

    THANKS

    • This topic was modified 9 months ago by dorier75.
    • This topic was modified 9 months ago by dorier75.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Support Lap

    (@lapzor)

    You can use the [koko_analytics_counter] shortcode to show the number of visitors to the current page.

    Without any arguments it will default to visitors over the past 10 years for the current page.

    It takes 3 optional arguments:

    • days: Show count over the last N days. Defaults to “3650”.
    • global: Whether to show the global count (for the entire site) or for the current page only. Defaults to “false”.
    • metric: One of “visitors” or “pageviews”. Defaults to “visitors”.

    Example use with arguments:

    [koko_analytics_counter days=”30″ metric=”pageviews” global=”true”]

        $default_args = array(
            'days' => 365 * 10,
            'metric' => 'visitors',
            'global' => false
     )
    Thread Starter dorier75

    (@dorier75)

    I had already tried this code: [koko_analytics_counter day=”30″ metric=”pageviews” global=”true”]

    But I’m looking to display only the number of visits/day and the number of pages viewed/day and not the list of the best page views.

    it’s possible ?

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @dorier75,

    [koko_analytics_counter] shows the total number of pageviews or visitors over the last N days. To have it show the number of pageviews for the last day, you can use it like this:

    [koko_analytics_counter days=”0″ metric=”pageviews” global=”true”]

    That will show the total number of pageviews across the entire site for today.

    Hope that clarifies a bit.

    PS. The number you see there is cached for 1 minute. A page refresh will not result in it being incremented right away.

    Thread Starter dorier75

    (@dorier75)

    Thanks, but [koko_analytics_counter day=”0″ metric=”pageviews” global=”true”] displays the figure of 95880, or my number of visitors today is 305 and page views 508. Which code can display 305 and which code 508?

    Plugin Support Lap

    (@lapzor)

    If your total pageviews on your whole site for today is 508, that is the number that should be shown by that shortcode.

    If you wanted to show just the pageviews for that specific page the shortcode would be

    [koko_analytics_counter day=”0″ metric=”pageviews” global=”false”]

    I just tested both those shortcodes on my own site and they worked properly there.

    Can you please email us a link to this thread on support at kokoanalytics.com so that we can investigate this further? Thank you!

    Thread Starter dorier75

    (@dorier75)

    No, with this last code [koko_analytics_counter day=”0″ metric=”pageviews” global=”false”] still has the number 95971, while at this time the number of page views for today is 30

    Plugin Contributor ibericode

    (@ibericode)

    Hello @dorier75,

    The correct shortcode is as follows:

    [koko_analytics_counter days=”0″ metric=”pageviews” global=”false”]

    Note that it uses “days” (plural), not “day” (singular).

    Hope that helps!

    Thread Starter dorier75

    (@dorier75)

    This code gives a critical error

    • This reply was modified 8 months, 4 weeks ago by dorier75.
    Plugin Contributor ibericode

    (@ibericode)

    Hello @dorier75,

    Please copy my shortcode and paste it into your page. It has a different argument than the one you seem to be using, days instead of day. So an additional “s” at the end.

    Thread Starter dorier75

    (@dorier75)

    This code [koko_analytics_counter days=”0″ metric=”pageviews” global=”false”] gives a critical error

    Plugin Contributor ibericode

    (@ibericode)

    Hello @dorier75,

    Do you have any details about what kind of critical error you are getting? Your web server’s error log should be showing an error message with an explanation on why it is giving a critical error.

    Thread Starter dorier75

    (@dorier75)

    Also we have numerous server errors since yesterday’s update:
    alcor-controles.fr [Tuesday February 27 11:04:59.601325 2024] [fastcgi:error] [pid 104576:tid 140619217356544] [client 2a01:cb10:83ce:a200:11a5:dcc1:eff2:c883:0] FastCGI: server “/home/clients/xxxxxxxxxxxxxxx/.config/apache/alcor-controles.fr/.fpm/php5.external” stderr: #5 /home/clients/b2c…error: Uncaught TypeError: KokoAnalytics\create_local_datetime( ): The return value must be of type DateTimeImmutable, bool returned in /home/clients/xxxxxxxxxxxxxx/web/wp-content/plugins/koko-analytics/src/functions.php:303, referrer https://www.alcor -controles .fr/wp-admin/post.php?post=82292&action=edit

    I have no server message relating to this critical error following your Shortcod, but I also received an email from the WordPress platform:

    Good morning !

    WordPress has a native feature to detect if a plugin or theme is causing a fatal error on your site, and automatically notifies you with this email.

    Here, WordPress found an error with one of your plugins, “Koko Analytics”.

    Plugin Author Danny van Kooten

    (@dvankooten)

    Thank you.

    From the looks of it, your web host is running a very old version of PHP that is no longer supported or receiving security updates.

    It also seems to break on the days="0" argument, where newer PHP versions handle this without any issues.

    We have modified our plugin to prevent this critical error from occurring, but until we release that (~4 weeks from now) I would advise to:

    • Ask your webhost to update your installed PHP version to at least 7.4 (you seem to be on 5.x).
    • Use [koko_analytics_counter days="1" metric="pageviews"] to show statistics for today + yesterday instead of just today. This is just a workaround, you can change it back after we release the next version of our plugin in a few weeks.

    Hope that helps. Good luck!

    Thread Starter dorier75

    (@dorier75)

    No, we do have an up-to-date PHP version, 8.0. The short code [koko_analytics_counter day=”1″ metric=”pageviews”] displays 0

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hello @dorier75,

    It seems you’re using “day” again instead of “days”. The correct shortcode is as follows:

    [koko_analytics_counter days="1" metric="pageviews"]
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[koko_analytics_counter]’ is closed to new replies.