Klaviyo Web Tracking: 7 Smart Steps to Capture Data & Trigger Revenue (2025)
Analytics · Ecommerce Tracking

Klaviyo Web Tracking: 7 Smart Steps to Capture Data & Trigger Revenue

11 min read By Sendora Team

Most ecommerce brands install Klaviyo but never fully unlock its real power — web tracking that drives smarter segmentation, real-time automations, and higher ROI. When set up correctly, Klaviyo captures product views, add-to-cart actions, checkout events, and UTM data — turning every click, scroll, and visit into revenue-driving intelligence.

What This Guide Covers
  • Core web tracking events and exactly what they capture
  • 3 verified ways to install klaviyo.js for your platform
  • How to set up identity tracking with the Identify API
  • Building high-intent behavioural segments from event data
  • Triggering flows like browse abandonment with tracked events
  • Debugging tracking issues fast with DevTools and the Activity Feed
  • Staying GDPR and CCPA compliant without sacrificing performance

Step 1: Understand Core Klaviyo Web Tracking Events

Klaviyo’s web tracking captures on-site behaviour and ties it to customer profiles — enabling segmentation, personalisation, and automated flows like browse abandonment. All tracking is powered by the klaviyo.js script and records activity only when a visitor is identifiable to Klaviyo.

Default On
Active on Site

Fires when an identifiable person visits your site. Useful for real-time segments and time-sensitive flows. Requires cookie-based identification or a prior Klaviyo interaction.

App Embed
Viewed Product

Tracked automatically on Shopify when you enable the Klaviyo app embed in theme settings. Records when identifiable visitors view specific product pages — the foundation of browse abandonment flows.

Auto
Checkout Started

Captured automatically when Shopify’s checkout begins, if the integration is connected and Track behavioural events is enabled. Powers abandoned checkout recovery flows.

Toggle On
Added to Cart

Enable under Integrations → Shopify → Onsite tracking → Track behavioural events. Also activates Viewed Collection and Submitted Search tracking in the same toggle.

Manual Setup
UTM Parameters

Captured when UTM tracking is enabled and a recipient clicks through a campaign or flow. Values like utm_source, utm_medium, and utm_campaign are saved to the profile for attribution.

Auto
First Page

Stores the first URL a contact visited on your site — useful for intent analysis and targeting visitors who arrived from specific campaigns, sale pages, or paid channels.

Known vs Anonymous Visitors

  • Known visitors are identified when they click a Klaviyo email or SMS link (Klaviyo injects a _kx cookie), submit a Klaviyo form, or you call klaviyo.identify() with their email or phone
  • Anonymous visitors have activity stored locally until identified — Klaviyo then links all past events to the profile if anonymous tracking and cookie consent are both enabled

Step 2: Install klaviyo.js — 3 Verified Methods

The correct installation depends on your ecommerce platform. Choose the method that matches your setup — using the wrong approach is one of the most common reasons tracking silently fails.

Shopify Fastest

Install the Klaviyo app from the Shopify App Store. Enable the Klaviyo app embed in theme settings for Viewed Product tracking. Toggle on Track behavioural events for Added to Cart, Viewed Collection, and Submitted Search.

WooCommerce

Install the Klaviyo WooCommerce plugin and connect with your API key. This embeds klaviyo.js, maps product metadata, and enables default event tracking automatically.

BigCommerce

Use the Klaviyo for BigCommerce integration from the BigCommerce App Marketplace to auto-inject tracking code and sync store data without manual script editing.

Custom / Headless Site

Add the klaviyo.js snippet manually in the <head> of all pages. Replace the placeholder with your actual site ID from Klaviyo Settings → API Keys.

Manual klaviyo.js install — paste in <head> on all pages
<script async type="text/javascript" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=YOUR_PUBLIC_API_KEY"> </script>
Google Tag Manager (GTM) Create a Custom HTML tag in GTM, paste the tracking snippet inside, set the trigger to All Pages, and publish. This is the preferred approach for sites that manage all scripts via GTM — no developer deployment needed for future script changes.
Klaviyo Shopify integration onsite tracking settings showing app embed toggle, Track Viewed Product option, and Track behavioural events checkbox for Added to Cart and Viewed Collection
Shopify → Klaviyo integration — enable the app embed and toggle on behavioural events for full tracking coverage Klaviyo Onsite Tracking Setup →

Step 3: Set Up Identity Tracking with the Klaviyo Identify API

Klaviyo links on-site behaviour to real customer profiles through identity tracking. Without this step, even correctly installed tracking produces anonymous data that can’t power personalised flows or segments.

Three Ways Users Become Known to Klaviyo

  • Email/SMS clickthrough: Klaviyo injects a _kx tracking cookie that identifies the browser on future visits — zero extra setup needed
  • Form submission: Submitting a Klaviyo popup or embedded form automatically invokes identify() and links on-site activity to the subscriber profile
  • Custom identify() call: For logged-in users, gated content, or custom checkout flows — call klaviyo.identify() with at least an email address
JavaScript example calling klaviyo.identify() with special properties including name and email, plus a second call adding custom properties such as plan type, signup date, and profile completion boolean
Klaviyo’s identify() API — link anonymous visitors to real profiles with email and custom properties Klaviyo JavaScript API Reference →
identify() call with standard and custom properties
klaviyo.identify({ '$email': 'sarah@example.com', '$first_name': 'Sarah', '$last_name': 'Jones', 'Plan': 'Free Trial', 'SignUpDate': '2025-08-13', 'HasFilledOutProfile': true });

Key Data Fields Captured by identify()

$email
Required for profile identification. Without this, the identify call cannot link the visitor to a Klaviyo profile.
$first_name
Special property for personalisation — used in subject lines, greetings, and flow copy automatically.
$last_name
Displayed in the profile and available for segmentation and flow personalisation.
Custom properties
Strings, numbers, booleans, dates — e.g. Plan, SignUpDate, HasFilledOutProfile. All segmentable in Klaviyo’s segment builder.

Step 4: Build High-Intent Segments from Web Tracking Data

Klaviyo’s segment engine creates dynamic, self-updating audiences based on on-site behaviour. With web tracking in place, you can target users by specific actions — or deliberate inactions — to power high-converting automations and campaigns.

Klaviyo segment builder showing conditions for people who viewed a product or clicked an email with a product URL in the last 30 days alongside a mobile product reminder email example
Klaviyo’s segment builder — combine event conditions and date filters to create self-updating, high-intent audiences Klaviyo Segments Guide →
1
Viewed Product but Didn’t Purchase
Has done Viewed Product at least 1 time in the last 7 days AND Has not done Placed Order in the last 7 days
Use case: Trigger Browse Abandonment Flows to recover warm leads who showed clear purchase intent but didn’t convert.
2
UTM Source = Facebook / Meta Ads
Profile property utm_source equals “facebook”
Use case: Send post-click nurture sequences tailored to paid social visitors, or exclude from Facebook retargeting to avoid ad overexposure.
3
First Page Contains /sale
Profile property First Page URL contains “/sale”
Use case: Prioritise these high-discount-intent visitors for price drop alerts or flash sale announcements.

Segmentation Best Practices

  • Use rolling date filters like “in the last X days” to keep audiences fresh and relevant
  • Combine behavioural + profile filters (e.g. “Viewed Product” AND “Country = UK”) for localised campaigns
  • Add exclusions (e.g. “Has not Placed Order”) to focus segments on first-conversion and recovery
  • Test AND vs OR conditions — AND yields smaller, higher-intent audiences; OR yields broader reach

Step 5: Trigger Revenue-Driving Flows with Web Tracking Events

Web tracking events unlock flows that would be impossible without behavioural data. These are the highest-ROI automations you can build once tracking is correctly configured:

  • Browse Abandonment: Triggered by Viewed Product — send a personalised reminder 1–4 hours after a product view with no subsequent purchase
  • Abandoned Cart: Triggered by Added to Cart or Checkout Started — recover high-intent shoppers who got distracted before completing payment
  • Price Drop Alert: Triggered when a product price drops — notify users who viewed it but didn’t buy using Klaviyo’s native Price Drop flow
  • Back in Stock: Triggered by Subscribed to Back in Stock — notifies waitlisted shoppers the moment inventory returns
  • UTM-Based Nurture: Triggered by profile properties like utm_source = facebook — deliver targeted follow-up sequences based on acquisition channel

Step 6: Debug Klaviyo Web Tracking Issues Fast

If events aren’t appearing or profiles aren’t being identified correctly, these four debugging steps diagnose most issues in under 10 minutes.

