On this page
What this issue is
Klaviyo is an email and SMS marketing platform. Its onsite tracking is a small script, klaviyo.js, that runs in the visitor's browser. It sets a cookie, records that the visitor is on your site, and sends events such as Active on Site, Viewed Product and Started Checkout to Klaviyo.
This issue means that script is missing, broken or only on some pages. Klaviyo then gets few or none of these browser events. Some events may still arrive from the server side, such as orders from a store integration, which can make the problem hard to spot.
Why it costs you leads or sales
Browse abandonment and abandoned cart flows start from these events. If Viewed Product or Started Checkout never fire, those flows never start. Shoppers who showed buying interest get no follow-up, and you lose recoverable revenue without any visible error.
Segments and personalisation suffer too. Product recommendations, "viewed but did not buy" segments and engagement-based sending all depend on onsite activity.
Example: a store with steady traffic sees abandonment flow triggers drop to almost zero when onsite tracking breaks. Numbers are illustrative.
- Product pageVisitor views a product
- klaviyo.jsScript blocked or missing
- Viewed Product eventNever sent
- Abandonment flowNever triggered
The visit happens, but Klaviyo never hears about it.
How to check if your site has it
Open a product page in a private window
Use a fresh private window with ad blockers off. Open DevTools (F12) and go to the Network tab.
Look for the Klaviyo script
Filter by
klaviyo. You should see a request forklaviyo.js(from static.klaviyo.com) with status 200.Look for event calls
After the page loads, requests to a.klaviyo.com (such as /client/events or /api/track) should appear for Viewed Product.
Check the console
Type
window.klaviyoin the Console. If it returns undefined, the script did not load.Identify yourself and check Klaviyo
Visit with a link from one of your own emails (or submit a signup form with a test address), view a product, then open that profile in Klaviyo and look at the activity feed for Viewed Product.
How to fix it
Check the Klaviyo integration
In Klaviyo go to Integrations and open Shopify. Confirm it is connected and the onsite tracking option is on.
Enable the app embed
In Shopify admin open Online Store, Themes, Customize, then App embeds. Turn on the Klaviyo onsite embed and save.
Remove duplicates
If an old klaviyo.js snippet sits in theme.liquid, remove it so the script loads only once.
Check the plugin
If you use WooCommerce, open the Klaviyo plugin settings and confirm the account is connected and onsite tracking is enabled.
Clear caches
Clear page cache and any script optimisation or delay-JS setting that may exclude or defer klaviyo.js.
Add a Custom HTML tag
Create a Custom HTML tag with the Klaviyo snippet and your public API key. Trigger it on All Pages.
Publish and preview
Use Preview mode to confirm the tag fires on product and checkout pages, then publish.
Check consent settings
If the tag waits for marketing consent, test with consent granted.
Add the snippet
Place the onsite script in the head of every page, replacing PUBLIC_API_KEY with your six-character public key.
Send events yourself
On custom stores, push Viewed Product and Started Checkout with klaviyo.push, as shown below.
<script async type="text/javascript" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>
<script>
!function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(n,i){return"push"===i?function(){var n;(n=window._klOnsite).push.apply(n,arguments)}:function(){for(var n=arguments.length,o=new Array(n),w=0;w<n;w++)o[w]=arguments[w];var t="function"==typeof o[o.length-1]?o.pop():void 0,e=new Promise((function(n){window._klOnsite.push([i].concat(o,[function(i){t&&t(i),n(i)}]))}));return e}}})}catch(n){window.klaviyo=window.klaviyo||[],window.klaviyo.push=function(){var n;(n=window._klOnsite).push.apply(n,arguments)}}}}();
</script>
<script>
klaviyo.push(['track', 'Viewed Product', {
ProductName: 'Example product',
ProductID: '123',
Price: 49.00
}]);
</script>Tracking missing
- No klaviyo.js request on product pages
- No Viewed Product in profile activity
- Browse abandonment flow never triggers
Tracking restored
- klaviyo.js loads once with status 200
- Viewed Product and Started Checkout appear on a test profile
- Flows trigger from real visits
How to confirm it's fixed
- klaviyo.js loads with status 200 on home, product and checkout pages
- window.klaviyo is defined in the Console
- A test profile shows Viewed Product in its activity feed within a few minutes
- Starting checkout with that profile adds Started Checkout
- The script appears only once in the page source
- Flow analytics show new triggers over the next days
How to prevent it happening again
Most breakages follow a change: a theme update, a new cookie banner, a caching or speed plugin, or a tag manager edit. Re-run the browser check after each of these.
- Re-test a product page and checkout after every theme, plugin or consent banner change
- Keep one loading method only: app embed, plugin or tag manager, not several
- Exclude klaviyo.js from delay-JS and script-minify settings
- Review flow trigger counts weekly and investigate sudden drops
- Document who owns the Klaviyo integration
How FunnelGuard handles this
FunnelGuard does not check for Klaviyo onsite tracking today. It is a possible future check, not a current feature.
What FunnelGuard does cover nearby: it runs your real customer journeys on a schedule, such as lead forms and checkouts, and checks each step plus the tracking hits sent to platforms like GA4, Google Ads and Meta. A broken checkout or lost ad tracking can show up there, but a missing Klaviyo event will not.
To watch for this yourself, put a recurring reminder in your calendar to run the browser check above. Also keep an eye on flow trigger counts in Klaviyo, and build a simple metric view of Viewed Product events per day so a sudden drop stands out. You can start with the Free plan or a free read-only website audit for the other tracking checks.
Questions people ask
Why is Klaviyo not tracking Viewed Product?
Usually klaviyo.js is not loading on product pages, because the integration is off, the app embed is disabled, a cache or script optimiser blocks it, or an ad blocker interferes. It can also be that the visitor is anonymous and Klaviyo cannot link the event to a profile yet. Check the Network tab for klaviyo.js and test with an identified profile.
Why is my Klaviyo Started Checkout event not firing?
Started Checkout needs the onsite script on the checkout pages and a working store integration. On Shopify, checkout can be restricted, so confirm the Klaviyo integration is connected and the app embed is on. Test with an identified profile and check its activity feed.
How do I check if Klaviyo onsite tracking is working?
Open a product page in a private window, filter the Network tab by klaviyo and look for klaviyo.js with status 200. Then type window.klaviyo in the Console. Finally, view a product as an identified test profile and look for Viewed Product in that profile's activity in Klaviyo.
Why is my Klaviyo abandoned cart flow not triggering?
The flow depends on a Started Checkout or Added to Cart event. If onsite tracking is broken, that event never arrives, so the flow cannot start. Check the flow's trigger and filters too, and confirm the shopper was identified by email.
Do ad blockers stop Klaviyo tracking?
Some ad blockers and privacy browsers can block klaviyo.js or its requests, so a share of visitors will never be tracked. You cannot fix that on your side. If your own tests fail, test again with extensions off to separate a site problem from a blocker.
Can I add Klaviyo tracking with Google Tag Manager?
Yes. Add the Klaviyo onsite snippet with your public API key in a Custom HTML tag that fires on all pages, and push events with klaviyo.push. Make sure it does not also load through a plugin or app embed, so it only runs once.
Does Klaviyo onsite tracking need cookie consent?
That depends on your legal advice and how you configure your consent banner. If your banner blocks marketing scripts until consent, klaviyo.js will not run for visitors who decline, and those visits will not be tracked. Test both consent states so you know what happens.
Related issues
- TRK-276Klaviyo identify not called after signupFix guide
- TRK-274ActiveCampaign / Mailchimp site tracking missingFix guide
- TRK-270UTMs not written to CRM contact fieldsFix guide
- TRK-273Salesforce Pardot / Marketo Munchkin tracking missingFix guide
- TRK-267HubSpot tracking code missingFix guide
- TRK-268HubSpot form submissions not linked to tracked visitor (hutk missing)Fix guide