We use Klaviyo sign-up forms on our blog articles only. Klaviyo is slowing down page load times on all pages, even though it should only be running on blog pages.
How can I turn off Klaviyo tracking for all pages other than blog pages? I can’t find any Klaviyo code snippets in my Shopify store, and I’ve already set Klaviyo to only run on blog pages in the newsletter settings.
Screenshot below from Lighthouse shows Klaviyo blocking main thread work on a non-blog page.
Best answer by cassy.lee
Hi @IlluminateLabs, our apologies that our team’s original suggestion of deleting the additional company id in your script did not work. It looks like this may be beyond the ability of our overall Community to be able to provide more feedback on, as we tried the approach of what seems most obvious. Since this may require deeper troubleshooting outside of our expertise in a Community forum, I’m going to connect you with someone from the Klaviyo team that is better suited to dive deeper on this issue with you. You should be contacted shortly via email (the one you used to create your Community account with) with additional questions and follow up. In the meantime, I’ll unmark the “best answer selected” until we hear that there’s been a resolution.
Thank you so much, and I hope you and yours had a fantastic holiday. -Cass.
With our native integration with Shopify we will automatically add web tracking to your entire site if you check the box within the integration settings page. If you have concerns about the load time of your site you can choose to manually install the snippet for just certain pages on your site. You can do this following the instructions here.
Let me know if this helps and thanks again for visiting the Community!
Got it. Thank you for your reply. So I’m guessing I should first turn off this button in integration settings: Automatically add Klaviyo onsite javascript (recommended)
Then to set the script to only run on blog articles, would this conditional statement work:
{% if template contains "blog" or "article" %} <script type="text/javascript" async src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=NjDyPw "></script> {% endif %}
@k.mcevoy it’s really unclear from both the article and the integration settings page whether I need to turn off “Automatically add Klaviyo onsite” if I’m just adding the script to the theme.liquid file for specific pages. Some guidance would be appreciated.
If you wanted to exclude the Klaviyo tracking from specific pages on your Shopify site you would uncheck the box within the integration settings, and manually apply the code to the pages where you would like Klaviyo web tracking to run.
That code snippet should work and only apply the Klaviyo web tracking to your blog pages.
@k.mcevoy Thanks for your response. I unchecked that box and saved to update the integration settings, then pushed the theme live with the manually applied code.
It didn’t work. Klaviyo is still running on all pages (as you can confirm by running Lighthouse on any non-blog page of our site).
Is there a period of time that integration settings take to process on Klaviyo’s backend?
@k.mcevoy following up again. Since this seems to be an issue on Klaviyo’s end I’m not going to be able to solve this myself. The automatic integration has been removed but Klaviyo is still running on all pages of my site. Can you or someone on your team explain why this is happening?
Hi @IlluminateLabs, thanks so much for following up on this and going through the steps of unchecking the box for integration settings.
Another area I’d recommend checking is to see if you have a duplicate account that would add extra javascript to your theme. If you’ve previously created a duplicate account with a .io email (instead of .org), you would need to log in to uncheck the option to inject javascript within the Shopify app of the duplicate account, and then update the integration. You should also disable that Shopify integration after you’ve completed this step.
Hope that's helpful and resolves the issue with your page load times!
@k.mcevoy Brilliant, that must be it! We used to be .io but migrated to .org and it appears there’s still a .io account login. However I can’t update the integration on that account because it never finished onboarding.
Could your team possibly just delete that account entirely (associated with calloway@illuminatelabs.io)? That would probably be the most efficient way to solve this problem.
Hey @IlluminateLabs cancelling the account will not automatically remove the Klaviyo web tracking from your Shopify store. You would have to delete that script on Shopify’s end.
Could you clarify a bit more on what you mean when you say you can’t update the integration because you didn’t finishing onboarding?
@k.mcevoy I just completed the onboarding for the .io account and then removed the Shopify integration. Could you please have someone on your team delete that account?
Also I just ran my site through Lighthouse and Klaviyo is still blocking main thread work. Do you know if there’s a processing delay between when an integration is deleted on your site and when that change is actually made on Shopify?
We went ahead and deleted the script tag that included your duplicate company id (.io). It sounds like you disabled the Shopify integration before unchecking the box that automatically injects the javascript to your theme and clicking “Update”. You should be all set with this now!
@k.mcevoy thank you for deleting the duplicate account script. Unfortunately Klaviyo is still running on all pages. You can verify this yourself by running any page on our site through Lighthouse. Could you or someone on your team check that the integration is working on your end?
@k.mcevoy following up about this. I just manually searched through every theme file to confirm that there was no Klaviyo script on any of them except blog and article pages, and there wasn’t.
However it’s still running on all our pages. How can we solve this?
@k.mcevoy why is this being marked solved when it hasn’t been solved at all and I’m being ignored? Can someone else on your team comment on this issue which seems to be an error on Klaviyo’s end?
Hi @IlluminateLabs, our apologies that our team’s original suggestion of deleting the additional company id in your script did not work. It looks like this may be beyond the ability of our overall Community to be able to provide more feedback on, as we tried the approach of what seems most obvious. Since this may require deeper troubleshooting outside of our expertise in a Community forum, I’m going to connect you with someone from the Klaviyo team that is better suited to dive deeper on this issue with you. You should be contacted shortly via email (the one you used to create your Community account with) with additional questions and follow up. In the meantime, I’ll unmark the “best answer selected” until we hear that there’s been a resolution.
Thank you so much, and I hope you and yours had a fantastic holiday. -Cass.
By clicking “Accept All Cookies,” you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
Privacy Preference Center
Your Privacy
Strictly Necessary Cookies
Performance Cookies
Functional Cookies
Targeting Cookies
Site Analytics
Your Privacy
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
Privacy Notice
Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
Performance Cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
Functional Cookies
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
Targeting Cookies
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.
Site Analytics
These cookies record your visit to our website, and are used to track your visit including information such as: web page interactions (clicks, hovers, focus, mouse movements, browsing, zooms and other interactions), referring web page/source through which you accessed the Sites, heatmaps and scrolls, screen resolution, ISP, and statistics associated with the interaction between device or browser and the Sites. If you are accessing our Services with a European IP address, you have been asked to consent to the use of these cookies (you are free to deny your consent).