You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Use it freely, keep the attribution with it, and tell me what you are building with it.

Log in or Sign Up to review the conditions and access this dataset content.

Synthetic E-Commerce Analytics Dataset

Most analytics demos hand you one clean table and call it a dataset. A real store doesn't work like that. You have customers who arrived through different channels, a product catalogue with prices and costs, orders that get placed and sometimes refunded, the line items inside each order, and a clickstream of everything people did before they bought.

This is all five of those tables, joined the way a real store's data joins. Every row is synthetic and comes out of one seeded generator, so the whole thing is identical every time you build it. No real people, nothing scraped, no privacy or licensing worries. Just realistically-shaped data you can practice on.

Tables

Five tables, about 104,000 rows, that fit together into a normal e-commerce shape.

Config Rows Grain Joins to
customers 2,000 one row per customer (none)
products 120 one row per product (none)
orders 12,000 one row per order customers.customer_id
order_items 30,120 one row per line item orders.order_id, products.product_id
events 59,599 one row per clickstream event customers.customer_id

Schema

customers

column type notes
customer_id int64 primary key
signup_date date acquisition date
channel string organic, paid_search, social, email, referral, affiliate
country string US, GB, DE, FR, CA, AU, NL, SE

products

column type notes
product_id int64 primary key
product_name string SKU-0001
category string Apparel, Home, Electronics, Beauty, Outdoors, Toys
unit_price double list price
unit_cost double cost basis (unit_cost < unit_price), so you can compute margin

orders

column type notes
order_id int64 primary key
customer_id int64 joins to customers
order_ts timestamp[ns] order time
status string completed (~67%), refunded, cancelled

order_items

column type notes
order_item_id int64 primary key
order_id int64 joins to orders
product_id int64 joins to products
quantity int64 1–4
unit_price double price captured at order time

events (clickstream funnel)

column type notes
event_id int64 primary key
session_id int64 browsing session
customer_id int64 joins to customers
event_type string funnel step: viewadd_to_cartcheckoutpurchase
event_ts timestamp[ns] event time

Usage

Each table is a separate config. Load the one you need:

from datasets import load_dataset

orders    = load_dataset("LaelaZorana/synthetic-ecommerce", "orders",      split="train")
items     = load_dataset("LaelaZorana/synthetic-ecommerce", "order_items", split="train")
customers = load_dataset("LaelaZorana/synthetic-ecommerce", "customers",   split="train")

The files are Parquet, so you can also query them in place with DuckDB and skip the download:

import duckdb

duckdb.sql("""
    SELECT c.country, ROUND(SUM(oi.quantity * oi.unit_price), 2) AS revenue
    FROM 'hf://datasets/LaelaZorana/synthetic-ecommerce/orders.parquet'        o
    JOIN 'hf://datasets/LaelaZorana/synthetic-ecommerce/order_items.parquet'   oi USING (order_id)
    JOIN 'hf://datasets/LaelaZorana/synthetic-ecommerce/customers.parquet'     c  USING (customer_id)
    WHERE o.status = 'completed'
    GROUP BY 1 ORDER BY revenue DESC
""").show()

How it was generated

One seeded NumPy generator builds every table, so the data is a pure function of the seed (42 by default) and comes out byte-identical each run. The defaults are 2,000 customers and 12,000 orders. The behaviour is meant to look like a real store rather than a uniform random draw:

  • A few customers do most of the buying. Order counts follow a Gamma-weighted affinity per customer, so a small group places a large share of the orders, the way real repeat-purchase behaviour skews.
  • The acquisition mix is lopsided. Channel and country are drawn from weighted distributions, so organic and US dominate and the long tail thins out.
  • The funnel reconciles. Every completed order is backed by a full view → add_to_cart → checkout → purchase session. Extra sessions get abandoned partway and never reach purchase.

Invariants you can rely on

The source project enforces these as data-quality gates, so they hold in the data here:

  • The funnel ties out: the number of purchase events equals the number of completed orders.
  • Referential integrity holds: every order_items.order_id exists in orders, every orders.customer_id exists in customers, and so on.
  • Values stay in range: quantity is 1 to 4, status and event_type only take the values listed above, and every price and cost is positive.

What it's good for

  • SQL and analytics practice: revenue by day, top products, cohort retention, funnel conversion.
  • Tabular ML prototyping: repeat-purchase or churn classification, order-value regression, a daily-revenue time series.
  • Teaching and demos: a privacy-safe stand-in for a real store's back end.

What to keep in mind

This is synthetic data, so it carries no real-world signal. The distributions are plausible but hand-tuned, and the relationships are deliberately simple: there's no real price elasticity, no seasonality, no true consumer behaviour underneath. Use it to build and test the pipeline, not to draw conclusions about a real market, and don't benchmark a model on it as if it were ground truth.

License & citation

Released under the MIT License © 2026 Laela Zorana. Free to use, change, and redistribute with attribution.

@misc{zorana_synthetic_ecommerce_2026,
  author = {Laela Zorana},
  title  = {Synthetic E-Commerce Analytics Dataset},
  year   = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/LaelaZorana/synthetic-ecommerce}}
}

Generated by the CommercePipeline project.

Who built this

I am Laela Zorana. I write GPU kernels and measure them on real hardware, on AMD Instinct cards and on AWS Trainium, and most of my work sits at the point where two correct answers disagree and something has to decide which one to trust.

If this was useful, a like puts it in front of the next person looking for the same thing, and following means you see what I measure next. If you are using it for something, I would like to hear what.

Where the rest of my work lives.

Downloads last month
139

Collection including LaelaZorana/synthetic-ecommerce