🔍
Chrome DevTools → Network Tab
Filter for “klaviyo” requests. Confirm the tracking request fires when you load a page or trigger an event. Click to inspect the payload — look for $email or $id to confirm identification is working correctly.
💻
Check _learnq in the Console
Open DevTools → Console and run window._learnq. If you see the object, klaviyo.js is loaded and functioning. If _learnq is undefined, the script isn’t loading — check your installation method.
📧
Test with a Known Email Address
Append ?utm_email=your@email.com to any URL on your site, then visit it. Go to Klaviyo → Profiles → your email → Activity Feed to confirm Active on Site and other events are recorded against the correct profile.
🚫
Check for Ad Blockers and Browser Privacy
Safari ITP and most ad blockers can prevent klaviyo.js from loading. Always test tracking in Chrome first with ad blockers disabled. If tracking works in Chrome but not Safari, consider server-side event tracking for affected browsers.
Klaviyo Metrics Activity feed showing individual profile entries with timestamps for Active on Site and Viewed Product events confirming web tracking is firing correctly
Klaviyo Analytics → Metrics → Activity feed — verify events are arriving with correct profile links and timestamps Klaviyo Metrics Activity Feed →

Step 7: Stay GDPR & CCPA Compliant with Klaviyo Web Tracking

With GDPR, CCPA, and ePrivacy regulations tightening, Klaviyo tracking must only run after explicit user consent. Scripts like identify() and track() should never execute before the visitor agrees — in GDPR regions, this is a legal requirement, not a recommendation.

Klaviyo segment builder showing SMS Consent segment conditions including people consented to receive SMS and not suppressed for email demonstrating compliance-based suppression segments
Klaviyo suppression segments — automatically exclude opted-out users from tracking-dependent flows Klaviyo Consent & Compliance →
GDPR (EU/UK)
  • Do not fire identify() or load tracking cookies before consent is given
  • Use a CMP (OneTrust, Cookiebot) to block klaviyo.js until Accept is clicked
  • Enable Data Protection Fields in Klaviyo forms to store consent as profile properties
  • Allow opt-out via preferences centre or footer unsubscribe links
CCPA (California, US)
  • Provide a “Do Not Sell or Share My Information” link for California users
  • Use Klaviyo suppression segments to exclude opted-out users automatically
  • Store consent as consent_given = true to segment and exclude by status
  • Keep privacy policy up to date on what’s tracked and how data is used
Compliance Best Practice Record consent as a Klaviyo profile property like consent_given = true for every user who opts in. This lets you segment by consent status, exclude non-consenting users from tracking-dependent flows, and demonstrate compliance if audited.

Frequently Asked Questions About Klaviyo Web Tracking

Do I need coding skills to set up Klaviyo web tracking?+
No. Shopify, WooCommerce, and BigCommerce integrations handle most of the setup automatically. Custom sites may require basic HTML edits to add the klaviyo.js script, or a GTM configuration.
Why aren’t my Klaviyo web tracking events firing?+
Check if klaviyo.js is installed and loading in the DevTools Network tab. Ensure cookies are allowed. Confirm the visitor is identified via email click, form submission, or an identify() call — anonymous visitors without identification won’t show events in profiles.
Can Klaviyo track anonymous visitors?+
Yes. Anonymous activity is captured and stored locally until the visitor is identified. Klaviyo then links all past events to the profile — provided anonymous tracking is enabled, cookie consent is granted, and browser privacy settings allow it.
Do I need a separate cookie banner for Klaviyo in the EU?+
No separate banner needed, but your existing cookie banner must disclose Klaviyo tracking and only trigger scripts after consent — especially for identify() and track() calls in GDPR regions. Use a CMP to manage this automatically.
How do I verify Klaviyo web tracking is working correctly?+
Open Chrome DevTools → Network tab and filter for Klaviyo requests. Confirm the tracking request fires and the payload includes email or ID values. Then verify in Klaviyo → Profiles → your email → Activity Feed to confirm events are recorded.

Key Takeaways

  • Install correctly for your platform: Shopify, WooCommerce, BigCommerce, custom site, or GTM — the wrong method causes silent tracking failures.
  • Use identify() intentionally: Always include at least an email address and only fire after consent to properly link visitors to profiles.
  • Segment smarter with events: Build dynamic audiences from Viewed Product, UTM source, and First Page URL to power targeted, high-intent flows.
  • Trigger flows that convert: Browse abandonment, cart recovery, and price drop flows all depend on clean, consistent web tracking data.
  • Debug with DevTools: Use the Network tab and Activity Feed to confirm events are firing and profiles are being identified correctly.
  • Stay GDPR/CCPA compliant: Delay tracking scripts until users opt in and store consent as a profile property for segmentation and audit purposes.

Unsure if your Klaviyo web tracking is even working?

Missing events and poor data visibility cost you thousands in lost conversions. We’ll identify gaps, fix misfires, and unlock the segmentation and flow power your tracking data should be driving.

Book Your Free Tracking Audit →
Scroll to Top