Skip to content

Use a custom implementation for tracking of spent time per view

Daniel Gerhardt requested to merge fix-tracking-heartbeat into master

The heart beat for time tracking is now manually implemented through ping requests which are sent in intervals after the initial page view.

Matomo's heart beat handling has been changed in the past and doesn't work as one would expect.

From Matomo's documentation:

The heart beat request is executed when:
* switching to another browser tab after the current tab was active
  for at least 15 seconds (can be configured see below).
* navigating to another page within the same tab.
* closing the tab.

See: https://developer.matomo.org/guides/tracking-javascript-guide#accurately-measure-the-time-spent-on-each-page

Merge request reports