Pagespeed insights - how to make it work
We are facing some issues with pagepeed insights and drift. it's very heavy on our page-load therefore our score just went down dramatically.
The main offenders:
- the font
- the JS payload is huge.
We can't afford to load by scroll or click since we need our users to see the widget when they come to our site. we tried to delay the load of the code to the end of our loading process but still, google sees it as an excessive amount of JS.
This article shows how to improve:
https://gethelp.drift.com/hc/en-us/articles/360019504134-Drift-Load-Time-and-Supported-Browsers
but honestly, it throws the responsibility back on the dev since it gives the obvious choices to the loading event.
Any guidance will help here.
Comments
Hi there!
Sorry to hear you're experiencing loading speed issues with Drift. Looking at the Drift script file on site kemptechnologies.com I see you've set the time delay you mentioned within an IIFE. I'd like to explore another option with you, instead of wrapping the Drift snippet within an IIFE, try wrapping your code with a regular function and then set the time delay to invoke this function after the widget has loaded.
For example:
https://jsfiddle.net/867gL4hr/
See if this helps your pagespeed insights score. Please let me know! Have a good one!
You have a small error in your code but i can do something with the suggestion. testing now.
Doesn't look like it helped a lot. Google still sees drift as a problem when it comes to font visibility (no fallback for this Brandon font) and js execution time is affected dramatically.
Any suggestion is welcome here.
Yaron
Did some more work and came back with some good insights!
Hope it helps other people
Yaron
Hi Yaron!
My apologies for the syntax error I didn't catch that but I'm glad it helped out a bit! You came back with really great insights that I was not aware of. Thank you for sharing your findings with us, this will definitely help others and myself in the future!
Thanks for posting and feel free to reach out if there's anything else you come across!
Best,
Miguel - Technical Support