-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Past Issues Searched
- I have searched open and closed issues to make sure that the bug has not yet been reported
Issue is a Bug Report
- This is a bug report and not a feature request, nor asking for self-hosted support
Using official Plausible Cloud hosting or self-hosting?
Plausible Cloud from plausible.io
Describe the bug
I noticed the following performance issue in Google PageSpeed insights for my site: https://pagespeed.web.dev/analysis/https-bonforfait-fr-forfait-mobile/cb3p4e98kp?utm_source=search_console&form_factor=mobile&hl=en

This is caused by the the Plausible tracking script:
analytics/tracker/src/engagement.js
Lines 129 to 136 in 1531386
return Math.max( | |
body.scrollHeight || 0, | |
body.offsetHeight || 0, | |
body.clientHeight || 0, | |
el.scrollHeight || 0, | |
el.offsetHeight || 0, | |
el.clientHeight || 0 | |
) |
This code is used in the getDocumentHeight
function to track scrolling position.
Expected behavior
I'd like to avoid performance this penalty.
Maybe it is possible to wrap the getDocumentHeight
function in a requestAnimationFrame
? And to cache its value?
An alternative would be having the option to disable scroll tracking.
Screenshots
No response
Environment
Metadata
Metadata
Assignees
Labels
No labels