All work Retail · Data engineering

Measuring campaign lift and iROAS, and cutting the pipeline from 14 hours to 3

A weekly measurement pipeline that compares campaign-exposed customers with a held-out control group to calculate lift and incremental return on ad spend, rebuilt to run in a fraction of the time.

Our role
Pipeline engineering and technical lead for a team of three analysts
Technology
AirflowPySparkBigQueryPythonSQLTableauExcel

The challenge

Spending on a campaign is easy to measure. Knowing what the campaign caused is harder. Customers in the test group are exposed to the campaign; customers in the control group are deliberately held out. The business needed to compare the two and turn the difference into trustworthy numbers, above all lift and incremental return on ad spend (iROAS).

Measurement runs every week, reported on a weekly basis and month to date. The first version of the pipeline took 14 hours to run. A pipeline that slow limits how often results can be refreshed, makes reruns painful and pushes reporting later and later.

How it works

From audiences to lift and iROAS
How campaign impact is measuredAudiences from audience creation provide a test group exposed to the campaign and a control group held out. The pipeline compares them to calculate lift and incremental return on ad spend, rolls the results up weekly and month to date at each customer-hierarchy level, and publishes them to Tableau and Excel reports.Audiencesfrom audiencecreationTest groupexposed tothe campaignControl groupheld out(no exposure)Comparelift and iROAS:test vs controlRoll upweekly andmonth to dateReportsTableau,ExceliROAS: incremental revenue vs control, per dollar spent

Lift and iROAS come from comparing the exposed test group with the held-out control group.

Runtime before and after
Measurement pipeline runtimeThe measurement pipeline ran in 14 hours before and 3 hours after, about 79 percent shorter. Tasks that previously ran one after another now run in parallel in Airflow, and the PySpark transformations were optimized.Pipeline runtimeWhy it got fasterBefore14 hoursAfter3 hoursabout 79% shorterTasks ran one after anotherIndependent tasks run at once in AirflowPySpark transformationswere tuned to use thecluster more efficiently

Parallel tasks in Airflow and a tuned PySpark workload cut the run from 14 hours to 3.

What we built

A comparative measurement pipeline

We built a data-driven pipeline that compares the test and control groups and calculates the key metrics for campaign performance. Lift shows how much better the exposed customers did than the control group. iROAS is the headline: the revenue the campaign added beyond what the control group generated, set against what was spent.

From 14 hours to 3

The runtime fell from 14 hours to 3, roughly 79% shorter, through two changes working together.

  • Parallelism in Airflow: independent tasks that had run one after another now run at the same time.
  • Optimizations in PySpark: the heavy transformations were reworked to use the cluster more efficiently.

Weekly and month-to-date reporting

Measurement results are calculated every week, with weekly and month-to-date views, at multiple levels of the customer hierarchy. Analysts consume them in Tableau dashboards and Excel reports. A data analytics team of three kept those reports current; we led that team and made sure it had what it needed to stay on track.

New business initiatives

Beyond the core pipeline, we implemented several business initiatives on top of the measurement framework as new questions came up from the marketing organization.

How it flows

  1. Take the audiencesUse the test and control groups produced by audience creation.
  2. Compute metricsCalculate campaign performance metrics for both groups each week.
  3. CompareDerive lift and iROAS from the difference between test and control.
  4. Roll upProduce weekly and month-to-date views at each hierarchy level.
  5. ReportPublish results to Tableau dashboards and Excel reports.

What changed

  • Pipeline runtime reduced from 14 hours to 3.
  • A repeatable, weekly measurement of campaign lift and iROAS against a held-out control group.
  • Weekly and month-to-date reporting at multiple levels of the customer hierarchy.
  • A three-person analytics team led and kept on track by the engagement.

Facing something similar?

Tell us what you are building and we will say plainly whether and how we can help.

Start a conversation