Support » Plugin: Koko Analytics » Koko says no visors, Awstats says otherwise

  • Resolved darrencss

    (@darrencss)


    I appreciate a lot of traffic reported in awstats is bots and such but one day’s figures are:

    Uniques: 249
    Page views: 1024

    According to your plug-in though I had no visitors at all?

    Can you give me some ihnts on where to look in order to debug?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hey @darrencss,

    That does sound like an issue! If you check the “Network” tab in the developer tools of your browser, do you see a HTTP request to /w-admin/admin-ajax.php?action=koko_analytics_collect. If so, what is the HTTP status code of that request?

    If it is anything other than “200 OK” then it most likely means that the plugin is unable to write to the buffer file which it tries to create in your /wp-content/uploads/ directory. Please make sure that the uploads directory is writable by the user that your webserver is running as (if you’re not sure, your host should be able to help you with this).

    Alternatively, if you post a link to your website here I’d love to take a look for you to see if things are properly loaded etc.

    Hi Danny
    That loads ok with 200 but with a long delay.

    https://storageideas.uk

    I should point out that the default uploads file for this site is /media/…
    Cloudflare is the CDN with rocket loader and argo enabled

    Can’t think of anything else relevant?

    I have installed the plug-in on another site with a standard install and that works fine.

    Thanks

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hmm, interesting.

    Since the HTTP request returns “200 OK”, it means that the plugin is able to write to the buffer file successfully. So it must be the data aggregation that runs every minute that is failing somehow.

    The plugin should be smart enough to work with your custom uploads directory. If you look in /media/, do you see a file called pageviews.php?

    If so, can you please check the file for how many lines are in there? Does that look like 1 minute of visitors or more like all your visitors since you activated the plugin?

    Another thing is to check your PHP error log for errors, perhaps there is a clue in there.

    pageviews.php is in /wp-content/uploads/

    File has 80 lines which is more like a minute rather than the 30 hours or so since the plug-in was activated?

    No errors

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hey @darrencss,

    Thank you for checking – that looks like writing to the buffer file is indeed not the issue then.

    Could you please either check your database to see if the wp_koko_analytics_site_stats table is correctly created? Alternative, you could also check the “Network” tab of your browser’s developer tools while on the Koko Analyics dashboard page to see if there are HTTP requests with errors.

    Hi Danny
    The tables are present but all empty.
    No http errors in console either.

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hey @darrencss,

    I’m a little at a loss to what could have caused this, as it really seems like everything is working correctly (except for that nothing is showing up, of course).

    Question: do you happen to run your WP Cron system as a different user (e.g. through a real server cronjob) than the HTTP version of your website?

    Hi Danny
    No, WP Cron as standard.

    I have a custom functions plugin where the default image file is specified:

    //* Move Uploads Folder
    define( 'UPLOADS', ''.'media' );

    Commenting this out did seem to fix the problem initially but after visiting the site from a clean browser it didn’t seem like any new stats were being recorded?

    Obviously, setting the image file back to default breaks the site visually so it wouldn’t be a satisfactory fix anyways. It does give some clue to the source of the issue though?

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hey @darrencss,

    Thank you, that does give a clue.

    Are things working correctly if you move the line to your /wp-config.php file instead? That will rule out any issues with your plugin running too late and your site possibly using different storage locations, depending on when something runs.

    
    define( 'UPLOADS', ''.'media' );
    

    A good place to add it would be just before the following line:

    
    /* That's all, stop editing! Happy blogging. */
    

    Let me know please.

    PS. Please make sure to delete the line from your custom functions plugin first before adding it to wp-config.php, as trying to define an already defined constant will result in an error.

    Thank you Danny, that has certainly worked and the plug-in is now operating as expected.
    Much appreciate your support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.