Insights security
Shopify Saved Cart Security: Privacy Risks in Persistent Cart Tokens
Shopify saved cart security is the practice of protecting customer browsing and purchase intent data stored by cart persistence apps through proper token management, session expiry controls, and privacy-compliant data handling.
Key takeaways
- Saved-cart apps create persistent tokens that can remain valid for months or years, creating long-lived privacy exposure windows if not properly managed.
- Cart tokens often contain product IDs, variant selections, and timestamps that reveal detailed customer browsing patterns even before account creation.
- GDPR and CCPA require explicit consent for tracking cart data beyond the immediate session, but many apps embed tracking by default in their installation.
- Merchants are data controllers for cart information collected by third-party apps, making them legally responsible for privacy violations even when the app vendor handles storage.
- Auditing saved-cart app permissions reveals whether apps can access customer contact information, order history, or other sensitive data beyond cart contents.
How saved-cart apps create persistent tokens
When a customer adds items to their cart, Shopify creates a session-based cart ID. This ID expires when the browser session ends. Saved-cart apps extend this behavior by generating their own persistent identifiers.
These apps typically inject JavaScript that captures cart state on every add-to-cart event. The script writes a token to localStorage or sets a long-lived cookie. This token maps to a database record the app maintains, storing product IDs, quantities, variant selections, and timestamps.
The token remains valid until explicitly deleted or until the app’s retention policy expires it. Across the 80+ Shopify stores we have audited at Defyn, we observe token lifespans ranging from 90 days to indefinite persistence. Some apps never expire tokens unless the customer clears browser data.
This creates a tracking window far longer than Shopify’s native session management. A customer who browses your store in January can return in June and see the same cart, but that also means the app has maintained a browsing profile for six months.
Privacy implications of cart tracking
Cart data reveals purchase intent. It shows which products a customer considered, in what combinations, and at what price points. This information is commercially valuable but also personally identifiable when combined with other data points.
Many saved-cart apps correlate the persistent token with email addresses captured through newsletter signups, checkout abandonment forms, or account creation. Once linked, the app can build a profile connecting anonymous browsing to a named individual.
This crosses into personal data territory under GDPR. The regulation requires explicit consent for tracking that goes beyond strictly necessary session management. A customer adding items to a cart has not consented to months-long behavioral tracking.
The CCPA takes a similar stance. California consumers have the right to know what personal information is collected and to request deletion. Cart tokens that persist indefinitely without clear disclosure violate these transparency requirements.
Merchants often assume the app vendor handles compliance, but data protection law assigns responsibility to the data controller (the merchant). The app is a data processor acting on your instructions. If the app violates privacy law, your store faces the regulatory consequences. Our article on Shopify customer data GDPR compliance covers this controller-processor relationship in detail.
What cart apps can access beyond cart contents
Saved-cart apps request Shopify API scopes during installation. These scopes determine what data the app can read and write. The minimum scope needed for cart functionality is read_products to display accurate product information when restoring a saved cart.
Many apps request far broader permissions. Common scope requests include:
read_customers: Access to customer names, email addresses, phone numbers, and account creation datesread_orders: Full order history including purchase amounts, shipping addresses, and payment methodswrite_script_tags: Ability to inject JavaScript on every page load, enabling comprehensive browsing trackingread_analytics: Access to traffic sources, conversion rates, and revenue data
These scopes persist until you revoke them. An app installed two years ago still has the same access level today unless you have manually changed permissions.
The risk compounds when apps share data with third-party services. Cart recovery apps often integrate with email platforms, SMS providers, or advertising networks. Each integration creates another copy of customer data in another vendor’s system.
You can audit current app permissions through Shopify’s admin panel, but the interface does not show historical access or data exports. For a complete permission review, see our guide on how to audit Shopify app permissions.
Technical security risks in cart token implementation
Persistent tokens introduce attack vectors beyond privacy concerns. If a token is not properly secured, it can be stolen and used to access another customer’s cart data.
Most saved-cart apps store tokens in localStorage, which is accessible to any JavaScript running on your domain. If your store has an XSS vulnerability (common in custom theme code or poorly vetted apps), an attacker can extract these tokens.
Tokens transmitted over HTTP instead of HTTPS can be intercepted through man-in-the-middle attacks. While Shopify enforces HTTPS for checkout, some apps make API calls to their own servers over insecure connections.
Weak token generation creates predictability. We have observed apps using sequential integers or timestamp-based IDs as cart tokens. An attacker can enumerate these values to access other customers’ saved carts.
Proper implementation uses cryptographically random tokens (minimum 128 bits of entropy), HTTPS-only transmission, and server-side validation on every request. The token should be treated as a bearer credential with the same security rigor as a session cookie.
Retention policies and data deletion
How long should a saved cart persist? From a conversion perspective, longer is better. Customers who return after months can pick up where they left off. From a privacy perspective, indefinite retention is indefensible.
GDPR Article 5 requires that personal data be kept only as long as necessary for the stated purpose. A cart saved to improve user experience during a shopping session does not justify year-long retention.
Reasonable retention periods we observe in compliant implementations range from 30 to 90 days. After this window, the app should either delete the cart data or anonymize it by severing the link to any customer identifier.
Deletion must be irreversible. Some apps implement soft deletes where data is marked inactive but remains in the database. This does not satisfy GDPR deletion requirements. When a customer exercises their right to erasure, all cart records must be permanently removed.
You should verify that your saved-cart app honors Shopify’s customer data deletion webhooks. When you delete a customer account or process a GDPR erasure request through Shopify admin, the app should receive a webhook notification and purge all associated cart data within 30 days.
Configuring saved-cart apps for privacy compliance
Most saved-cart apps offer configuration options that affect privacy posture. Review these settings immediately after installation:
- Token expiry: Set the shortest retention period that still serves your conversion goals. 30 days is a reasonable default.
- Consent requirement: Enable options that require explicit opt-in before tracking cart activity. Do not rely on implied consent from browsing.
- Data minimization: Disable features that collect data beyond cart contents (browsing history, product views, time-on-page metrics) unless you have a documented business need.
- Third-party sharing: Turn off integrations with email platforms or analytics services unless you have updated your privacy policy to disclose these transfers.
- Geographic restrictions: Some apps allow you to disable tracking for visitors from specific regions. Consider disabling for EU and California traffic if you cannot ensure full compliance.
Document these configuration choices in your data processing records. GDPR Article 30 requires controllers to maintain records of processing activities, including retention periods and security measures.
If the app does not offer sufficient privacy controls, find an alternative. The Store Auditor scan identifies apps with excessive permission requests and flags privacy configuration gaps.
Common questions
How do I know if my saved-cart app is tracking customers?
Open your browser’s developer tools and navigate to the Application or Storage tab. Look for localStorage entries or cookies set by domains other than your Shopify store. Saved-cart apps typically create entries with names like cartToken, persistentCart, or the app vendor’s name. If these entries exist and contain long alphanumeric strings, the app is using persistent tracking. You can also check the Network tab while adding items to your cart to see what external domains receive requests.
Can I use saved-cart features without violating GDPR?
Yes, but you must implement proper consent and retention controls. Use a cookie consent banner that specifically mentions cart persistence and allows customers to opt out while still using your store. Set cart token expiry to 30 days maximum. Ensure your privacy policy discloses what cart data is collected, how long it is kept, and whether it is shared with third parties. Process all customer deletion requests within the required timeframes. GDPR does not prohibit saved carts, it requires transparency and user control.
What happens to saved cart data when I uninstall an app?
Uninstalling a Shopify app removes its access to your store’s API, but it does not automatically delete data the app has already collected. Most app vendors retain customer data on their servers unless you explicitly request deletion. Before uninstalling a saved-cart app, contact the vendor and request complete data deletion for all customers. Verify they have a documented process for handling these requests. Some apps offer a deletion option in their settings panel. Check your app permissions audit for any apps you have removed but may still hold data.
Wrap-up
Saved-cart apps improve conversion rates by preserving customer intent across sessions, but they create privacy obligations that many merchants overlook. Persistent tokens extend tracking windows far beyond Shopify’s native session management, turning casual browsing into long-term behavioral profiles. Merchants remain legally responsible for how these apps handle customer data, regardless of where the data is stored. Audit your current saved-cart implementation for token expiry settings, permission scopes, and GDPR compliance controls. If your app cannot demonstrate proper data handling, consider alternatives that prioritize privacy alongside conversion optimization. For a complete security and privacy review of your Shopify store, including all installed apps and their data practices, visit our pricing page to see how Store Auditor can help.