Book a free call

Machine Learning for Marketing: What It Does and Where to Start

Machine learning for marketing predicts what customers will do next, so teams can target better, time messages well and spot churn early. Here is how it works.

Hertiv engineering teamReviewed by a senior engineer
6 min read
Machine Learning for Marketing: What It Does and Where to Start
On this page

Short answer

Machine learning for marketing uses models trained on customer data to predict purchases, churn and the best time to send a message. It ranks and scores customers so teams can focus effort where it is most likely to pay off.

What is machine learning for marketing?

Machine learning for marketing is the use of models that learn from customer data to predict what a person is likely to do next, and to act on that prediction. Instead of fixed rules written by hand, the system finds patterns in past behaviour and applies them to new customers.

A common example is predicting which subscribers are likely to buy, churn or open an email. The model is trained on past campaigns and customer records, then scores each new customer so the team can focus effort where it is most likely to pay off.

Use caseWhat the model doesWhat the team gets
Audience targetingScores who is likely to buySmaller, better lists
Churn predictionFlags customers at risk of leavingEarly retention offers
Product recommendationsRanks what each person may wantHigher order values
Send-time choicePicks when each person opens mailBetter open rates
Ad spend allocationEstimates return per channelBudgets that follow results

Machine learning does not replace marketing judgement. It ranks, scores and sorts, while people decide the message, the offer and the brand voice. Teams that treat it as a sorting tool get more from it than teams that expect it to write the strategy.

What can machine learning do in marketing?

Machine learning can improve the parts of marketing that repeat at scale: choosing audiences, timing messages, ranking products and spotting customers who are drifting away. Each of these is a prediction problem with a clear outcome to measure.

Audience targeting is the usual starting point. A model trained on past buyers can score a new list and rank it, so the team sends to the most promising slice first. This cuts wasted sends and keeps the list healthier, since fewer uninterested people receive mail.

Recommendations work the same way. A model that has seen what similar customers bought can rank products for each visitor, which is why recommendation widgets appear on most large shops. The same idea applies to content: ranking articles or videos by what a person has read before.

Churn prediction is slower to show value but often worth more. A model that flags at-risk customers a month early gives the team time to act with an offer or a check-in, rather than noticing after the customer has gone. For a closer look at how predictions feed campaigns, see predictive analytics in marketing.

What data do you need?

You need customer records that connect behaviour to outcomes: who bought, who left, who opened, and when. Without outcomes to learn from, a model has nothing to predict.

  • Customer records. Sign-up date, plan, location and any profile fields you already collect.
  • Behaviour history. Purchases, page views, email opens and clicks, support contacts and app usage.
  • Campaign history. What was sent, to whom, when, and what happened next.
  • Outcome labels. Bought or not, stayed or left, opened or ignored, so the model can learn the difference.
  • Consent and privacy notes. A record of what each customer agreed to, since marketing data use is regulated in many places.

Most teams already hold enough data to start. A shop with a year of orders and a mailing list can train a simple targeting model; a team with only a few hundred customers should wait, since small data gives unreliable models.

How to start with machine learning in marketing

You start with machine learning in marketing by picking one measurable outcome, proving a model beats the current method, and only then expanding to more uses.

  1. Pick one outcome. Choose something you can measure, such as purchases from an email campaign or customers who cancel.
  2. Build a baseline. Record how the current method performs, so you can tell whether the model is actually better.
  3. Prepare one clean dataset. Join customer, behaviour and outcome records into a single table with clear labels.
  4. Train a simple model first. A basic model that works is worth more than a complex one that never ships.
  5. Test it on a small slice. Send the model's picks to a small group and the usual picks to a control group, then compare results.

Keep the first project small and visible. A targeting win on one campaign is easier to defend than a large platform project with no result for months. Teams that want help scoping a first model often start with AI agents for marketing as a way to put a working system in front of the team quickly.

Example (hypothetical): a shop's email campaign

Example (hypothetical): an online shop has 10,000 subscribers and sends one campaign a week. The team trains a simple model to pick the 2,000 subscribers most likely to buy, and sends the campaign to them first.

The arithmetic is straightforward. The targeted group of 2,000 subscribers buys at 12%, which is 2,000 × 0.12 = 240 orders. Sending the same campaign to all 10,000 subscribers at a 2% rate gives 10,000 × 0.02 = 200 orders. The targeted send produces 40 more orders while sending 8,000 fewer emails, which also keeps the list cleaner and reduces unsubscribes.

The lesson is not that targeting always wins, but that the comparison is easy to run. One campaign, two groups, and a clear count of orders tells the team whether the model earns its keep.

How do you measure whether it works?

You measure machine learning in marketing by comparing the model's picks against a control group on the same outcome. Without a control group, you cannot tell whether the model helped or the campaign was simply a good one.

Useful measures include conversion rate on the targeted group, revenue per send, unsubscribe rate and the share of customers the model correctly flagged. Track these over several campaigns, not one, since a single send can be noisy.

Watch for drift as well. Customer behaviour changes with seasons and product changes, so a model trained last year may rank poorly today. Retraining on recent data every few months keeps the scores honest, and a sudden drop in performance is a sign the model needs fresh data.

What are the common mistakes?

The most common machine learning mistakes in marketing are training on dirty data, trusting a model without a control group, and expecting it to fix a weak offer.

  • Dirty or incomplete data. Duplicate customers, missing purchase records and wrong labels all teach the model the wrong thing.
  • No control group. Without one, every improvement gets credited to the model, even when the campaign itself did the work.
  • Chasing accuracy instead of profit. A model can be accurate and still useless if it only predicts what the team already knew.
  • Ignoring privacy rules. Using data customers did not agree to share creates legal risk that no campaign result can justify.
  • Letting the model run without review. Scores should be checked regularly, since behaviour changes and models go stale.

Key takeaways

  • Machine learning for marketing predicts customer behaviour from past data, it does not write strategy
  • Audience targeting, churn prediction and recommendations are the usual starting points
  • You need customer records joined to outcomes: who bought, left or opened, and when
  • Start with one measurable outcome, a baseline and a small test against a control group
  • Measure conversion per send and retrain regularly, since customer behaviour changes

Frequently asked questions

Do small businesses need machine learning for marketing?

Not always. A small list with a few hundred customers rarely has enough data for a reliable model. Simple segments based on past purchases usually work better until the list grows into the thousands and the team can measure results properly.

What is the difference between machine learning and marketing automation?

Marketing automation runs fixed rules, such as sending a welcome email after sign-up. Machine learning predicts outcomes, such as who is likely to buy, and updates its predictions as new data arrives. Many teams use both: automation runs the sends, and models choose the audience.

How much data do I need to start?

A year of orders and campaign history is usually enough for a first targeting model, provided the records are clean and joined to outcomes. A few hundred customers is too little for most models; a few thousand is a workable starting point.

Is machine learning for marketing expensive?

The first project is usually cheap: a simple model on data you already hold. Costs grow when you add real-time scoring, large data pipelines or managed platforms. Start with one campaign and a spreadsheet-level model before spending on tools.

Does machine learning replace marketers?

No. Models rank, score and sort, while people decide the message, the offer and the brand voice. The best results come from teams that use models to focus their effort, not from teams that hand decisions to a model and stop checking.

How do I know if my model is working?

Compare its picks with a control group on the same outcome over several campaigns. If the targeted group converts better and unsubscribes less, the model is helping. If the gap is small or inconsistent, the model needs better data or a different outcome to predict.

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

Want machine learning working on your marketing? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI agents for marketing 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