Solved

delay klaviyo scripts by 10 seconds


Badge +1

Our clients using the mobile version are complaining about a slow performance on thier mobiles. It seems that Klaviyo resources are taking a lot of load time. Can you delay klaviyo scripts by 10 seconds, so the site can be loaded quickly and before Klaviyo runs.

icon

Best answer by alex.hong 7 July 2022, 19:20

View original

2 replies

Userlevel 7
Badge +58

Hello @Alex_K 

Welcome to the Community.

Klaviyo's onsite snippet, klaviyo.js, is loaded asynchronously and will not impact site rendering speed. Slower load times on devices can also be attributed If, when klaviyo.js is loaded on the site you still prefer to optimize for site speed it is possible to instead use a Legacy Embed form or custom code your own. Here's some documentation around our Legacy form feature: Add and Customize a Legacy Embedded Signup Form.

I recommend double checking your website for duplicate scripts of our onsite javascript. Having multiple or duplicate scripts installed can slow down the sign-up form load times as well. If you notice duplicate scripts, you should reach out to support to have them remove the duplicates.

Additionally, depending on your integration, you may have a larger version of the same snippet. If so, I recommend removing the larger, automatically injected snippet  and replacing it with the javascript snippet contained in the article.

Finally, I would check the overall composition of your site code. You may need some general refactoring to optimize speed on your site, which again I would contact a developer to assist with this task.

Here’s some related community post on this as well:

 

All the best,

Alex

Badge +2

@Alex_K another way, instead of delaying it, would be to load it only on the pages where you require it. We created an app for it, that allows you to block 3rd party Javascript on pages where it is unused: https://apps.shopify.com/pagespeed-javascript 

Maybe it helps - also helps for other apps like Zendesk etc

Reply