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

[Bug] Heartbeat may not work in combination with tracker plugins #22166

Open
4 tasks done
mneudert opened this issue Apr 26, 2024 · 0 comments
Open
4 tasks done

[Bug] Heartbeat may not work in combination with tracker plugins #22166

mneudert opened this issue Apr 26, 2024 · 0 comments
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.

Comments

@mneudert
Copy link
Member

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

@mneudert mneudert added Bug For errors / faults / flaws / inconsistencies etc. c: Data Integrity & Accuracy labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant