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

HowTo Disable Heartbeat on Single Page App with multiple siteIds #10836

Closed
ChDeinert opened this issue Nov 4, 2016 · 1 comment · Fixed by #10843
Closed

HowTo Disable Heartbeat on Single Page App with multiple siteIds #10836

ChDeinert opened this issue Nov 4, 2016 · 1 comment · Fixed by #10843
Assignees
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@ChDeinert
Copy link

I work on a Single Page App / Website, where we track our Data onto one server, but with multiple siteIds and enabled HeartBeat.
We took this approach to be able to track both, the App overall and additional specific routes (with customVariables). Convenient for our analysis of the data in a later step.

We are now facing a Problems with our approach on Page changes. We start more and more Trackers with enabled HeartBeart and cannot stop/remove the ones from previous pages, until we reload the page in the Browser. It can lead to a long list of pings the Client sends each x seconds.

We would like to be able to stop/disable the heartbeat on one or more of the obsolete Trackers by their siteId. I think the method disableHeartBeatTimer could help, but it's Debug only.
Maybe I just missed something and you can point me towards a possibility prevent the above behaviour. I would like to fix the Problem without changing our whole approach.

@ChDeinert ChDeinert changed the title Disable Heartbeat on Single Page App with multiple siteIds HowTo Disable Heartbeat on Single Page App with multiple siteIds Nov 4, 2016
@tsteur
Copy link
Member

tsteur commented Nov 6, 2016

By looking at the code enableHeartBeatTimer should enable a heart beat timer only once per tracker/website but not add more on page changes. Are you doing anything special on page change?

Are you using _paq.push to track or Piwik.get[Async]Tracker?

A workaround to disable a tracker would be currently to set something like _paq.push(['enableHeartBeatTimer', 0]).

The method disableHeartBeatTimer should definitely be exposed as it may be useful in general to have it eg if you want to disable heart beat again on a certain page.

@tsteur tsteur added this to the 3.0.0-b3 milestone Nov 6, 2016
@tsteur tsteur self-assigned this Nov 6, 2016
@ChDeinert ChDeinert added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants