Troubleshooting Klaviyo.js and site speed reports
You will learn
Learn about Klaviyo's onsite JavaScript (Klaviyo.js), which is the code snippet that you paste on your site to enable Active on Site tracking, and its impact on site speed. Klaviyo.js needs to be installed in order for you to publish Klaviyo sign-up forms on your website.
For help enabling Active on Site through your integration, see how to verify that sign-up forms are enabled.
Troubleshoot site speed performance
Klaviyo.js is injected automatically through many of our ecommerce integrations, and you can manually install it for other platforms. It enables Klaviyo sign-up forms to appear, and can allow you to track when customers are active on your site.
- If you find that Klaviyo’s JavaScript is impacting your website’s performance (i.e., PageSpeed score) and it was automatically installed through an integration, you can try manually installing it instead.
For Shopify, we recommend you enable Active on Site tracking through Klaviyo’s Shopify app embed rather than manually installing. This bypasses the website’s native tag manager and can result in faster loading of Klaviyo’s JavaScript.
- If you don't use Klaviyo sign-up forms (meaning you use another tool for creating and publishing sign-up forms on your website), make sure that all forms in your Sign-up forms tab are set to Draft. You can keep Klaviyo.js installed for onsite tracking while your forms are offline.

Navigate to the Sign-up forms tab to see the Status of each of your sign-up forms. Live indicates a published form on your site, Editing indicates a live form that has unpublished changes, and Draft indicates a form that is not currently published on your site, including a form you previously took offline.
For a live form without an active A/B test or optimization:
- In Sign-up forms, open the form’s three-dot menu and select Edit.
- In the editor’s status dropdown, select Draft. This takes the form offline; you do not need to publish the change.
- Return to Sign-up forms and confirm that the form’s Status is Draft. Repeat for each live form you no longer use.
For a form with an active A/B test, open Analytics from the form’s menu, go to A/B test results, and select the active A/B test. Click Choose Winner, select a variation, choose End test and set selected variation to draft, then click Choose Winner to confirm.
For a form running an optimization, open Analytics from the form’s menu and go to A/B test results. Select Optimization test and the active optimization, then select End test from the three-dot menu. Choose the variation to keep and click End test to confirm. This leaves the selected variation live, so follow the steps above to set the form to Draft.
If a form is scheduled to go live later, open its menu in Sign-up forms, select Edit schedule, and click Delete Schedule so it stays offline.
Klaviyo’s standard installation methods load Klaviyo.js asynchronously, so the browser can continue loading the page while it downloads the script. Running the JavaScript still uses browser resources and can affect page performance. Google’s PageSpeed Insights and other site speed reports may therefore flag it as a contributing factor in your site’s load times.
Site speed and SEO are important to our customers, and Klaviyo is committed to minimizing the impact from our JavaScript. Learn how our engineers have optimized klaviyo.js. You will continue to see improvements as we release new updates to make Klaviyo.js more performant and improve load times.
Additional resources
- Getting started with Klaviyo onsite tracking
Learn about the different ways that Klaviyo can support onsite tracking on your ecommerce site. There are 2 key types of onsite tracking:
- Understanding third-party apps
Learn how to find third-party apps, which are apps built by third parties (instead of by Klaviyo) using Klaviyo's APIs. Klaviyo's APIs enable a large variety of third-parties to build apps and integrations with our platform. You can search for both Klaviyo-built integrations and select third-party apps in our app marketplace. If you are looking for an app you can't find on our marketplace, we recommend reaching out to the platform directly.