pluginkollektiv / statify

Statify – statistics plugin for WordPress
https://wordpress.org/plugins/statify/
GNU General Public License v3.0
77 stars 22 forks source link

Delayed Javascript execution #120

Open Zodiac1978 opened 5 years ago

Zodiac1978 commented 5 years ago

Reported via Twitter: https://twitter.com/e_demonki/status/1050707047057158149

ich lasse das Script von Statify erst laufen nachdem gescrollt und 10 wahlweise 30 Sekunden vergangen sind. So weiß ich, dass auch ein bisschen gelesen wurde... :)

Is this something we should explore?

stklcode commented 5 years ago

For JS tracking a delay would be easy to add, just another parameter to the JS arguments and wrap the call into a setTimeout block. Adding a "scroll" event listener is not much magic either. So far for the technical point...

Timeout seems legit to me. It adds another filtering layer for "real" users (assuming bots don't stay on a single page for 10s) and potentially removes manual search or skimming. Might be worth the effort.

For scroll-detection however I'm not convinced. Not applicatble for short pages (while "short" potentially means a whole lot of text on reasonably sized desktop monitors).

Finally if both would be added, there must be a clear decision when to track. After scrolling OR or AND timeout? Is scroll-detection without timeout a reasonable use-case?

patrickrobrecht commented 4 years ago

+1 for the timeout - that's something which we can make configurable (default set to 0 for backwards compatibility).