Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real Time Visitors only counting recent visits, not open pages? (using HeartBeat) #13656

Closed
dougti opened this issue Oct 29, 2018 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@dougti
Copy link

dougti commented Oct 29, 2018

Hey guys,
Does the Real Time Visitors widget only count recent page landings?

I've added _paq.push(['enableHeartBeatTimer']); to my JS, however when monitoring our streaming pages, the live statistics in no way match the active connections I see on our streaming server.

I'd like to be able to map & visualize all of the active connections on our site. Is this possible?

Any help much appreciated

@tsteur
Copy link
Member

tsteur commented Oct 29, 2018

Yes that's the case. I thought it would count these, but looking deeper into the code I can see it wouldn't count them even though it maybe should. See https://matomo.org/faq/how-to/faq_21824/ it is only their to correct the visit duration, but not to keep the session active. It was initially implemented like this, but then changed due to couple of problems. For example you would see visits with several hours etc.

Are you familiar with PHP ? You could create a plugin and put this file into a Columns directory to change this behaviour:

./console generate:plugin --name="YourPlugin"

namespace Piwik\Plugins\YourPlugin\Columns;
use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
class VisitLastActionTime extends \Piwik\Plugins\CoreHome\Columns\VisitLastActionTime
{
    public function onExistingVisit(Request $request, Visitor $visitor, $action)
    {
        return $this->onNewVisit($request, $visitor, $action);
    }
}

@tsteur tsteur closed this as completed Oct 29, 2018
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants