• Resolved Valentin

    (@valentinalisch)


    Hey there!

    First of all: Thanks for providing a free version of WP Statistics and maintaining it. I have been using it ever since.

    Recently I started noticing some strange behavior on my website and WP Statistics stopped tracking visitors all together. I managed to work out the problem and could trace it back to being a problem with how WP Statistics handles hits that are generated through JavaScript when working with history.pushState.

    The hit is send successfully and is inserted into the database table as well but using the wrong (page) ID. The database entry is saved with the ID of the page I first opened and not with the corresponding ID which the page that got fetched via JavaScript. This breaks WP Statistics entirely and the plugin is not able to track visits to any of the pages (I guess because there are multiple database entries with the same ID now).

    See the following screenshot attached with the corresponding navigation steps I took:

    Any help in solving this problem would be greatly appreciated!

    Thanks a lot 🙂

    • This topic was modified 3 months ago by Valentin.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mehmet

    (@gandomi)

    Hi @valentinalisch,

    Thanks for reporting this! You’ve identified a known issue with WP Statistics and JavaScript-based navigation. There’s an active discussion on GitHub about this exact problem:

    https://github.com/wp-statistics/wp-statistics/issues/1019

    The team is aware that the JS tracker doesn’t properly handle history.pushState events. The page ID from the initial load gets stuck and used for all subsequent AJAX navigations.

    For now, the best workaround is to either:

    1. Disable JavaScript-based tracking in WP Statistics settings (rely on server-side only)
    2. If you’re comfortable with code, you can manually trigger a fresh tracking call after your AJAX navigation completes

    The development team is working on a proper fix. I’d recommend subscribing to that GitHub issue for updates. Thanks for your patience and for using WP Statistics!

    Plugin Support Mehmet

    (@gandomi)

    Hi @valentinalisch,

    Since we haven’t heard back from you, we’ll go ahead and mark this topic as resolved for now.

    If you still need assistance, feel free to reopen this topic or create a new one and we’ll be happy to
    help.

    Best regards

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

You must be logged in to reply to this topic.