Solved – Extracting the effect of TV ad campaign on time series with seasonality

I was wondering what would be the best way to measure the effect of a TV ad campaign on sales (phone and online) and other metrics such as website visits.

One could argue that most of the effect of the ad would be in the next few minutes/hours, but it could linger for a couple days too.


  • Let's say I have the counts of visits/ sales by period of five minutes for two years.
  • Let's say that there were two ad campaign every year and that they were lasting one month each, with multiple ads running everyday.
  • Let's say we have the date, time and channel that each ad was run.


  1. How would you measure the impact of the ads on the sales/visits assuming that there is seasonality over the year and during the day?
  2. How would we go to find on which channel/ time of day/ time of year the ads have the most impact?

There are several approaches to tackle this issue. A straightforward and easy way is by splitting the year in buckets (e.g. 4 buckets, one per season) and do the same with day (e.g. 4 buckets, morning, afternoon, evening, night). These are indicative buckets, you can make more/less buckets if you want.

Then you can create dummy variables per each bucket and apply standard OLS regression of Sales against Cost of ad for example (you can choose whatever you want here) and these dummy variables. So what you do is to control for each season/period of time.

$Y_{t} = beta_{0} + beta{1}D_{2}+ beta{2}D_{3}+ beta{3}D_{4} + epsilon$

Where $D_{k}$ corresponds to each season. As you may notice you can see that we omit $D_{1}$ as we take it as base category, so we can compare the other coefficients in relation to that one. If you included all $D_{k}$ you'd have a problem of multicollinearity.

You can find here an example of what I explained. We regress Ice cream sales against Temperature but then we control for seasonality and the effect it's clearly smaller.

$Y_{t} = beta_{0} + gamma Temp + beta{1}D_{2}+ beta{2}D_{3}+ beta{3}D_{4} + epsilon$

To know when there is a greater impact look at $beta$ coefficients.

I hope this (basic but useful) approach helps you! Example

Similar Posts:

Rate this post

Leave a Comment