Improving site speed after integrating with Klaviyo

  • 11 May 2021
  • 8 replies
  • 1164 views

Badge +2

Does anyone know the right way to install klaviyo on a shopify store that optimises performance? I've complained to Klaviyo that loads of scripts are installed and it impacts performance (a big no-no now that Google launched web vitals especially) and they send me to this page. But that method still injects loads of scripts, and doesn't even sync a shopify customer list with klaviyo profiles.

Specifically that method adds 8 scripts and 1 stylesheet (and this is without the shopify app intalled)
Tests before and after saw my store drop from 88 to 48 in google page speed insights (desktop) and from a B (88%) in GTMetrix to a D (56%).

It's just not sustainable to have this impact on performance and I'm reaching the end of my journey with Klaviyo unless someone can add some input to help.

Thanks!


8 replies

Userlevel 7
Badge +60

Hello @dilby,

I completely understand how frustrating this sort of experience can be in seeing your store’s page speed report drop from a score of 88 to 48. 

After manually installing the Klaviyo.js have you had a chance to review your Shopify integration settings and ensure that the Automatically add Klaviyo onsite javascript (recommended) setting has been disabled? If this setting was still enabled within your Shopify integration settings after also installing the Klaviyo.js manually, this would cause a duplication of the Klaviyo javascript present on your website. We would only recommend having one form of this installation method; either allow Klaviyo to automatically inject the snippet to your site, or through manually installing the snippet onto the site yourself. 

On top of the How to Install klaviyo.js for Shopify Stores article have you had a chance to taking a look into the Klaviyo.js and Site Speed Reports article? 

As detailed in that article, Klaviyo’s JavaScript is loaded asynchronously and would not prevent aspects of your site from loading. However, Google’s PageSpeed Insights and other site speed reports may still flag it as a contributing factor in your site’s load times.

This topic has been brought up several times within our Community such as the ones below. Echoing @cassy.lee’s response within them, our team is currently investigating ways to improve our javascript performance and prioritizing work in this area. We currently do not have any updates yet regarding this topic. However, once we have any news or updates from our internal teams, we’ll be sure to post and comment in this thread to communicate with all our Community members. 

Thanks for being a part of our Klaviyo Community!

-David

Badge +2

Thanks for the reply @david.to - However yes I have disabled that (already been through this with other colleages) and all these scripts still show. For me this probably makes me more confused why there is no expected bahaviour published or why there’s no direct comment or info in articles about exactly what scripts are meant to be seen. I have manually added the one script as per below:

<script async="" type="text/javascript" src="//static.klaviyo.com/onsite/js/klaviyo.js?company_id=xxxxxx"></script>

However it injects all the other scripts mentioned. In fact asking to not automatically add on-site javascript in the shopify app seems to make no difference. Do you have any information on the exact difference I’m meant to see?

The links to the articles you’ve included at the end of the post just reiterate my points and end with yourselves saying you need to do better. I’m aware scripts are async, but in a world of Web Vitals, klaviyo is actively lowering site conversions, and is unsustainable.

 

Userlevel 7
Badge +60

Hello @dilby,

Thanks for that confirmation!
There actually would not be any visual differences between manually installing the Klaviyo.js or allow Klaviyo to automatically inject the Klaviyo.js onto your site. Both options carry with them several lines of scripts needed to trigger certain Klaviyo functions such as allow Klaviyo signup forms to publish, triggering the Active Onsite event, triggering the Viewed Product event, etc. 

Manually installing the Klaviyo.js versus automatically injecting the Klaviyo.js will alleviate some extra resources required to pull from the injected script. 

I concur with you that there is always progress to be made in this venue. Our team is definitely looking to improve how our onsite JavaScript experience performs and we’re investigating methods to improve that experience. 

I’ll share this feedback you’ve provided to our Product Team to further help them remedy this situation. We truly appreciate the feedback that all our Community members can share with us as it provides context to our teams to gain more insight into areas we can improve.

Once again, we truly appreciate you sharing your experience and feedback with our Klaviyo Community.

David

 

Badge +1

 

I concur with you that there is always progress to be made in this venue. Our team is definitely looking to improve how our onsite JavaScript experience performs and we’re investigating methods to improve that experience. 

 

Has any progress been made ?

Userlevel 7
Badge +60

Hi there @clicklabsdev

 

Thanks for sharing your question! 

 

I wanted to let you know that I’ve answered a similar question you had in another thread below! 

 

-Taylor 

Badge +2

@dilby we feel your pain, and we noticed many others experience the same. That’s why we built an app that allows you to block Klaviyo Javascript on pages where it’s not required. 

Download the app & defer or block Klaviyo’s Javascript
https://apps.shopify.com/pagespeed-javascript 

 

Badge

same issue here now, i notice that my gtmetrix is down rapidly from 100% to 82%

Userlevel 7
Badge +36

Hi @ggleam!

Not sure if you’ve seen it, but here is a Help Center Article about site speed reports and klaviyo.js and how to troubleshoot this issue. Additionally, here is a publication about how to improve form performance:

 

I will also forward this feedback to our product team on your behalf.

 

Best,

Brian

Reply