[Bug] setLinkTrackingTimer
does not influence delay if sendBeacon is used
#22770
Labels
Potential Bug
Something that might be a bug, but needs validation and confirmation it can be reproduced.
To Triage
An issue awaiting triage by a Matomo core team member
What happened?
Matomo caused our Interaction Next Paint (INP) timing statistic to be longer than the 200ms deemed acceptable by Google, which resulted in downranking in Google search.
Trying to counter #21297, we set
setLinkTrackingTimer
to 0. It is described as:Source: https://developer.matomo.org/guides/tracking-javascript-guide#changing-the-pause-timer
However, the delay when the browser’s “send beacon” is used is hard coded to 100ms and not lowered by setting the link tracking timer.
What should happen?
The 100ms hard coded delay should be reduced to the value of
configTrackerPause
, if the latter is set shorter. I.e. usedelay
for legacy tracking requests andMath.min(delay, 100)
when using send beacon.Alternatively, the 100ms delay should be removed entirely, since “send beacon” exists precisely for reliably sending beacons at unload, without requiring any artificial delay.
How can this be reproduced?
Find that the 100ms delay still applies. This means that the configuration is not effective. This is the bug.
Optionally inspect the JS source code and find that the
delay
argument to the send request and send batch request functions is not used when use of send beacon is enabled.Matomo version
5.1.2
PHP version
8.3
Server operating system
Debian 12
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Computer operating system
All
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: