before I installed Klaviyo, I wouldn’t say my site was perfect, but I would get a healthy B grade from pagespeed etc.
Now I get an F, and the only reason for that is Klaviyo’s javascript taking 9 seconds to load. Even loading Asynchronously, which appears to be the stock answer, it is the longest loading part of the page load.
Even the Image for the signup form pop up loads slowly, and I optimised that image to make it as small as possible.
My server is in Singapore, do you have any CDNs in the area?
Is it possible to install the javascript and image locally on my server so I don’t have the long load time?
Thanks so much for your patience while I investigated this further! I chatted with @hansen on this and, as I mentioned to @David B. in another post around loading times for .js files, our team is currently investigating ways to improve our JS performance and prioritizing work in this area.
@skabrnes regarding your questions above on Wordpress and hosting your own files…we don’t recommend that you host your own files, because if you self host, we can’t guarantee that Klaviyo features, such as forms, will continue to work properly. You could, however, upload smaller images to the Klaviyo asset library and use that to alleviate some of the loading time issues. Our team is discussing better ways to help our customers with image optimization and reduce JS sizes. We will provide an update when we learn more from the team.
Thanks so much, and we appreciate your patience on our response!
9 seconds is the slowest I’ve ever heard! Would you be able to share details of your PageSpeed results? I ran a test on your site and the results aren’t as bad (Klaviyo took ~220ms) but I’m not sure if it’s location-dependent since I’m in the US.
As far as I can see implementing a CDN for at least a few parts of the world might be the best bet.
It seems Honk Kong and Malaysia have similar timings, so I would imagine South East Asia in general will suffer this issue.
Or better still, if we are using wordpress, would it be possible for us to host our own files? As I also see a really slow clunky load of the popup images as those images also come from Klaviyo, and I’ve optimised them down to a very small size.
Thanks so much for your patience while I investigated this further! I chatted with @hansen on this and, as I mentioned to @David B. in another post around loading times for .js files, our team is currently investigating ways to improve our JS performance and prioritizing work in this area.
@skabrnes regarding your questions above on Wordpress and hosting your own files…we don’t recommend that you host your own files, because if you self host, we can’t guarantee that Klaviyo features, such as forms, will continue to work properly. You could, however, upload smaller images to the Klaviyo asset library and use that to alleviate some of the loading time issues. Our team is discussing better ways to help our customers with image optimization and reduce JS sizes. We will provide an update when we learn more from the team.
Thanks so much, and we appreciate your patience on our response!
@skabrnes I've actually played around with hosting them on my own site running from main domain instead of klaviyo.com domain and it did seem to work but as @cassy.lee mentioned it's not recommended. You'd need to make sure all files are always up to date etc. So wouldn't do this on production.
Also, loading custom fonts and big images in popups can sometimes also create a slowdown. Not sure if the amount of popups you have in Klaviyo (disabled or not) will also create speed issues?
I’m not sure what you’ve done to improve your load time so far, but want to echo @Omar’s awesome suggestion of making sure you have only one signup form live on each page as more signup forms you use per page the slower it gets.
Additionally, as injecting our onsite script through our integration settings is an option for ease of use, you can improve your page load speed by unchecking this option and Manually Install klaviyo.js for Shopify Stores to your theme.liquid file before the closing </body> tag. Here's your script required for manual installation:
@skabrnes one solution would be to only load the Javascript where it is required. Unfortunately, Shopify apps don’t have such a behaviour by default but we created a Shopify app to solve the problem with unused Javascript: https://apps.shopify.com/pagespeed-javascript
It worked well for us, as we only required the Javascript on our homepage and not on product pages etc.