Data retention policies for ecommerce: how long to keep customer data
TL;DR
- Storage limitation: GDPR Article 5(1)(e) requires you to keep personal data only as long as necessary. No purpose, no retention.
- No universal deadline: retention periods vary by data type. Order data: 6-7 years (tax). Marketing consent: 12-24 months inactive. Abandoned carts: 30-90 days.
- Document everything: you must state retention periods in your privacy policy and records of processing activities.
- Platforms do not help: Shopify, WooCommerce and BigCommerce keep data indefinitely by default. You must build your own deletion workflows.
- Anonymize what you can: strip identifiers but keep aggregate revenue and order data for business reporting.
- Most ecommerce stores have no retention policy at all. That is a compliance gap regulators check for.
Most ecommerce stores never delete customer data. Orders from 2015 sit in Shopify alongside records from last week. Email lists grow but never shrink. Analytics data accumulates without limit. The assumption is that more data is always better.
That assumption creates legal exposure. GDPR Article 5(1)(e) establishes the storage limitation principle: personal data must be kept only as long as necessary for its original purpose. CCPA and the growing patchwork of US state privacy laws increasingly require disclosed retention periods. Regulators ask for retention schedules during investigations. If you cannot explain why you still hold a customer's data from six years ago, you have a compliance problem.
This guide covers retention periods by data type, regulatory requirements across jurisdictions, platform-specific guidance and a practical framework for building a retention policy that actually works.
Why data retention matters
Data retention is not an abstract governance exercise. It has direct legal, financial and operational consequences for ecommerce stores.
The legal obligation
GDPR Article 5(1)(e) is explicit. Personal data must be "kept in a form which permits identification of data subjects for no longer than is necessary for the purposes for which the personal data are processed." This is not guidance. It is a binding principle. Violation carries fines of up to 20 million EUR or 4% of global annual turnover.
Article 13 and Article 14 require you to inform data subjects of your retention periods at the point of collection. Article 30 requires you to document retention periods in your records of processing activities. Your privacy policy must state how long you keep each category of data.
The CCPA/CPRA added explicit retention disclosure requirements. You must state the retention period for each category of personal information collected, or the criteria used to determine the period. "We keep your data as long as necessary" is not sufficient. Regulators want specifics.
The practical risk
Every record you hold is a record that can be breached. A data breach affecting 10 years of customer data is far worse than one affecting 2 years. Notification obligations, remediation costs and reputational damage all scale with the volume of compromised records.
When a customer submits a data subject access request, you must search every system for their data. The more data you retain, the more systems you must search, the more complex the response and the higher the risk of an incomplete reply.
The business case
Stale data degrades marketing performance. An email list full of inactive subscribers tanks deliverability. Customer segments built on years-old purchase data produce inaccurate targeting. Storage and processing costs increase with data volume. Cleaning up old data improves operations alongside compliance.
Retention periods by data type
There is no single retention period that applies to all ecommerce data. Different data types serve different purposes and are subject to different legal requirements. The table below provides recommended retention periods based on regulatory requirements and industry practice.
| Data type | Recommended retention | Legal basis / rationale |
|---|---|---|
| Order and transaction data | 6-7 years | Tax and accounting obligations (IRS 3-6 years, EU VAT 5-10 years depending on member state) |
| Payment card data | Do not store | PCI DSS prohibits storing full card numbers, CVV and PIN data after authorization. Use tokenized references only. |
| Marketing consent records | Duration of consent + 3 years | Proof of consent for GDPR accountability. Retain evidence for 3 years after consent withdrawal for dispute resolution. |
| Email marketing lists (active) | Duration of active engagement | Suppress or delete after 12-24 months of inactivity. Re-engagement campaign at 12 months. |
| Analytics data (identified) | 14-26 months | GA4 default retention is 2 months (extendable to 14). Keep identified analytics data no longer than 26 months. |
| Customer support tickets | 2-3 years after resolution | Warranty and dispute resolution. Align with statute of limitations in your jurisdiction. |
| Customer account data | Duration of account + 30 days | Delete within 30 days of account closure or deletion request. Tax-relevant order data may be retained separately. |
| Abandoned carts | 30-90 days | No completed transaction, so contract performance basis does not apply. Recovery campaign window, then delete. |
| Returns and refund records | 6-7 years | Financial records tied to tax obligations. Retain alongside order data. |
| Tax records (invoices, receipts) | 7-10 years | IRS requires 3-7 years depending on circumstances. EU member states require 5-10 years for VAT. Keep the maximum applicable period. |
These periods are starting points. Your specific obligations depend on your jurisdiction, the nature of the data and the legal basis for processing. Document the rationale for each retention period in your records of processing activities.
Note the distinction between personal data and financial records. When the retention period for personal data expires, you can anonymize records: strip the customer name, email and address but keep the order amount, date and product data for financial reporting. Anonymized data is no longer personal data under GDPR and can be kept indefinitely.
GDPR vs CCPA vs US state law requirements
Data retention obligations vary significantly across jurisdictions. If you sell to customers in the EU, California and other US states, you must satisfy the strictest applicable requirement for each data category.
| Requirement | GDPR (EU/UK) | CCPA/CPRA (California) | US state laws (other) |
|---|---|---|---|
| Mandated retention periods | No specific periods. You define and document your own based on purpose. | No specific periods. Must disclose periods or criteria in privacy policy. | Generally no mandated periods. Virginia, Colorado, Connecticut follow GDPR model. |
| Storage limitation principle | Yes. Article 5(1)(e). Core principle. Must not keep data longer than necessary. | Implied. CPRA requires disclosed retention periods and data minimization. | Virginia, Colorado, Connecticut, Oregon include data minimization requirements. |
| Disclosure obligation | Must state retention periods in privacy notice (Art 13/14) and ROPA (Art 30). | Must disclose retention period or criteria for each category of PI collected. | Most state laws require retention period disclosure in privacy notices. |
| Deletion rights | Right to erasure (Art 17). Must delete when purpose expires, consent withdrawn or no legal basis. | Right to delete. Must honor within 45 days. Exceptions for legal obligations and transactions. | Most state laws include deletion rights with similar exceptions. |
| Enforcement for retention violations | Fines up to 20M EUR or 4% of global turnover. Active enforcement. | CPPA enforcement. Fines up to $7,500 per intentional violation. | AG enforcement varies by state. Fines typically $7,500-$25,000 per violation. |
| Documentation requirement | ROPA must include retention periods. Must demonstrate compliance (accountability). | Privacy policy must include retention periods. No separate ROPA equivalent. | Privacy notice must include retention information. Some states require data protection assessments. |
The practical takeaway: regardless of where your customers are, you need documented retention periods for every category of personal data you collect. GDPR is the most demanding framework, so if you build for GDPR compliance, you will satisfy most other requirements. But check the specific US state privacy laws that apply to your customer base.
Platform-specific retention: Shopify, WooCommerce, BigCommerce
Ecommerce platforms do not enforce retention policies for you. Understanding what each platform retains by default and what tools it provides for deletion is essential.
Shopify
Shopify retains customer and order data indefinitely by default. There is no built-in auto-deletion feature. To implement retention schedules, you have several options:
- Manual deletion. Admin panel allows deleting individual customer records. Order records can be deleted but financial data may be retained for Shopify's own compliance. This does not scale for stores with thousands of customers.
- Shopify APIs. The Customer API and Order API support deletion operations. Build automated scripts that identify records past their retention period and delete them programmatically. Run these on a scheduled basis.
- Third-party apps. Apps like Data Export and GDPR compliance tools can automate retention workflows. Verify they actually delete data rather than just flagging it.
- Customer data request. Shopify provides a built-in mechanism for customers to request data erasure. This handles individual requests but does not implement proactive retention schedules.
Important: deleting a customer in Shopify does not automatically delete their data from Klaviyo, Zendesk, Google Analytics or other connected systems. You must delete across all systems.
WooCommerce
WooCommerce (WordPress) gives you more control since you own the database. Options include:
- Built-in erasure tools. WooCommerce includes a personal data erasure tool that anonymizes order data (replaces names and addresses with placeholder text while keeping order amounts and dates). This is a good anonymization approach.
- WordPress data retention settings. WordPress 4.9.6 introduced data erasure tools. WooCommerce hooks into these for customer data.
- Database-level automation. Since you control the MySQL database, you can write cron jobs that identify and anonymize or delete records past retention thresholds. Test thoroughly before running against production data.
- Plugins. WP GDPR Compliance and similar plugins offer retention schedule management and automated anonymization.
BigCommerce
BigCommerce provides customer deletion through the admin panel and API. Key considerations:
- Customer records can be deleted individually through the control panel or via the Customers API.
- Order data is tied to customer records. Deleting a customer does not automatically delete their orders. You must handle orders separately.
- BigCommerce does not offer built-in retention scheduling. Use the API to build automated retention workflows.
- Checkout and abandoned cart data requires separate handling through the Abandoned Carts API.
Across all platforms, the pattern is the same. The platform stores everything forever. You must build the deletion logic yourself. This is why a documented retention policy matters: without it, nothing gets deleted.
Implementing retention schedules
A retention policy is only useful if it is enforced. Most stores write a policy, put it in a drawer and never delete anything. Here is how to make retention schedules operational.
Automated deletion workflows
The most reliable approach is automated deletion on a scheduled basis. Build workflows that:
- Run weekly or monthly against each data system.
- Identify records past their retention threshold based on creation date, last activity date or specific trigger events (account closure, consent withdrawal).
- Delete or anonymize those records according to the retention policy.
- Log what was deleted, when and by what rule. Maintain an audit trail.
For ecommerce platforms, this typically means API scripts. For email marketing platforms, it means automated list hygiene rules. For analytics, it means configuring platform-level retention settings.
Anonymization vs deletion
Anonymization is often preferable to outright deletion for ecommerce data. The approach:
- Strip all personal identifiers: name, email, phone, IP address, shipping address, billing address.
- Replace with generic placeholders or hash values that cannot be reversed.
- Keep non-identifying data: order amounts, product SKUs, dates, payment status.
- The resulting record is no longer personal data under GDPR and can be retained indefinitely for business reporting.
This preserves your ability to report on revenue trends, product performance and order volumes without retaining personal data beyond its purpose. WooCommerce's built-in erasure tool follows this pattern.
Consent-based retention triggers
Some data retention periods are tied to consent rather than fixed time periods. When a customer withdraws marketing consent, their email marketing data should be suppressed immediately and deleted within a defined window (30 days is common). Your email marketing compliance setup should handle consent withdrawal as a deletion trigger, not just an unsubscribe.
Cross-system coordination
The biggest implementation challenge is that customer data lives across many systems. Deleting a customer from Shopify but leaving their data in Klaviyo, Zendesk, GA4, Meta and your CRM means you have not actually completed the retention action.
Build a deletion checklist for each data type and each system. When retention expires for a customer's marketing data, the workflow should delete from the email platform, the SMS platform, the ad platform custom audiences and any CRM where marketing segments are stored. This is the same cross-system challenge you face with data subject access requests.
Common mistakes
These are the retention policy failures regulators see most often in ecommerce.
| Mistake | Why it happens | Compliance risk |
|---|---|---|
| Keeping everything forever | Default platform behavior. No one sets up deletion. "We might need it someday." | Violates GDPR storage limitation. Increases breach impact. Regulators flag this immediately. |
| No documented policy | Retention policy never written or is a vague paragraph in the privacy policy. | Cannot satisfy Art 30 ROPA requirement. Cannot respond to regulator audit. Cannot inform data subjects. |
| Inconsistent across systems | Delete from Shopify but not Klaviyo. Anonymize orders but keep support tickets indefinitely. | Incomplete implementation. Data subject complaints reveal gaps. Creates conflicting audit evidence. |
| Using "legitimate interest" to justify indefinite retention | Claiming business analytics as legitimate interest for keeping all data forever. | Legitimate interest does not override storage limitation. Must still define and enforce retention periods. |
| No deletion audit trail | Data is deleted but there is no record of what was deleted or when. | Cannot demonstrate compliance. If a regulator asks "when did you delete this customer's data?" you have no answer. |
| Ignoring backups | Production data is deleted but personal data persists in database backups for months or years. | Backups containing personal data are still in scope. Must have a backup rotation policy aligned with retention periods. |
| Privacy policy says one thing, practice does another | Policy states "we delete data after 2 years" but no automation exists to enforce it. | The gap between policy and practice is itself a compliance failure. Regulators check actual data against stated policy. |
Building a retention policy
A practical retention policy for an ecommerce store does not need to be a 50-page legal document. It needs to be specific, actionable and enforced. Here is a framework.
Step 1: Data inventory
List every system that stores customer personal data. For each system, document:
- What categories of personal data it holds.
- The purpose of that data.
- The legal basis for processing (consent, contract, legitimate interest, legal obligation).
- Who has access.
- Whether data is shared with third parties.
This inventory feeds directly into your GDPR Article 30 records of processing activities. If you built your store following privacy by design principles, you may already have this inventory.
Step 2: Define retention periods
For each data category in your inventory, define a retention period and the rationale:
- Start with legal minimums: tax records (6-7 years), financial transactions (varies by jurisdiction).
- Apply the storage limitation principle to everything else: how long do you actually need this data for its stated purpose?
- Be specific. "As long as necessary" is not a retention period. "24 months from last purchase" is.
- Document the rationale for each period. "6 years: IRS record retention requirement under 26 USC 6501" is defensible. "We might need it" is not.
Step 3: Define deletion actions
For each data category, specify what happens when the retention period expires:
- Delete: remove the record entirely from the system.
- Anonymize: strip personal identifiers, keep aggregate data.
- Archive: move to a restricted-access archive with a secondary retention period (use sparingly, must have a legal basis).
Step 4: Assign ownership
Someone must be responsible for each system's retention enforcement. For small stores, this may be one person. For larger teams, assign system owners: marketing owns Klaviyo retention, operations owns Shopify retention, support owns Zendesk retention.
Step 5: Automate
Manual retention enforcement fails. People forget. Priorities shift. Automate deletion workflows for every system where the platform supports it. For systems without automation, set calendar reminders for quarterly manual reviews.
Step 6: Audit
Review your retention policy annually. Check that automated deletions are running correctly. Spot-check systems for data that should have been deleted. Update retention periods if legal requirements change or business purposes evolve.
Retention policy checklist
- Data inventory completed for all systems storing personal data.
- Retention period defined for each data category with documented rationale.
- Deletion or anonymization action specified for each data category.
- System owner assigned for each retention action.
- Automated deletion workflows implemented where possible.
- Privacy policy updated with specific retention periods for each data category.
- Records of processing activities updated with retention periods.
- Backup rotation policy aligned with retention periods.
- Deletion audit trail in place (what was deleted, when, by what rule).
- Annual review scheduled.
Tax and legal hold exceptions
Not all data can be deleted when its primary purpose expires. Two categories of exceptions require careful handling.
Tax and accounting records
Tax authorities require businesses to retain financial records for specified periods. These obligations override GDPR deletion rights for the specific data needed to satisfy the obligation.
- United States. The IRS generally requires records for 3 years from filing. This extends to 6 years if you underreported income by more than 25%. In practice, most advisors recommend 7 years. State tax requirements vary.
- European Union. VAT records must be kept for 5 to 10 years depending on the member state. France: 6 years. Germany: 10 years. UK: 6 years. Check requirements for each country where you have VAT obligations.
- What to retain. The tax obligation covers transaction records: invoice data, amounts, tax calculations, payment records. It does not require you to retain marketing preferences, browsing history or support ticket conversations. Separate the financial data from the personal data where possible.
The best approach: when an order record reaches the end of its personal data retention period but is still within the tax retention window, anonymize the customer details but keep the financial data. This satisfies both GDPR storage limitation and tax record requirements.
Legal holds
If you are involved in or reasonably anticipate litigation, you may be required to preserve relevant data regardless of your retention policy. This is called a litigation hold or legal hold.
- When a legal hold is triggered, suspend automated deletion for the affected data until the hold is lifted.
- Legal holds should be narrow: preserve data relevant to the specific matter, not all data in the system.
- Document the hold: what data is preserved, why, when the hold started and when it ends.
- A legal hold does not change your retention policy. It creates a temporary exception. When the hold is lifted, the retained data should be evaluated against the retention policy and deleted if past its period.
If you sell to customers in multiple jurisdictions, be aware that cross-border data transfer rules may affect where retained data can be stored during legal holds.
Third-party vendor data retention
Your data retention policy is only as strong as your weakest vendor. If you delete customer data from your ecommerce platform but your email marketing tool, analytics platform and payment processor all retain it indefinitely, you have not achieved compliance.
Analytics platforms
Google Analytics 4 has configurable data retention settings. The default is 2 months for user-level data, extendable to 14 months. Many stores never change this setting, meaning detailed user-level analytics data is already being deleted. But aggregated reports are retained indefinitely, which is fine since aggregate data is not personal data.
Other analytics tools (Mixpanel, Amplitude, Segment) have their own retention settings. Check and configure each one. If a tool does not offer configurable retention, include this in your DPA negotiations.
Email marketing platforms
Klaviyo, Mailchimp, Omnisend and similar platforms retain subscriber data indefinitely by default. They do not auto-delete inactive subscribers. You must build list hygiene processes. Consistent with your email marketing compliance requirements:
- Suppress subscribers who have not engaged in 12 months.
- Run a re-engagement campaign before suppression.
- Delete suppressed subscribers who do not re-engage within 30 days.
- Delete unsubscribed contacts after retaining proof of consent withdrawal for your records (keep the consent record, delete the profile data).
Payment processors
Stripe, PayPal, Adyen and other payment processors retain transaction data for their own compliance obligations (PCI DSS, financial regulations). You cannot force them to delete this data if they have an independent legal basis to retain it. However:
- Review your DPA with each payment processor to understand their retention practices.
- Minimize the data you send to payment processors. Only transmit what is necessary for the transaction.
- If you store payment-related data in your own systems (transaction IDs, amounts, dates), apply your retention policy to your copies.
Customer service platforms
Zendesk, Gorgias, Freshdesk and similar tools retain ticket data indefinitely. Most offer deletion APIs or admin tools to remove old tickets. Configure automated deletion for tickets older than your retention period. Be careful with tickets that contain information relevant to ongoing warranty claims or disputes.
Data Processing Agreements
Your DPAs with vendors should include retention requirements. Specifically:
- The vendor must delete or return personal data at the end of the service agreement.
- The vendor must comply with your deletion instructions within a defined timeframe.
- The vendor must not retain personal data for longer than necessary to provide the service.
- The vendor must provide confirmation of deletion upon request.
If a vendor's DPA does not address data retention, raise this before signing. After signing, audit vendor compliance with your retention requirements at least annually. Review our guide on third-party data sharing for the full vendor management framework.
Frequently asked questions
- How long should ecommerce stores keep customer order data?
- 6 to 7 years to satisfy tax and accounting obligations. The IRS requires 3-6 years; EU VAT requires 5-10 years depending on the member state. After the tax retention period, anonymize or delete personal data while keeping aggregate financial records.
- What does GDPR say about data retention?
- GDPR Article 5(1)(e) establishes storage limitation: personal data must be kept only as long as necessary for its purpose. There is no single mandated period. You define your own periods based on lawful purpose, then delete or anonymize when that purpose expires.
- Do I need a written data retention policy?
- Yes. GDPR Article 30 requires retention periods in your records of processing activities. Articles 13 and 14 require you to inform data subjects. Without a documented policy, you cannot meet these obligations. Regulators ask for retention schedules during audits.
- How long can I keep marketing email addresses under GDPR?
- Only as long as consent is active. If a subscriber has not engaged for 12-24 months, continued processing is hard to justify. Run re-engagement campaigns at 12 months. Suppress or delete non-responsive contacts by 24 months.
- What is the difference between deletion and anonymization?
- Deletion removes data entirely. Anonymization strips identifying information so data cannot be linked to an individual. Anonymized data falls outside GDPR scope and can be kept indefinitely. For ecommerce, anonymize order records to keep revenue statistics while removing customer identifiers.
- Does CCPA require specific retention periods?
- CCPA does not mandate specific periods, but CPRA requires you to disclose retention periods in your privacy policy for each category of personal information. Keeping data indefinitely without disclosure creates enforcement risk.
- How does Shopify handle data retention?
- Shopify retains data indefinitely by default. No auto-deletion exists. Store owners must implement their own retention schedules using the Shopify API, admin tools or third-party apps to identify and delete data past its retention period.
- Should I delete abandoned cart data?
- Yes. Abandoned cart data contains personal information for a transaction that never completed. Contract performance basis does not apply. Retain for 30-90 days for recovery campaigns, then delete. Longer retention is hard to justify under GDPR.
- What if I keep data longer than my stated retention period?
- The gap between your stated policy and actual practice is itself a compliance failure. It violates GDPR Article 5(1)(e) and your own privacy policy. Regulators check actual data against stated policy during audits. Fines can reach 20 million EUR or 4% of global turnover.
- How do I handle vendor data retention for tools like Klaviyo or Google Analytics?
- You are responsible for vendor compliance with your retention policy. Configure platform retention settings (e.g., GA4 data retention), include retention requirements in DPAs, audit vendor practices annually. If a vendor retains data longer than your policy allows, change the setting, amend the DPA or switch vendors.
Complyko scans your ecommerce store for privacy compliance gaps, including missing retention disclosures, consent management issues and policy completeness. Know where you stand before a regulator asks.
Get your free scan →