• Resolved kaviyaayyappan

    (@kaviyaayyappan)


    Hi,

    In a dynamic single post, I want to show the current post unique visitors count. I tried with pageviews and visitors short code with id but it not showing the correct data.


    [wpstatistics stat=visitors time=total id=current]

    [wpstatistics stat=pagevisits time=total]

    In page insight i can see the correct data ex. visitors 2 but in frontend if it give page visits it giving count 9.

    Please guide me on this

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Matthew

    (@mhdizmni)

    Hi @kaviyaayyappan,

    Thank you for opening the thread!

    At the moment, our shortcode does not support tracking unique page visits. However, I’ve forwarded this request to our team, and we plan to include it in a future release.

    Thank you for your understanding and patience!

    Regards

    Thread Starter kaviyaayyappan

    (@kaviyaayyappan)

    Hi,

    Is there any PHP code option to get that value? I have tried few but not working

    Thanks

    Plugin Support Matthew

    (@mhdizmni)

    Hi @kaviyaayyappan,

    You can use the following code snippet to display the number of visitors for a specific post:

    $visitorModel = new \WP_Statistics\Models\VisitorsModel();
    $countVisitors = $visitorModel->countVisitors(['post_id' => 'POST_ID']);

    Enjoy!

    Best regards

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