You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this script the other day while tuning my store maximum speed and Google Pagespeed love. Firstly it's great, easy to implement and works straight away. I personally was using the 'scroll' detection but for some pages there's little or no scrolling needed.
Looking around I found another handy speed hack here 'Delay Google Tag Manager' and borrowed the mousemove and touchstart to add to your script. Now whenever someone moves the mouse, touches the screen or scrolls the script triggers and everything pops into life :)
Weirdly on Chrome if you have the dev console open the mousemove fails to work unless you click a button (which then triggers the activity) but if you have a visual thing being hidden, for example I hide my review stars until you scroll,move,touch it's easy to see the script has triggered.
For those looking to experiment you'll need to make the following changes to the script at line 130
Indeed the scroll event will not be triggered on pages that do not overflow. Your solution would ensure that when the user interacts (click, touch) with the page the script will load.
It's a good solution and I will probably add it to the load logic.
Thanks!
It's been working a treat on my store, I've had pretty good success trimming the fat, especially things like Printful and Klarna that are proper hogs yet are only needed on about 3 or 4 pages, and even then only after a mousemove. :)
Hi everybody,
I came across this script the other day while tuning my store maximum speed and Google Pagespeed love. Firstly it's great, easy to implement and works straight away. I personally was using the 'scroll' detection but for some pages there's little or no scrolling needed.
Looking around I found another handy speed hack here 'Delay Google Tag Manager' and borrowed the mousemove and touchstart to add to your script. Now whenever someone moves the mouse, touches the screen or scrolls the script triggers and everything pops into life :)
Weirdly on Chrome if you have the dev console open the mousemove fails to work unless you click a button (which then triggers the activity) but if you have a visual thing being hidden, for example I hide my review stars until you scroll,move,touch it's easy to see the script has triggered.
For those looking to experiment you'll need to make the following changes to the script at line 130
Hope this helps somebody :)
The text was updated successfully, but these errors were encountered: