Book a free call

Predictive Analytics in Ecommerce: What Online Shops Forecast

Predictive analytics in ecommerce forecasts demand, cart abandonment, returns and customer value. Here is what it predicts and how a shop starts.

Hertiv engineering teamReviewed by a senior engineer
5 min read
Predictive Analytics in Ecommerce: What Online Shops Forecast
On this page

Short answer

Predictive analytics in ecommerce uses past orders, browsing and customer data to forecast what is likely to happen next in an online shop, such as which products will sell, which baskets will be abandoned, or which customers may not return. It gives a probability, not a certainty, and its forecasts are only as good as the click and order data behind them.

What is predictive analytics in ecommerce?

Predictive analytics in ecommerce is the use of past order and browsing data to forecast what will happen next in an online shop. It answers questions such as how many units of a product will sell next week, which baskets are likely to be abandoned, and which customers may not come back.

It differs from the same work in a physical shop because the data is different. An online shop records every click, search, cart change and return, so it can forecast behaviour that a till receipt never shows. That extra data is also the risk: click data is noisy, and a forecast built on it can be confidently wrong.

The output is always a probability, not a certainty. A forecast that says a customer has a 70% chance of returning does not say they will return. It says that out of 100 similar customers, about 70 did.

What does it forecast?

Online shops use forecasts in five places. The table below shows each one and what it changes.

Forecast What it predicts What it changes
Demand Units sold per product Stock and buying
Cart abandonment Which baskets will be left Reminders and offers
Returns Which orders come back Packaging and sizing help
Customer value Who will buy again Where to spend marketing
Churn Who stops buying Win-back messages
Fraud risk Which orders look risky Which orders to check

Demand forecasting is usually first, because stock is where the money is. A shop that orders too much ties up cash; a shop that orders too little loses sales. The other forecasts pay off once demand is working. For the physical-shop version, see predictive analytics in retail.

What data does an online shop need?

A forecast needs three kinds of data. Order data shows what was bought, when, and at what price. Click data shows what was viewed, searched for and put in a basket. Customer data shows who bought, how often, and whether they returned anything.

Each kind has a trap. Order data misses the shoppers who left without buying. Click data includes bots and accidental taps. Customer data goes stale when people change email addresses or share accounts. Clean the data before you forecast, or the forecast will learn the noise.

Two fields matter most and are often missing: the reason for a return, and whether a discount was running when the order was placed. Without the return reason, the shop cannot tell a sizing problem from a quality problem. Without the discount flag, the forecast thinks a sale week is normal demand.

How does a shop start with it?

Start with one forecast and one decision. Demand for the top 50 products is a good first choice, because the decision is clear: how much to order.

Follow these steps.

  1. Pick the forecast and the decision it must change, such as weekly ordering.
  2. Gather two years of order data if you have it, or one year at minimum.
  3. Build a simple forecast first, such as last year plus the recent trend, and measure it.
  4. Compare the simple forecast against what actually sold for the last eight weeks.
  5. Add a model only if it beats the simple forecast on those eight weeks.
  6. Put the forecast in front of the buyer and let them override it, with a note of why.

The override log matters. It shows where the forecast is wrong and why, and it keeps the buyer in charge. A forecast nobody can override will be ignored the first time it is wrong.

Example (hypothetical): forecasting a sale weekend

Example (hypothetical): an online clothing shop plans a sale weekend and wants to know how many units of its best-selling jacket to stock. Last year the same weekend sold 400 jackets. In the last four weeks, weekly jacket sales averaged 120 units, up from 100 a year ago, so demand is running 20% higher.

The simple forecast is 400 times 1.2, which is 480 jackets. The team stocks 480 and sells 460 over the weekend. The forecast was 20 units high, an error of about 4%. The arithmetic is simple: 480 minus 460 is 20, and 20 divided by 480 is just over 4%.

The team also forecasts cart abandonment. Of 1,000 baskets started during the weekend, 700 are abandoned, a 70% rate. A reminder email goes to 200 of those shoppers and 40 return to buy. That is a 20% recovery rate on the reminded group, and 40 extra orders the shop would not have had.

What are the common mistakes?

The most common mistakes are forecasting on dirty data, trusting a forecast without a baseline, and forgetting that a promotion changes demand.

  • Forecasting on dirty data. Bots, test orders and cancelled orders all distort the numbers.
  • No simple baseline. Without last-year-plus-trend to beat, you cannot tell if the model helps.
  • Ignoring promotions. A forecast trained on sale weeks will over-order in normal weeks.
  • Treating a probability as a promise. A 70% chance is wrong 30 times in 100.
  • No override log. If buyers cannot correct the forecast, they stop trusting it.
  • Forecasting everything at once. Start with demand, then add one forecast at a time.

What should a shop check before trusting a forecast?

Check the forecast on recent weeks you already know the answer to. If it cannot predict the last eight weeks well, it will not predict the next eight. Look at the error on your best sellers separately from the average, because a small average error can hide big errors on the products that carry the revenue.

Check what the forecast does when data is missing. A new product has no history, so the forecast must borrow from similar products or admit it does not know. A forecast that gives a confident number for a product with no history is guessing.

Finally, check the cost of being wrong. Over-ordering ties up cash in stock; under-ordering loses sales and disappoints customers. The forecast should be judged on the cost of its errors, not only on how close the numbers are. A shop that knows its error cost can decide how much stock to hold with confidence.

Key takeaways

  • A forecast gives a probability, not a certainty.
  • Demand forecasting comes first, because stock is where the money is.
  • Clean the click and order data before you forecast, or the forecast learns the noise.
  • A simple baseline forecast is the bar any model must beat.
  • Judge a forecast on the cost of its errors, not only on accuracy.

Frequently asked questions

How accurate is predictive analytics in ecommerce?

Accuracy varies by product and by how much history the shop has. A forecast for a steady best seller can be close, while a forecast for a new product is a guess. The honest test is to run the forecast on past weeks and measure the error, then judge whether that error costs less than ordering by gut feel.

What is the difference between predictive analytics in ecommerce and in retail?

Ecommerce forecasts use click, search and basket data that a physical shop never records, so they can predict cart abandonment and online churn. Retail forecasts use till and footfall data. The methods overlap, but the data and the decisions differ, so a shop with both channels usually runs both.

Do small online shops need predictive analytics?

A small shop can start with a simple forecast, such as last year plus the recent trend, in a spreadsheet. That is predictive analytics in its simplest form. A model only pays off once the catalogue is large enough that no one person can track every product by hand.

How much order history do I need?

One year is the minimum, because demand changes with seasons and sales events. Two years is better, because it shows whether last year's pattern repeated. With less than a year, the forecast cannot tell a seasonal peak from a real trend.

Can predictive analytics reduce returns?

It can flag the orders most likely to come back, so the shop can add sizing help, clearer photos or a check before dispatch. It cannot stop returns caused by poor quality or wrong items. The return reason field is the most useful data here, so collect it.

Should the forecast order stock automatically?

Not at first. Let the buyer see the forecast, override it, and record why. Once the forecast has beaten the simple baseline for several weeks and the override log shows few corrections, the shop can automate ordering for its most predictable products and keep a human in charge of the rest.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Running an online shop and want demand forecasts your buyers can trust? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Predictive Analytics service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call