• As of 2 or 3 days ago, something broke in the plugin, and 90% of visits aren’t being counted(I checked using a secondary statistics tool, awstats, and visits/page views remained normal during those days, but inside wpstatistics, almost nothing was counted)

    When checking the debug page, it says that “tracker.js” is missing(which it isn’t, I personally openned the directory its supposed to be in and its there and loading just fine on the browser)

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mehmet

    (@gandomi)

    Hi @peq42,
    Thank you for the detailed report. Based on what you’re describing, this is very likely caused by your server’s optimization setup interfering with the WP Statistics tracker script.

    Looking at your site, you have mod_pagespeed enabled at the server level, and possibly
    Autoptimize as well. These tools can rewrite, combine, or cache JavaScript files, which can
    prevent tracker.js from loading correctly for visitors, even though the file exists and loads
    fine when accessed directly.

    Here’s what I’d recommend:

    1. Exclude tracker.js from mod_pagespeed, You can do this by adding the following to your
      .htaccess file:
      ModPagespeedDisallow “/wp-statistics/
    2. Exclude from Autoptimize (if active), Go to Autoptimize settings and add wp-statistics to
      the JS exclusion list. (https://wp-statistics.com/resources/how-to-exclude-wp-statistics-tracker-js-from-caching-minification/)
    3. Purge your mod_pagespeed cache after making these changes:
      sudo touch /var/cache/mod_pagespeed/cache.flush
    4. Or contact your hosting provider to flush it for you. After applying these changes, WP Statistics should start tracking visits normally again.

    Let us know if that resolves the issue!

    Best regards

    Thread Starter peq42

    (@peq42)

    cant do that on a shared host.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.