AI at Work · Guide
AI and Machine Learning in Ecommerce: Where It Actually Pays Off
By Tom Tsatsos9 min read

For a small or mid-size store, machine learning pays off in six places, from site search and recommendations to forecasting, fraud screening, promotions, email timing and customer service. Most stores already have a first version of each in Shopify and Klaviyo. So the real work is clean product and order data, switching on what you already pay for, and keeping a person on the decisions that cost money when the model is wrong.
That is less exciting than most articles on this topic, which tend to list twenty uses and stop there. But it is where the money is. A model is only as good as the catalog and order history it learns from, and most stores we look at have gaps there long before they have a modeling problem.
This guide goes through each use, what you get without writing any code, when a custom build is worth it, and where a person has to stay in the loop.
What machine learning means for a store
Machine learning is software that finds patterns in past data and uses them to make a guess about something new. Which product this shopper wants next. How many units you will sell in March. Whether this order looks like fraud. It is different from the chat-style AI most people picture now. A language model writes text. A machine learning model usually produces a number, a ranking or a yes/no, and most of it runs quietly in the tools you already use.
The two meet more often than they used to. An on-site shopping assistant uses a language model to talk and ordinary code to look things up, and a search tool might use both. For a store owner the useful question is not which kind it is, but what decision it makes and what happens when it gets one wrong.
Where machine learning earns its keep
Site search and product recommendations
This is the first place to look, because search is where shoppers tell you exactly what they want. A good search tool corrects typos, understands that “EVOO” and “extra virgin olive oil” mean the same thing, and learns which results get clicked and bought. Recommendation blocks (“related products”, “frequently bought together”) learn from what customers buy together.
What usually holds it back is product data, not the model. If a product’s title and tags don’t contain the words shoppers type, no ranking model can surface it. Before anything else, run your top 50 search terms from GA4 and look at what comes back. For McEvoy Ranch, part of our search work is a site search that puts the right olive oil first.
Demand forecasting and inventory
Forecasting looks at past sales and seasonality to estimate what you will sell, so you can reorder before you run out and avoid sitting on stock. For a store with a few hundred products and steady sales, a forecast built on two years of clean history is often good enough to set reorder points.
It breaks down on new products with no history, one-off events and anything driven by a buyer’s decision, like a wholesale account placing a big order. Those still need a person. If inventory lives in an ERP or warehouse system, forecasting belongs there, connected to Shopify, rather than in a separate app. Our guide to Shopify ERP integration covers how that data should flow.
Fraud screening
Every payment processor runs fraud models, and Shopify shows a risk assessment on each order. For most small stores that is all the fraud machine learning you need. The work is setting rules around it. Decide which orders get held for review, and who reviews them. A person should make the call on anything flagged, because a model that cancels good orders costs you customers you never hear from again.
Pricing and promotions
Dynamic pricing (prices that change by the hour based on demand) gets a lot of attention, and for most small and mid-size stores it is the wrong place to start. Customers notice, it can damage trust, and you rarely have enough data per product for it to be reliable.
The practical use is looking back at promotions. Which discounts brought in new customers, and which just gave margin to people who would have bought anyway? Which products sell with no discount at all? That is analysis more than automation, and the decision about what to run next stays with a person.
Email timing and segmentation
This is where most stores already have machine learning and don’t use it. Klaviyo predicts each customer’s likely next order date, their chance of not coming back, and their expected lifetime value, once your account has enough order history. It can also test and suggest the best time to send. Those predictions make better segments than “bought in the last 90 days”, such as customers who usually reorder by now and haven’t.
The predictions are only as good as the data Klaviyo gets from Shopify. If your list is full of dead addresses or orders from other channels never reach Klaviyo, the predictions drift. We usually clean the list and check the data feed first. Our Klaviyo email marketing service starts there, and our guide to customer lifetime value explains how to use the number once you have it.
Customer service
Most of what customers ask before and after they buy is the same handful of questions. Where is my order. Will this fit. Can I return it. A help tool or chatbot that answers from your own policies and product data can handle a lot of that, and route the rest to a person.
The risk is an assistant that makes things up, like a return window you don’t offer or a size that is out of stock. We built an on-site shopping assistant on a test Shopify store to show how to prevent that. Every line it says cites the store’s own catalog or policies, and a check cuts anything it can’t source before the shopper sees it.
What’s built in, and what’s custom
Here is how each use breaks down for a typical Shopify store.
| Use | What you likely have already | When custom is worth it | Where a person stays in the loop |
|---|---|---|---|
| Search and recommendations | Shopify Search & Discovery, or your search app | Large catalogs, many attributes, B2B part numbers | Reviewing top search terms and fixing product data |
| Demand forecasting | Basic reports in Shopify or your inventory system | Hundreds of SKUs with long supplier lead times | New products, big orders, final purchase orders |
| Fraud screening | Your payment processor and Shopify’s order risk analysis | Rarely, unless you sell high-value or high-risk goods | Every order that gets flagged |
| Pricing and promotions | Discount reports in Shopify | Many products with frequent price changes | Every price and every promotion |
| Email timing and segments | Klaviyo predictions and send-time options | Rarely; set up what Klaviyo already offers first | Approving each flow and campaign |
| Customer service | Help desk tools with suggested replies | Assistants that answer from your own data | Anything involving refunds, exceptions or complaints |
The pattern is that the built-in version covers most stores for a long time. Custom work pays when you have a lot of products, a specific problem the standard tool can’t see, or data spread across systems that don’t talk to each other.
The data you need first
Before any of this works well, check these. Most of them are worth fixing whether or not you ever use machine learning.
- A clean catalog. Consistent titles and tags, plus fields for the details shoppers ask about (size, fit, materials, what it works with).
- Tracked inventory. Shopify tracking stock on every product and variant, so nothing out of stock gets recommended.
- Order history that is complete. At least a year, ideally two, including returns and orders from other channels like wholesale or retail shops.
- One customer record per person. The same customer in Shopify, your email tool and your point of sale, not three records with three email addresses.
- Analytics that match the store. GA4 ecommerce events that agree with Shopify’s order numbers within a small margin. If they don’t, fix that first. That is what our analytics and reporting work does.
- Written policies. Shipping and returns, with every exception written out in full. An assistant can only answer from what you have written down.
Where a person has to stay in the loop
Our rule is simple. A model can suggest and draft. A person approves anything that spends money, makes a promise to a customer or can’t be undone.
In practice that means a person signs off on purchase orders, price changes and refunds. The same goes for every email flow before it goes live. It also means someone checks the output on a schedule, because models drift as your catalog and customers change. A recommendation block that worked last spring can start pushing discontinued products without anyone noticing.
This is also how we build automation for clients. Every workflow on our AI agents and automation page has a person reviewing anything that reaches a customer, and nothing publishes or sends on its own.
How to start
Pick one use, not six. For most stores we would start with search or email, because the tools are already paid for and the results show up in a few weeks.
- List your top search terms and check what comes back for each.
- Look at which Klaviyo predictions are available on your account and build one segment from them.
- Fix the product and order data problems those two steps turn up.
- Only then decide whether something custom is worth it, and measure it against what you had before.
The last step matters. We built a weather-driven demo store that re-merchandises its homepage with the local forecast, and even there the plan for a real store is an A/B test against the regular homepage. It stays only if it earns its place. The same goes for any model.
Questions store owners ask about machine learning in ecommerce
How is machine learning used in ecommerce?
Mostly in places shoppers don’t see. It ranks search results and product recommendations, forecasts demand for reordering, screens orders for fraud, predicts when customers will buy again, and helps answer routine customer service questions. For most stores, these run inside tools they already use, like Shopify, their payment processor and Klaviyo.
Do small stores need custom machine learning?
Usually not at first. Shopify, payment processors and Klaviyo already include the models most small stores need, and the bigger gain comes from clean product data and switching on features you already pay for. Custom work makes sense when you have a large catalog, data split across systems, or a problem the standard tools can’t see.
How much data do you need for machine learning in ecommerce?
It depends on the use, but a year or two of complete order history is a good baseline for forecasting and customer predictions. Klaviyo’s predictive features only appear once an account has enough customers and orders. Search and recommendations depend more on the quality of your product data than on the amount of sales history.
What’s the difference between AI and machine learning in ecommerce?
Machine learning is the part of AI that learns patterns from past data to make predictions, like a forecast or a fraud score. When people say AI today, they often mean language models that write text, like ChatGPT or an on-site chat assistant. Many ecommerce tools now use both, but the questions to ask are the same: what decision it makes, and who checks it.
Can machine learning set my prices automatically?
It can, but for most small and mid-size stores we wouldn’t let it. Prices that change on their own can confuse customers and damage trust, and few stores have enough data per product for it to be reliable. A better use is analyzing past promotions, with a person deciding what to run next.
Next step
If you want a second opinion on where machine learning would help your store, or help setting up the tools you already have, see our AI agents and automation service or talk with #10. For the text side of AI at work, see our guide to ChatGPT for business.
More in AI at Work