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

Blog

August 13, 2025

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

Blog

August 13, 2025

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

Blog

August 13, 2025

Unlock Klaviyo web tracking to capture rich customer data, power real-time flows, and boost revenue—our 7-step guide shows you exactly how.

Unlock Klaviyo web tracking to capture rich customer data, power real-time flows, and boost revenue—our 7-step guide shows you exactly how. 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 can capture key behavioural data like product views, add-to-cart actions, checkout started, campaign source (UTM), and first-page visits. This data fuels your ability to trigger timely flows (like browse abandonment or price drop alerts), build precise audience segments, and optimise your entire customer journey.

In this guide, you’ll learn exactly how to make Klaviyo web tracking work harder for your business. We’ll walk you through:

  • Install Klaviyo.js correctly

  • Use built-in and custom web events

  • Set up Identify and Track APIs

  • Build segments from user behaviour

  • Trigger flows with event data

  • Debug tracking issues fast

  • Stay GDPR/CCPA compliant

Let’s get your Klaviyo tracking setup firing on all cylinders—so every click, view, and visit turns into revenue.

What Is Klaviyo Web Tracking?

Klaviyo’s web tracking captures on-site behaviour and ties it to customer profiles so you can segment, personalise, and trigger automations like browse abandonment. Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo.

Core Events and Properties

  • Active on Site – Fires when an identifiable person visits your site. Useful for real-time segments and time-sensitive flows. Klaviyo only tracks “active” for browsers that are cookie-based or otherwise identified.

  • Viewed Product – Enable by turning on the Klaviyo app embed in Shopify’s theme settings. This automatically tracks when identifiable visitors view product pages.

  • Checkout Started – Captured automatically when Shopify’s checkout process begins, if the Shopify integration is connected and "Track behavioural events" is enabled in Onsite tracking settings.

  • Added to Cart – For Shopify, enable Added to Cart tracking by turning on “Track behavioural events” in Klaviyo’s Shopify integration settings (Integrations → Shopify → Onsite tracking). This also captures events like Viewed Collection and Submitted Search.

  • UTM Parameters – Captured when UTM tracking is enabled on campaigns or flows and a recipient clicks through. Values like utm_source, utm_medium, and utm_campaign are saved to the profile for attribution.

  • First Page – The First Page profile property stores the first URL a contact visited after navigating to your site, useful for intent analysis and segmentation.

Known vs Anonymous Visitors

  • Known Users – A visitor becomes identifiable when they click a Klaviyo email or SMS, submit a Klaviyo form, or you call the JavaScript Identify method with their email or phone number. From then on, activity is tracked against their profile.

  • Anonymous Users – Anonymous activity is stored locally until the visitor is identified (e.g., via klaviyo.identify, form submission or checkout). Once identified, Klaviyo links past events to the profile—if anonymous tracking and cookie consent are enabled.

Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo—whether through an email click, sign-up form, or advanced setup using Klaviyo x Google Tag Manager.

3 Verified Ways to Install Klaviyo Web Tracking

Klaviyo’s web tracking uses the klaviyo.js script to collect behavioural data and tie it to specific customer profiles. The correct installation method depends on your e-commerce platform and setup.

Installation Options by Platform

1. Shopify, WooCommerce, BigCommerce (Native Integration)

The fastest and most reliable option is to use Klaviyo’s native integrations, which automatically embed klaviyo.js and configure product/event tracking.

  • Shopify – Installing the Klaviyo app from the Shopify App Store automatically adds tracking. For Viewed Product tracking, enable the Klaviyo app embed in your theme settings. For a full walkthrough on syncing data, see our Shopify x Klaviyo: The Ultimate Integration Guide.

  • WooCommerce – Install the Klaviyo WooCommerce plugin and connect it with your API key. This embeds klaviyo.js, maps product metadata, and enables default event tracking. Follow our Klaviyo WooCommerce Integration: 6 Steps to Boost LTV for detailed instructions.

  • BigCommerce – Use the Klaviyo for BigCommerce integration from the BigCommerce App Marketplace to auto-inject tracking code and sync store data.

2. Custom Site (Manual Install)

For headless sites or custom builds, add the klaviyo.js script manually:


Custom Site (Manual Install).png  Script tag loading Klaviyo’s onsite JavaScript library from a static URL with a public API key.

Paste this snippet into the <head> of all pages you want tracked. Replace YOUR_PUBLIC_API_KEY with your actual site ID (found in Klaviyo under Settings > API Keys).

3. Google Tag Manager (GTM)

If you manage scripts via GTM, you can add klaviyo.js using a Custom HTML Tag:

  • Create a Custom HTML tag, paste the tracking snippet inside.

  • Set the trigger to All Pages.

  • Publish the GTM container to deploy.

Sample Klaviyo tracking script for ecommerce events, embedded via GTM:


Sample Klaviyo tracking script.png  JavaScript functions to encode payloads, flatten ecommerce objects, normalize event names, and build a Klaviyo tracking payload with customer properties and event data.
Source: Klaviyo

How Klaviyo Knows Who’s Browsing (Identity Tracking Setup)

Klaviyo associates on-site behaviour with real customers through identity tracking, turning anonymous visitors into connected profiles and enabling powerful segmentation, automation, and attribution.

How Users Become “Known” to Klaviyo

  1. Email/SMS Clickthrough: When someone clicks a Klaviyo-sent email or SMS, Klaviyo injects a tracking cookie (_kx) to identify that browser on future visits.

  2. Klaviyo Sign-Up Forms: Submitting a Klaviyo form (e.g., popup or embed) automatically invokes identify() and drops a cookie, linking on-site activity to the subscriber’s profile. To optimise conversions, check out Klaviyo Sign-Up Forms: 8 Tactics to Grow Your List Without Hurting UX.

  3. Custom Identify API Call: For logins, gated content, or custom flows, call:


Custom Identify API.png  JavaScript example calling klaviyo.identify() to set special properties like name and email, and a second call adding custom properties such as plan type, signup date, and profile completion status.
Source: Klaviyo 

Key Data Fields Captured

  • email – Required for identifying profiles in Klaviyo.

  • first_name – Special property used for personalisation in campaigns and flows.

  • last_name – Special property displayed in the profile and usable for segmentation.

  • Custom properties – Examples from the script include:

    • Plan – Tracks subscription or account tier (e.g., "Free Trial").

    • SignUpDate – Stores the date a user registered or joined.

    • HasFilledOutProfile – Boolean property indicating whether a profile is complete.

  • Data types supported – Klaviyo accepts strings, numbers, booleans, and dates for custom properties.

Build Segments Based on Behavioural Events

Klaviyo’s segmentation engine can create dynamic, real-time audiences that update automatically based on on-site behaviour. With web tracking enabled, you can group users by specific actions (or inactions) to power high-intent automations and hyper-targeted campaigns.

Examples of High-Impact Behavioural Segments

1. Viewed Product but Didn’t Purchase

Logic:

  • Has done Viewed Product at least once in the last 7 days

  • AND Has not done Placed Order at any time in the last 7 days
    Use Case: Trigger Browse Abandonment Flows to recover warm leads.

2. UTM Source = Facebook

Logic:

  • Profile property utm_source equals facebook
    Use Case: Send post-click nurture sequences or exclude from Facebook retargeting to avoid overexposure.

3. First Page Path = /sale

Logic:

  • Profile property First Page URL contains /sale
    Use Case: Prioritise these 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.

  • Combine behavioural + profile filters (e.g., “Viewed Product” and “Country = UK”) for localised targeting.

  • Add exclusions (e.g., “Has not Placed Order”) to focus on recovery and conversion campaigns.

  • Test with AND vs OR conditions to see which yields better audience quality.


Build Segments Based on Behavioural Segmentation.png  A mobile view shows a product reminder for an oversized denim vest. On the right, a Klaviyo segment builder defines a segment for people who viewed a “Denim vest” product or clicked an email with a denim product URL in the last 30 days.
Source: Klaviyo

You can also explore Klaviyo RFM Segments: 6 Strategies to Boost Retention for deeper segment scoring and predictive modelling.

Troubleshoot Your Tracking Setup (Fast)

If your Klaviyo web tracking isn’t firing or data isn’t appearing in profiles, fixing it quickly is essential to keep email, SMS, and automation flows running smoothly. The steps below are aligned with Klaviyo’s official guidance.

Common Klaviyo Tracking Issues

1. Nothing is Tracking

  • klaviyo.js script missing or failing to load — common on custom-coded sites or GTM misconfigurations.

  • Privacy tools blocking scripts — ad blockers, tracking prevention in browsers (e.g., Safari ITP).

2. Profiles Not Showing Events

  • The visitor is not identified — missing identify() calls or no prior Klaviyo interaction.

  • Anonymous users won’t show product views until linked to a known profile via email click, form submit, or login.

3. UTM Data Missing

  • Campaign URLs lack parameters such as utm_source or utm_email.

  • Without them, Klaviyo cannot associate sessions with campaigns.

Quick Debugging Checklist

1. Verify Event Requests

  • In Chrome DevTools → Network to confirm the Klaviyo web tracking request fires and payload includes your identifiers,” and link to the GTM testing guide above.

  • If requests appear, Klaviyo is receiving event data. Click to inspect payload for $email or $id values.

  • If you’re sending data to GA4 alongside Klaviyo, follow our Klaviyo Google Analytics Integration (GA4) guide.

2. Check the _learnq Object

Open the Console tab and run:


Check the _learnq Object.png  Code snippet using _learnq.push with the 'identify' method to set a user’s email address.
  • If you see no errors, the identify script is functioning.

3. Test UTM Tracking

  • For a “known” test, append ?utm_email=your@email.

  • In Safari (ITP) or with ad-blockers, network calls may be restricted—test in Chrome first.

  • After running, go to Klaviyo → Profiles → your email → Activity Feed to confirm Active on Site and the Web Tracking Self-Test event.

Privacy, Consent & Compliance

With privacy regulations like GDPR, CCPA, and ePrivacy tightening worldwide, it’s critical to ensure Klaviyo’s tracking only runs after explicit user consent. Scripts such as identify() and track() should never execute before the visitor agrees to tracking.

This section outlines proven, Klaviyo-verified best practices so you can remain compliant without sacrificing marketing performance.

Consent Best Practices

  • Use GDPR-compliant signup forms: In Klaviyo, enable Data Protection Fields to automatically display consent language and store choices as profile properties like $consent.

  • Delay Klaviyo scripts until consent is granted: Use a Consent Management Platform (CMP) such as OneTrust or Cookiebot to block klaviyo.js until the visitor clicks “Accept” or “Allow tracking.” In Consentmo, for example, you can toggle Klaviyo tracking via the __kla_off setting. If you also send SMS, ensure you follow our Klaviyo SMS Compliance: 7 Steps to Stay Legal and Drive ROI (2025 Update) for consent best practices.

  • Record consent in the profile: Store a property like consent_given = true for each user who opts in. This allows you to:

    • Segment based on consent status

    • Exclude non-consenting users from tracking-dependent flows

  • Keep your privacy policy clear and accessible: Clearly explain what’s tracked, how data is used, and how users can opt out.

GDPR & CCPA Specific Notes

GDPR (EU/UK)

  • Do not fire identify() or load tracking cookies before consent is provided.

  • Allow subscribers to opt out via preferences or footer links.

  • For SMS, ensure explicit opt-in and support STOP/HELP keywords.

CCPA (California, US)

  • Provide a “Do Not Sell or Share My Information” link for California users.

  • Use Klaviyo’s suppression segments to automatically exclude opted-out users from marketing sends.


Klaviyo’s suppression segments.png  Klaviyo segment builder defining “SMS Consent” segment. Includes conditions for people consented to receive SMS and not suppressed for email.
Source: Klaviyo

FAQs

1. 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 or GTM setup.

2. Why aren’t my Klaviyo events firing?

  • Check if the klaviyo.js script is installed, ensure cookies are allowed, and confirm the visitor is “known” via email click, form submit, or identify() call.

3. Can Klaviyo track anonymous visitors?

  • Yes, activity is captured anonymously via backfill and stored in the browser until identification—then historical actions can be linked to the profile, provided anonymous tracking is enabled, cookie consent is granted, and browser/privacy settings allow it.

4. Will custom fonts or tracking slow my emails or site?

  • Minimal impact if implemented correctly. For tracking, Klaviyo’s script is lightweight, but ensure consent management tools don’t block it unintentionally.

5. Do I need separate cookie banners for Klaviyo in the EU?

  • No, but your cookie banner must disclose tracking and trigger Klaviyo only after consent, especially for identify() or track() calls in GDPR regions.

Conclusion

Getting Klaviyo web tracking right isn’t just about installing a script—it’s about turning every click, scroll, and view into insights you can use. With the right setup, you can send the right message at the perfect moment, keep your data clean, and stay compliant with privacy laws. 

Done well, it transforms passive browsing into active buying, boosts engagement, and gives you a clear edge over competitors still guessing about their customers. Every visit to your site is an opportunity—don’t let another one slip by. Set up your tracking today and start turning data into revenue.

If you’re ready to take tracking further, explore advanced personalisation with Klaviyo Dynamic Content: Unlock 3x Engagement and turn every captured click into revenue-driving action.

Key Takeaways

  • Install Correctly for Your Platform: Shopify, WooCommerce, or custom site—your tracking setup needs to match.

  • Use Identify & Track Intentionally: Ensure identify() and track() only fire after consent for accurate, compliant data.

  • Segment Smarter with Events: Build targeted segments based on viewed product, UTM source, or page path.

  • Trigger Flows That Convert: Use behavioural data like “Viewed Product” to automate relevant follow-ups.

  • Debug with DevTools: Use the collect.gif request to confirm events are firing and data is valid.

  • Stay GDPR/CCPA Compliant: Delay tracking scripts until users opt in—especially in the EU or California.

Unsure if your Klaviyo tracking is even working?

Missing events and poor visibility can cost you thousands in lost conversions. We’ll identify gaps, fix misfires, and unlock segmentation power. Click here to schedule your free expert audit—know exactly what’s being tracked (and what’s not).




Unlock Klaviyo web tracking to capture rich customer data, power real-time flows, and boost revenue—our 7-step guide shows you exactly how. 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 can capture key behavioural data like product views, add-to-cart actions, checkout started, campaign source (UTM), and first-page visits. This data fuels your ability to trigger timely flows (like browse abandonment or price drop alerts), build precise audience segments, and optimise your entire customer journey.

In this guide, you’ll learn exactly how to make Klaviyo web tracking work harder for your business. We’ll walk you through:

  • Install Klaviyo.js correctly

  • Use built-in and custom web events

  • Set up Identify and Track APIs

  • Build segments from user behaviour

  • Trigger flows with event data

  • Debug tracking issues fast

  • Stay GDPR/CCPA compliant

Let’s get your Klaviyo tracking setup firing on all cylinders—so every click, view, and visit turns into revenue.

What Is Klaviyo Web Tracking?

Klaviyo’s web tracking captures on-site behaviour and ties it to customer profiles so you can segment, personalise, and trigger automations like browse abandonment. Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo.

Core Events and Properties

  • Active on Site – Fires when an identifiable person visits your site. Useful for real-time segments and time-sensitive flows. Klaviyo only tracks “active” for browsers that are cookie-based or otherwise identified.

  • Viewed Product – Enable by turning on the Klaviyo app embed in Shopify’s theme settings. This automatically tracks when identifiable visitors view product pages.

  • Checkout Started – Captured automatically when Shopify’s checkout process begins, if the Shopify integration is connected and "Track behavioural events" is enabled in Onsite tracking settings.

  • Added to Cart – For Shopify, enable Added to Cart tracking by turning on “Track behavioural events” in Klaviyo’s Shopify integration settings (Integrations → Shopify → Onsite tracking). This also captures events like Viewed Collection and Submitted Search.

  • UTM Parameters – Captured when UTM tracking is enabled on campaigns or flows and a recipient clicks through. Values like utm_source, utm_medium, and utm_campaign are saved to the profile for attribution.

  • First Page – The First Page profile property stores the first URL a contact visited after navigating to your site, useful for intent analysis and segmentation.

Known vs Anonymous Visitors

  • Known Users – A visitor becomes identifiable when they click a Klaviyo email or SMS, submit a Klaviyo form, or you call the JavaScript Identify method with their email or phone number. From then on, activity is tracked against their profile.

  • Anonymous Users – Anonymous activity is stored locally until the visitor is identified (e.g., via klaviyo.identify, form submission or checkout). Once identified, Klaviyo links past events to the profile—if anonymous tracking and cookie consent are enabled.

Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo—whether through an email click, sign-up form, or advanced setup using Klaviyo x Google Tag Manager.

3 Verified Ways to Install Klaviyo Web Tracking

Klaviyo’s web tracking uses the klaviyo.js script to collect behavioural data and tie it to specific customer profiles. The correct installation method depends on your e-commerce platform and setup.

Installation Options by Platform

1. Shopify, WooCommerce, BigCommerce (Native Integration)

The fastest and most reliable option is to use Klaviyo’s native integrations, which automatically embed klaviyo.js and configure product/event tracking.

  • Shopify – Installing the Klaviyo app from the Shopify App Store automatically adds tracking. For Viewed Product tracking, enable the Klaviyo app embed in your theme settings. For a full walkthrough on syncing data, see our Shopify x Klaviyo: The Ultimate Integration Guide.

  • WooCommerce – Install the Klaviyo WooCommerce plugin and connect it with your API key. This embeds klaviyo.js, maps product metadata, and enables default event tracking. Follow our Klaviyo WooCommerce Integration: 6 Steps to Boost LTV for detailed instructions.

  • BigCommerce – Use the Klaviyo for BigCommerce integration from the BigCommerce App Marketplace to auto-inject tracking code and sync store data.

2. Custom Site (Manual Install)

For headless sites or custom builds, add the klaviyo.js script manually:


Custom Site (Manual Install).png  Script tag loading Klaviyo’s onsite JavaScript library from a static URL with a public API key.

Paste this snippet into the <head> of all pages you want tracked. Replace YOUR_PUBLIC_API_KEY with your actual site ID (found in Klaviyo under Settings > API Keys).

3. Google Tag Manager (GTM)

If you manage scripts via GTM, you can add klaviyo.js using a Custom HTML Tag:

  • Create a Custom HTML tag, paste the tracking snippet inside.

  • Set the trigger to All Pages.

  • Publish the GTM container to deploy.

Sample Klaviyo tracking script for ecommerce events, embedded via GTM:


Sample Klaviyo tracking script.png  JavaScript functions to encode payloads, flatten ecommerce objects, normalize event names, and build a Klaviyo tracking payload with customer properties and event data.
Source: Klaviyo

How Klaviyo Knows Who’s Browsing (Identity Tracking Setup)

Klaviyo associates on-site behaviour with real customers through identity tracking, turning anonymous visitors into connected profiles and enabling powerful segmentation, automation, and attribution.

How Users Become “Known” to Klaviyo

  1. Email/SMS Clickthrough: When someone clicks a Klaviyo-sent email or SMS, Klaviyo injects a tracking cookie (_kx) to identify that browser on future visits.

  2. Klaviyo Sign-Up Forms: Submitting a Klaviyo form (e.g., popup or embed) automatically invokes identify() and drops a cookie, linking on-site activity to the subscriber’s profile. To optimise conversions, check out Klaviyo Sign-Up Forms: 8 Tactics to Grow Your List Without Hurting UX.

  3. Custom Identify API Call: For logins, gated content, or custom flows, call:


Custom Identify API.png  JavaScript example calling klaviyo.identify() to set special properties like name and email, and a second call adding custom properties such as plan type, signup date, and profile completion status.
Source: Klaviyo 

Key Data Fields Captured

  • email – Required for identifying profiles in Klaviyo.

  • first_name – Special property used for personalisation in campaigns and flows.

  • last_name – Special property displayed in the profile and usable for segmentation.

  • Custom properties – Examples from the script include:

    • Plan – Tracks subscription or account tier (e.g., "Free Trial").

    • SignUpDate – Stores the date a user registered or joined.

    • HasFilledOutProfile – Boolean property indicating whether a profile is complete.

  • Data types supported – Klaviyo accepts strings, numbers, booleans, and dates for custom properties.

Build Segments Based on Behavioural Events

Klaviyo’s segmentation engine can create dynamic, real-time audiences that update automatically based on on-site behaviour. With web tracking enabled, you can group users by specific actions (or inactions) to power high-intent automations and hyper-targeted campaigns.

Examples of High-Impact Behavioural Segments

1. Viewed Product but Didn’t Purchase

Logic:

  • Has done Viewed Product at least once in the last 7 days

  • AND Has not done Placed Order at any time in the last 7 days
    Use Case: Trigger Browse Abandonment Flows to recover warm leads.

2. UTM Source = Facebook

Logic:

  • Profile property utm_source equals facebook
    Use Case: Send post-click nurture sequences or exclude from Facebook retargeting to avoid overexposure.

3. First Page Path = /sale

Logic:

  • Profile property First Page URL contains /sale
    Use Case: Prioritise these 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.

  • Combine behavioural + profile filters (e.g., “Viewed Product” and “Country = UK”) for localised targeting.

  • Add exclusions (e.g., “Has not Placed Order”) to focus on recovery and conversion campaigns.

  • Test with AND vs OR conditions to see which yields better audience quality.


Build Segments Based on Behavioural Segmentation.png  A mobile view shows a product reminder for an oversized denim vest. On the right, a Klaviyo segment builder defines a segment for people who viewed a “Denim vest” product or clicked an email with a denim product URL in the last 30 days.
Source: Klaviyo

You can also explore Klaviyo RFM Segments: 6 Strategies to Boost Retention for deeper segment scoring and predictive modelling.

Troubleshoot Your Tracking Setup (Fast)

If your Klaviyo web tracking isn’t firing or data isn’t appearing in profiles, fixing it quickly is essential to keep email, SMS, and automation flows running smoothly. The steps below are aligned with Klaviyo’s official guidance.

Common Klaviyo Tracking Issues

1. Nothing is Tracking

  • klaviyo.js script missing or failing to load — common on custom-coded sites or GTM misconfigurations.

  • Privacy tools blocking scripts — ad blockers, tracking prevention in browsers (e.g., Safari ITP).

2. Profiles Not Showing Events

  • The visitor is not identified — missing identify() calls or no prior Klaviyo interaction.

  • Anonymous users won’t show product views until linked to a known profile via email click, form submit, or login.

3. UTM Data Missing

  • Campaign URLs lack parameters such as utm_source or utm_email.

  • Without them, Klaviyo cannot associate sessions with campaigns.

Quick Debugging Checklist

1. Verify Event Requests

  • In Chrome DevTools → Network to confirm the Klaviyo web tracking request fires and payload includes your identifiers,” and link to the GTM testing guide above.

  • If requests appear, Klaviyo is receiving event data. Click to inspect payload for $email or $id values.

  • If you’re sending data to GA4 alongside Klaviyo, follow our Klaviyo Google Analytics Integration (GA4) guide.

2. Check the _learnq Object

Open the Console tab and run:


Check the _learnq Object.png  Code snippet using _learnq.push with the 'identify' method to set a user’s email address.
  • If you see no errors, the identify script is functioning.

3. Test UTM Tracking

  • For a “known” test, append ?utm_email=your@email.

  • In Safari (ITP) or with ad-blockers, network calls may be restricted—test in Chrome first.

  • After running, go to Klaviyo → Profiles → your email → Activity Feed to confirm Active on Site and the Web Tracking Self-Test event.

Privacy, Consent & Compliance

With privacy regulations like GDPR, CCPA, and ePrivacy tightening worldwide, it’s critical to ensure Klaviyo’s tracking only runs after explicit user consent. Scripts such as identify() and track() should never execute before the visitor agrees to tracking.

This section outlines proven, Klaviyo-verified best practices so you can remain compliant without sacrificing marketing performance.

Consent Best Practices

  • Use GDPR-compliant signup forms: In Klaviyo, enable Data Protection Fields to automatically display consent language and store choices as profile properties like $consent.

  • Delay Klaviyo scripts until consent is granted: Use a Consent Management Platform (CMP) such as OneTrust or Cookiebot to block klaviyo.js until the visitor clicks “Accept” or “Allow tracking.” In Consentmo, for example, you can toggle Klaviyo tracking via the __kla_off setting. If you also send SMS, ensure you follow our Klaviyo SMS Compliance: 7 Steps to Stay Legal and Drive ROI (2025 Update) for consent best practices.

  • Record consent in the profile: Store a property like consent_given = true for each user who opts in. This allows you to:

    • Segment based on consent status

    • Exclude non-consenting users from tracking-dependent flows

  • Keep your privacy policy clear and accessible: Clearly explain what’s tracked, how data is used, and how users can opt out.

GDPR & CCPA Specific Notes

GDPR (EU/UK)

  • Do not fire identify() or load tracking cookies before consent is provided.

  • Allow subscribers to opt out via preferences or footer links.

  • For SMS, ensure explicit opt-in and support STOP/HELP keywords.

CCPA (California, US)

  • Provide a “Do Not Sell or Share My Information” link for California users.

  • Use Klaviyo’s suppression segments to automatically exclude opted-out users from marketing sends.


Klaviyo’s suppression segments.png  Klaviyo segment builder defining “SMS Consent” segment. Includes conditions for people consented to receive SMS and not suppressed for email.
Source: Klaviyo

FAQs

1. 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 or GTM setup.

2. Why aren’t my Klaviyo events firing?

  • Check if the klaviyo.js script is installed, ensure cookies are allowed, and confirm the visitor is “known” via email click, form submit, or identify() call.

3. Can Klaviyo track anonymous visitors?

  • Yes, activity is captured anonymously via backfill and stored in the browser until identification—then historical actions can be linked to the profile, provided anonymous tracking is enabled, cookie consent is granted, and browser/privacy settings allow it.

4. Will custom fonts or tracking slow my emails or site?

  • Minimal impact if implemented correctly. For tracking, Klaviyo’s script is lightweight, but ensure consent management tools don’t block it unintentionally.

5. Do I need separate cookie banners for Klaviyo in the EU?

  • No, but your cookie banner must disclose tracking and trigger Klaviyo only after consent, especially for identify() or track() calls in GDPR regions.

Conclusion

Getting Klaviyo web tracking right isn’t just about installing a script—it’s about turning every click, scroll, and view into insights you can use. With the right setup, you can send the right message at the perfect moment, keep your data clean, and stay compliant with privacy laws. 

Done well, it transforms passive browsing into active buying, boosts engagement, and gives you a clear edge over competitors still guessing about their customers. Every visit to your site is an opportunity—don’t let another one slip by. Set up your tracking today and start turning data into revenue.

If you’re ready to take tracking further, explore advanced personalisation with Klaviyo Dynamic Content: Unlock 3x Engagement and turn every captured click into revenue-driving action.

Key Takeaways

  • Install Correctly for Your Platform: Shopify, WooCommerce, or custom site—your tracking setup needs to match.

  • Use Identify & Track Intentionally: Ensure identify() and track() only fire after consent for accurate, compliant data.

  • Segment Smarter with Events: Build targeted segments based on viewed product, UTM source, or page path.

  • Trigger Flows That Convert: Use behavioural data like “Viewed Product” to automate relevant follow-ups.

  • Debug with DevTools: Use the collect.gif request to confirm events are firing and data is valid.

  • Stay GDPR/CCPA Compliant: Delay tracking scripts until users opt in—especially in the EU or California.

Unsure if your Klaviyo tracking is even working?

Missing events and poor visibility can cost you thousands in lost conversions. We’ll identify gaps, fix misfires, and unlock segmentation power. Click here to schedule your free expert audit—know exactly what’s being tracked (and what’s not).




Unlock Klaviyo web tracking to capture rich customer data, power real-time flows, and boost revenue—our 7-step guide shows you exactly how.

Unlock Klaviyo web tracking to capture rich customer data, power real-time flows, and boost revenue—our 7-step guide shows you exactly how. 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 can capture key behavioural data like product views, add-to-cart actions, checkout started, campaign source (UTM), and first-page visits. This data fuels your ability to trigger timely flows (like browse abandonment or price drop alerts), build precise audience segments, and optimise your entire customer journey.

In this guide, you’ll learn exactly how to make Klaviyo web tracking work harder for your business. We’ll walk you through:

  • Install Klaviyo.js correctly

  • Use built-in and custom web events

  • Set up Identify and Track APIs

  • Build segments from user behaviour

  • Trigger flows with event data

  • Debug tracking issues fast

  • Stay GDPR/CCPA compliant

Let’s get your Klaviyo tracking setup firing on all cylinders—so every click, view, and visit turns into revenue.

What Is Klaviyo Web Tracking?

Klaviyo’s web tracking captures on-site behaviour and ties it to customer profiles so you can segment, personalise, and trigger automations like browse abandonment. Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo.

Core Events and Properties

  • Active on Site – Fires when an identifiable person visits your site. Useful for real-time segments and time-sensitive flows. Klaviyo only tracks “active” for browsers that are cookie-based or otherwise identified.

  • Viewed Product – Enable by turning on the Klaviyo app embed in Shopify’s theme settings. This automatically tracks when identifiable visitors view product pages.

  • Checkout Started – Captured automatically when Shopify’s checkout process begins, if the Shopify integration is connected and "Track behavioural events" is enabled in Onsite tracking settings.

  • Added to Cart – For Shopify, enable Added to Cart tracking by turning on “Track behavioural events” in Klaviyo’s Shopify integration settings (Integrations → Shopify → Onsite tracking). This also captures events like Viewed Collection and Submitted Search.

  • UTM Parameters – Captured when UTM tracking is enabled on campaigns or flows and a recipient clicks through. Values like utm_source, utm_medium, and utm_campaign are saved to the profile for attribution.

  • First Page – The First Page profile property stores the first URL a contact visited after navigating to your site, useful for intent analysis and segmentation.

Known vs Anonymous Visitors

  • Known Users – A visitor becomes identifiable when they click a Klaviyo email or SMS, submit a Klaviyo form, or you call the JavaScript Identify method with their email or phone number. From then on, activity is tracked against their profile.

  • Anonymous Users – Anonymous activity is stored locally until the visitor is identified (e.g., via klaviyo.identify, form submission or checkout). Once identified, Klaviyo links past events to the profile—if anonymous tracking and cookie consent are enabled.

Tracking is powered by the klaviyo.js script and records activity when a visitor is identifiable to Klaviyo—whether through an email click, sign-up form, or advanced setup using Klaviyo x Google Tag Manager.

3 Verified Ways to Install Klaviyo Web Tracking

Klaviyo’s web tracking uses the klaviyo.js script to collect behavioural data and tie it to specific customer profiles. The correct installation method depends on your e-commerce platform and setup.

Installation Options by Platform

1. Shopify, WooCommerce, BigCommerce (Native Integration)

The fastest and most reliable option is to use Klaviyo’s native integrations, which automatically embed klaviyo.js and configure product/event tracking.

  • Shopify – Installing the Klaviyo app from the Shopify App Store automatically adds tracking. For Viewed Product tracking, enable the Klaviyo app embed in your theme settings. For a full walkthrough on syncing data, see our Shopify x Klaviyo: The Ultimate Integration Guide.

  • WooCommerce – Install the Klaviyo WooCommerce plugin and connect it with your API key. This embeds klaviyo.js, maps product metadata, and enables default event tracking. Follow our Klaviyo WooCommerce Integration: 6 Steps to Boost LTV for detailed instructions.

  • BigCommerce – Use the Klaviyo for BigCommerce integration from the BigCommerce App Marketplace to auto-inject tracking code and sync store data.

2. Custom Site (Manual Install)

For headless sites or custom builds, add the klaviyo.js script manually:


Custom Site (Manual Install).png  Script tag loading Klaviyo’s onsite JavaScript library from a static URL with a public API key.

Paste this snippet into the <head> of all pages you want tracked. Replace YOUR_PUBLIC_API_KEY with your actual site ID (found in Klaviyo under Settings > API Keys).

3. Google Tag Manager (GTM)

If you manage scripts via GTM, you can add klaviyo.js using a Custom HTML Tag:

  • Create a Custom HTML tag, paste the tracking snippet inside.

  • Set the trigger to All Pages.

  • Publish the GTM container to deploy.

Sample Klaviyo tracking script for ecommerce events, embedded via GTM:


Sample Klaviyo tracking script.png  JavaScript functions to encode payloads, flatten ecommerce objects, normalize event names, and build a Klaviyo tracking payload with customer properties and event data.
Source: Klaviyo

How Klaviyo Knows Who’s Browsing (Identity Tracking Setup)

Klaviyo associates on-site behaviour with real customers through identity tracking, turning anonymous visitors into connected profiles and enabling powerful segmentation, automation, and attribution.

How Users Become “Known” to Klaviyo

  1. Email/SMS Clickthrough: When someone clicks a Klaviyo-sent email or SMS, Klaviyo injects a tracking cookie (_kx) to identify that browser on future visits.

  2. Klaviyo Sign-Up Forms: Submitting a Klaviyo form (e.g., popup or embed) automatically invokes identify() and drops a cookie, linking on-site activity to the subscriber’s profile. To optimise conversions, check out Klaviyo Sign-Up Forms: 8 Tactics to Grow Your List Without Hurting UX.

  3. Custom Identify API Call: For logins, gated content, or custom flows, call:


Custom Identify API.png  JavaScript example calling klaviyo.identify() to set special properties like name and email, and a second call adding custom properties such as plan type, signup date, and profile completion status.
Source: Klaviyo 

Key Data Fields Captured

  • email – Required for identifying profiles in Klaviyo.

  • first_name – Special property used for personalisation in campaigns and flows.

  • last_name – Special property displayed in the profile and usable for segmentation.

  • Custom properties – Examples from the script include:

    • Plan – Tracks subscription or account tier (e.g., "Free Trial").

    • SignUpDate – Stores the date a user registered or joined.

    • HasFilledOutProfile – Boolean property indicating whether a profile is complete.

  • Data types supported – Klaviyo accepts strings, numbers, booleans, and dates for custom properties.

Build Segments Based on Behavioural Events

Klaviyo’s segmentation engine can create dynamic, real-time audiences that update automatically based on on-site behaviour. With web tracking enabled, you can group users by specific actions (or inactions) to power high-intent automations and hyper-targeted campaigns.

Examples of High-Impact Behavioural Segments

1. Viewed Product but Didn’t Purchase

Logic:

  • Has done Viewed Product at least once in the last 7 days

  • AND Has not done Placed Order at any time in the last 7 days
    Use Case: Trigger Browse Abandonment Flows to recover warm leads.

2. UTM Source = Facebook

Logic:

  • Profile property utm_source equals facebook
    Use Case: Send post-click nurture sequences or exclude from Facebook retargeting to avoid overexposure.

3. First Page Path = /sale

Logic:

  • Profile property First Page URL contains /sale
    Use Case: Prioritise these 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.

  • Combine behavioural + profile filters (e.g., “Viewed Product” and “Country = UK”) for localised targeting.

  • Add exclusions (e.g., “Has not Placed Order”) to focus on recovery and conversion campaigns.

  • Test with AND vs OR conditions to see which yields better audience quality.


Build Segments Based on Behavioural Segmentation.png  A mobile view shows a product reminder for an oversized denim vest. On the right, a Klaviyo segment builder defines a segment for people who viewed a “Denim vest” product or clicked an email with a denim product URL in the last 30 days.
Source: Klaviyo

You can also explore Klaviyo RFM Segments: 6 Strategies to Boost Retention for deeper segment scoring and predictive modelling.

Troubleshoot Your Tracking Setup (Fast)

If your Klaviyo web tracking isn’t firing or data isn’t appearing in profiles, fixing it quickly is essential to keep email, SMS, and automation flows running smoothly. The steps below are aligned with Klaviyo’s official guidance.

Common Klaviyo Tracking Issues

1. Nothing is Tracking

  • klaviyo.js script missing or failing to load — common on custom-coded sites or GTM misconfigurations.

  • Privacy tools blocking scripts — ad blockers, tracking prevention in browsers (e.g., Safari ITP).

2. Profiles Not Showing Events

  • The visitor is not identified — missing identify() calls or no prior Klaviyo interaction.

  • Anonymous users won’t show product views until linked to a known profile via email click, form submit, or login.

3. UTM Data Missing

  • Campaign URLs lack parameters such as utm_source or utm_email.

  • Without them, Klaviyo cannot associate sessions with campaigns.

Quick Debugging Checklist

1. Verify Event Requests

  • In Chrome DevTools → Network to confirm the Klaviyo web tracking request fires and payload includes your identifiers,” and link to the GTM testing guide above.

  • If requests appear, Klaviyo is receiving event data. Click to inspect payload for $email or $id values.

  • If you’re sending data to GA4 alongside Klaviyo, follow our Klaviyo Google Analytics Integration (GA4) guide.

2. Check the _learnq Object

Open the Console tab and run:


Check the _learnq Object.png  Code snippet using _learnq.push with the 'identify' method to set a user’s email address.
  • If you see no errors, the identify script is functioning.

3. Test UTM Tracking

  • For a “known” test, append ?utm_email=your@email.

  • In Safari (ITP) or with ad-blockers, network calls may be restricted—test in Chrome first.

  • After running, go to Klaviyo → Profiles → your email → Activity Feed to confirm Active on Site and the Web Tracking Self-Test event.

Privacy, Consent & Compliance

With privacy regulations like GDPR, CCPA, and ePrivacy tightening worldwide, it’s critical to ensure Klaviyo’s tracking only runs after explicit user consent. Scripts such as identify() and track() should never execute before the visitor agrees to tracking.

This section outlines proven, Klaviyo-verified best practices so you can remain compliant without sacrificing marketing performance.

Consent Best Practices

  • Use GDPR-compliant signup forms: In Klaviyo, enable Data Protection Fields to automatically display consent language and store choices as profile properties like $consent.

  • Delay Klaviyo scripts until consent is granted: Use a Consent Management Platform (CMP) such as OneTrust or Cookiebot to block klaviyo.js until the visitor clicks “Accept” or “Allow tracking.” In Consentmo, for example, you can toggle Klaviyo tracking via the __kla_off setting. If you also send SMS, ensure you follow our Klaviyo SMS Compliance: 7 Steps to Stay Legal and Drive ROI (2025 Update) for consent best practices.

  • Record consent in the profile: Store a property like consent_given = true for each user who opts in. This allows you to:

    • Segment based on consent status

    • Exclude non-consenting users from tracking-dependent flows

  • Keep your privacy policy clear and accessible: Clearly explain what’s tracked, how data is used, and how users can opt out.

GDPR & CCPA Specific Notes

GDPR (EU/UK)

  • Do not fire identify() or load tracking cookies before consent is provided.

  • Allow subscribers to opt out via preferences or footer links.

  • For SMS, ensure explicit opt-in and support STOP/HELP keywords.

CCPA (California, US)

  • Provide a “Do Not Sell or Share My Information” link for California users.

  • Use Klaviyo’s suppression segments to automatically exclude opted-out users from marketing sends.


Klaviyo’s suppression segments.png  Klaviyo segment builder defining “SMS Consent” segment. Includes conditions for people consented to receive SMS and not suppressed for email.
Source: Klaviyo

FAQs

1. 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 or GTM setup.

2. Why aren’t my Klaviyo events firing?

  • Check if the klaviyo.js script is installed, ensure cookies are allowed, and confirm the visitor is “known” via email click, form submit, or identify() call.

3. Can Klaviyo track anonymous visitors?

  • Yes, activity is captured anonymously via backfill and stored in the browser until identification—then historical actions can be linked to the profile, provided anonymous tracking is enabled, cookie consent is granted, and browser/privacy settings allow it.

4. Will custom fonts or tracking slow my emails or site?

  • Minimal impact if implemented correctly. For tracking, Klaviyo’s script is lightweight, but ensure consent management tools don’t block it unintentionally.

5. Do I need separate cookie banners for Klaviyo in the EU?

  • No, but your cookie banner must disclose tracking and trigger Klaviyo only after consent, especially for identify() or track() calls in GDPR regions.

Conclusion

Getting Klaviyo web tracking right isn’t just about installing a script—it’s about turning every click, scroll, and view into insights you can use. With the right setup, you can send the right message at the perfect moment, keep your data clean, and stay compliant with privacy laws. 

Done well, it transforms passive browsing into active buying, boosts engagement, and gives you a clear edge over competitors still guessing about their customers. Every visit to your site is an opportunity—don’t let another one slip by. Set up your tracking today and start turning data into revenue.

If you’re ready to take tracking further, explore advanced personalisation with Klaviyo Dynamic Content: Unlock 3x Engagement and turn every captured click into revenue-driving action.

Key Takeaways

  • Install Correctly for Your Platform: Shopify, WooCommerce, or custom site—your tracking setup needs to match.

  • Use Identify & Track Intentionally: Ensure identify() and track() only fire after consent for accurate, compliant data.

  • Segment Smarter with Events: Build targeted segments based on viewed product, UTM source, or page path.

  • Trigger Flows That Convert: Use behavioural data like “Viewed Product” to automate relevant follow-ups.

  • Debug with DevTools: Use the collect.gif request to confirm events are firing and data is valid.

  • Stay GDPR/CCPA Compliant: Delay tracking scripts until users opt in—especially in the EU or California.

Unsure if your Klaviyo tracking is even working?

Missing events and poor visibility can cost you thousands in lost conversions. We’ll identify gaps, fix misfires, and unlock segmentation power. Click here to schedule your free expert audit—know exactly what’s being tracked (and what’s not).




Join our newsletter list

Sign up to get the most recent blog articles in your email every week.

Share this post to the social medias