Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Klaviyo onsite tracking missing: fix Viewed Product events

TRK-275Medium impactCould addBy FunnelGuardPublished Updated
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.

Flow triggers per week before and after the fixExample numbers
Flow triggers per week before and after the fix (example)Tracking working: 120 triggers; Script missing: 4 triggers; After fix: 118 triggers046921204118Tracking workingScript missingAfter fixtriggers

Example: a store with steady traffic sees abandonment flow triggers drop to almost zero when onsite tracking breaks. Numbers are illustrative.

Where the journey breaks
  1. Product pageVisitor views a product
  2. klaviyo.jsScript blocked or missing
  3. Viewed Product eventNever sent
  4. Abandonment flowNever triggered

The visit happens, but Klaviyo never hears about it.

How to check if your site has it

Check onsite tracking in your browser
  1. 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.

  2. Look for the Klaviyo script

    Filter by klaviyo. You should see a request for klaviyo.js (from static.klaviyo.com) with status 200.

  3. 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.

  4. Check the console

    Type window.klaviyo in the Console. If it returns undefined, the script did not load.

  5. 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

Restore onsite tracking by platform
  1. Check the Klaviyo integration

    In Klaviyo go to Integrations and open Shopify. Confirm it is connected and the onsite tracking option is on.

  2. Enable the app embed

    In Shopify admin open Online Store, Themes, Customize, then App embeds. Turn on the Klaviyo onsite embed and save.

  3. Remove duplicates

    If an old klaviyo.js snippet sits in theme.liquid, remove it so the script loads only once.

Klaviyo onsite script and a Viewed Product eventhtml
<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>
Before and after

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

Confirmation checklist
  • 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.

Prevention habits
  • 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.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.