I want to get live visitors only for one specific page. I’m using Live.getCounters
and specify segments
like this:
https://example.com/index.php?module=API&format=JSON&token_auth=MY_TOKEN&idSite=MY_SITE_ID&lastMinutes=5&method=Live.getCounters&segment=pageUrl=$example-path
*Using =$
operator to get page which ends with example-path
I can get visitors for the page, but the issue is that if that user navigates to another page on the same website, I will still get him as a live visitor for the specified page (but he is already on another one). I also tried to use eventUrl
and actionUrl
instead of pageUrl
but got the same results.
I also tried to use Actions.getPageUrl
but it returns the visitors count for the whole day. I need only recent online users (ex., users who visited the page during the last 5 minutes)
I will appreciate any help. I could not find the strict answer in the documentation and the forum.