Using Reinforcement Learning to track marketing spend

Mohsin Zafar19 May 2023

Problem

Haleon's marketing team splits its search advertising into ad groups (AdGroups): sets of related keywords aimed at one audience. Managers ask, for example, "given performance to date among dentists, should we change next weeks' spend, and how?" A bandit replaces a fixed A/B split by moving traffic toward the groups that perform well. Success means a higher conversion rate, a lower cost per acquisition (CPA) and ROI that rises during the campaign.

Example from the article: data from a marketing data provider is aggregated by a third party, transformed by the data engineering team, and used to recommend budget shares per audience in a Power BI dashboard.

Solution in brief

Treat each AdGroup as an arm of a multi-armed bandit and run Thompson Sampling over the daily history. Each group gets a probability distribution of its target metric. Repeated random draws from those distributions turn into budget shares: the more often a group wins, the larger its share. Managers read the shares and add context.

Questions this case answers
  • How to split a fixed budget across several options with unknown payoffs while still learning about the weaker ones
  • How to decide which ad groups should get more budget when their conversion rates are unknown?
  • How to keep testing new audiences while shifting spend to the ones that already convert?
  • How to turn the output of a bandit model into budget shares that campaign managers can act on?

Tools and methods

  • Thompson Sampling — Bayesian bandit that sets each group's budget share by the chance it is the best one.
  • Multi-armed bandit — frames budget split as exploration versus exploitation.
  • Contextual bandit — decisions depend on the environment; here managers supply the context.
  • Microsoft Azure, scikit-learn, SciPy, statsmodels — cloud and modelling stack.
  • Power BI — self-service dashboard for campaign managers.
Continue reading — it's free

Google or a one-time email code. No password.