[Bug] Heartbeat may not work in combination with tracker plugins #22166
Labels
Bug
For errors / faults / flaws / inconsistencies etc.
c: Data Integrity & Accuracy
c: Documentation
For issues related to in-app product help messages, or to the Matomo knowledge base.
c: Tracking
For issues related to getting tracking data into Matomo.
Milestone
What happened?
The heartbeat feature for the tracker checks various events to update the visit duration. With a default configuration (15 second heartbeat interval), if the page goes out of focus (e.g. tab switched) after it was watched for more than 15 seconds, a ping request is sent to the server to update the visit duration:
heartbeat-only.webm
The page will get a grey background and have "blurred" in the top right corner once focus is lost. In this example everything is working as expected and the visit duration was updated.
Some tracker plugins sent their own requests to the server, and can have unexpected effects. The heartbeat will only be sent if there has been no other tracker request during the configured interval.
If a plugin does not update the last action time itself, this can more or less break the heartbeat feature:
heatmap-only.webm
Tracker plugin sends a request. The blur event on the page does not send a ping because the plugin request was sent too recently.
In some cases the heartbeat can be skipped only partially:
mixed.webm
Ping request got sent after enough inactivity of the plugin. Having a shorter heartbeat timeout could achieve partial heartbeat success with interleaved requests (plugin, heartbeat, plugin, heartbeat, ...), though only a workaround without guarantees.
What should happen?
The behaviour of the heartbeat should either be not affected by plugins, or be documented as "potentially dependent" on what the plugins are doing.
How can this be reproduced?
Videos were taken with an active Heatmap recording.
Matomo version
5.x
PHP version
No response
Server operating system
No response
What browsers are you seeing the problem on?
Firefox, Chrome
Computer operating system
No response
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: