Klaviyo SMS

Klaviyo SMS

Klaviyo SMS is the SMS marketing channel within the Klaviyo platform for e-commerce businesses. Scripts embed phone number capture forms and pop-ups on websites to collect SMS opt-ins. Cookies and identifiers associate website visitors with SMS subscriber profiles for attribution.

Overview

Klaviyo SMS is the text messaging marketing channel within the Klaviyo platform, built specifically for e-commerce businesses on Shopify, WooCommerce, BigCommerce, and similar platforms. It enables brands to collect mobile phone numbers through website pop-ups and inline forms, then send targeted promotional texts and automated transactional messages based on customer behavior and purchase history. Klaviyo SMS operates alongside Klaviyo Email as a unified customer engagement platform with shared subscriber profiles and behavioral data.

What This Script Does

Form Rendering and Phone Number Capture

  • Loads JavaScript from static.klaviyo.com and related Klaviyo CDN domains
  • Renders phone number capture interfaces: modal pop-ups, flyouts, embedded inline forms, and teaser bars
  • Captures the visitor's phone number and explicit SMS consent on form submission
  • Submits phone number, consent timestamp, and consent language to Klaviyo's subscriber API
  • Script file: https://static.klaviyo.com/onsite/js/klaviyo.js (same core script as Klaviyo Email)

Cookies Set

  • __kla_id — Klaviyo's primary cross-session visitor identifier; base64-encoded JSON containing $anonymous and $exchange_id keys; first-party, persistent (2 years); links all browsing activity to a Klaviyo subscriber profile
  • __kla_viewed_pages — tracks page view history within the session for triggering behavioral pop-ups
  • __kla_ss — session identifier for Klaviyo's real-time personalization layer

Behavioral Tracking for SMS Automation

  • Tracks page views (Viewed Product, Viewed Category) for browse abandonment SMS triggers
  • Fires Added to Cart and Started Checkout events for cart abandonment SMS flows
  • Monitors Placed Order and Fulfilled Order for post-purchase SMS sequences
  • All events are piped into Klaviyo's customer profile, building a behavioral history used to trigger automated SMS messages

Attribution Tracking

  • When recipients click links in SMS messages and land on the site, Klaviyo captures _kx URL parameters and utm_source=klaviyo parameters to attribute the visit to the originating campaign
  • Click-through attribution creates a conversion record linking the SMS send to downstream purchases

Data Transmitted

  • Visitor browsing events, cart activity, and purchase data sent to a.klaviyo.com API endpoints
  • Phone numbers, consent records, and behavioral profiles stored on Klaviyo's US servers (AWS)
  • Klaviyo participates in the EU-US Data Privacy Framework

Consent & Compliance

Consent category: Marketing

Klaviyo SMS is marketing technology. Under GDPR Article 6(1)(a) and Article 7, loading behavioral tracking scripts that build marketing profiles and enable targeted advertising requires explicit prior consent. The ePrivacy Directive requires consent for the __kla_id persistent cookie and the behavioral tracking scripts. Separately, SMS marketing in the EU requires explicit consent under ePrivacy Article 13 (direct electronic marketing) — this is a distinct consent from cookie consent. Under CCPA/CPRA, the behavioral data collected by Klaviyo (browsing history, cart activity, purchase patterns) linked to identifiable profiles constitutes "sharing" of personal information for targeted advertising, triggering "Do Not Sell or Share" opt-out obligations. Klaviyo must not load until valid marketing consent is obtained.

Should You Block This Without Consent?

Yes. Klaviyo SMS scripts track detailed browsing behavior, build persistent marketing profiles, and power targeted SMS advertising. Both the tracking cookies and the behavioral data collection require explicit marketing consent before the script loads.

Visit website

Consent Categories

Marketing

Also Known As

Klaviyo SMSKlaviyo text marketingKlaviyo SMS opt-inKlaviyo cookiesKlaviyo SMS tracking

Industries

Business and Consumer ServicesMarketing and Advertising

Frequently Asked Questions

Does Klaviyo SMS require visitor consent before loading?

Yes. Klaviyo SMS scripts track browsing behavior, set persistent identification cookies, and build marketing profiles used to trigger targeted SMS messages. The __kla_id cookie and behavioral tracking require explicit marketing consent under GDPR. SMS marketing also requires separate explicit opt-in under ePrivacy Article 13.

What cookies and events does Klaviyo SMS track?

Klaviyo SMS sets __kla_id (2-year cross-session visitor ID), __kla_viewed_pages (page view history for behavioral pop-ups), and __kla_ss (session identifier). It fires Viewed Product, Added to Cart, Started Checkout, Placed Order, and Fulfilled Order events to a.klaviyo.com to trigger automated SMS campaigns.

How does ConsentStack handle Klaviyo SMS on my site?

ConsentStack blocks Klaviyo SMS scripts until marketing consent is granted, preventing __kla_id from being set and stopping behavioral tracking before consent. ConsentStack treats Klaviyo Email and Klaviyo SMS as related vendors sharing a consent requirement, so one marketing consent decision gates both components.

Related Vendors

Google Ads
Google Ads
Google Ads is Google's advertising platform for search, display, and remarketing campaigns. Conversion tracking scripts fire on advertiser landing pages to measure actions taken after ad clicks. The remarketing tag builds audience lists for retargeting users across Google's ad network.
Google
Google
Google is the dominant provider of web analytics, advertising, and infrastructure tools. Scripts like Google Analytics, Tag Manager, Ads, and reCAPTCHA collect behavioral data, manage tag firing, serve targeted ads, and detect bots. Sets persistent cookies to track users and correlate activity across sites.
Microsoft Dynamics 365
Microsoft Dynamics 365
Microsoft Dynamics 365 is a suite of CRM and ERP applications that integrates with websites through tracking scripts and embedded forms. Web tracking code captures visitor behavior, page views, and form submissions to build customer profiles and score leads. Sets cookies to identify returning visitors and attribute marketing touchpoints across sessions.
Microsoft
Microsoft
Runs Clarity (session recording and heatmaps), the Microsoft Advertising UET tag (conversion tracking), and Bing's remarketing pixel. Clarity injects a recording script that captures mouse movements, clicks, and rage clicks. The UET tag fires conversion events to tie ad clicks to on-site actions across Microsoft's ad network.
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag is the Universal Event Tracking pixel for Microsoft's ad platform, formerly Bing Ads. The JavaScript tag fires on advertiser websites to track page views, conversions, and custom events for campaign optimization. Sets cookies to identify visitors across sessions and attribute conversions to Microsoft Search and Audience Network ad clicks.
LinkedIn Ads
LinkedIn Ads
LinkedIn Ads is LinkedIn's advertising platform for B2B marketing and professional audience targeting. Conversion tracking scripts and pixels fire on advertiser websites to measure sign-ups, downloads, and purchases driven by LinkedIn ad campaigns. Sets cookies for audience matching, retargeting list building, and cross-device attribution reporting.

Manage consent for Klaviyo SMS

ConsentStack automatically detects and manages Klaviyo SMS trackers so your site stays compliant with global privacy regulations.