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.comand 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$anonymousand$exchange_idkeys; 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 CartandStarted Checkoutevents for cart abandonment SMS flows - Monitors
Placed OrderandFulfilled Orderfor 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
_kxURL parameters andutm_source=klaviyoparameters 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.comAPI 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.
Consent Categories
Also Known As
Industries
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
Manage consent for Klaviyo SMS
ConsentStack automatically detects and manages Klaviyo SMS trackers so your site stays compliant with global privacy regulations.