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.

Setup

• 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.

Questions

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?
• Is this only for 1 or more than 1 product? Is sales in units or dollars? How do you propose to deal with attribution issues? How are the ad campaigns measured? GRPs? TRPs? What does "channel" refer to? Is the marketing both online and off? – Mike Hunter Oct 31 '16 at 15:55
• * Let's go for 1 product and sales per unit. Attribution is exactly what I am trying to do here, sorry if that wasnt clear. Ads are measured as in the tv spot was aired at this time ,that time and that other time on the news channel and another time on the weather channel. Channel as in Tv channel. Let's go for ofline only, as online is easier to attribute. – Zoltan Oct 31 '16 at 16:30
• Another question: what is the unit of analysis? An individual as expressed by a credit card number? Or the transaction? If the former and assuming that multiple sales are possible over the two year span, then a hierarchical marketing mixture model is possible. If the latter, then a simpler model would be required. – Mike Hunter Oct 31 '16 at 17:10
• hi again and thanks for replying! It is a product that you subscribe to, so only one sales per customer ( unless they churn and return, but maybe we could assume they cant do that for now?). I will look up hierarchical marketing mixture, this is a completely new field for me. – Zoltan Oct 31 '16 at 21:22

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!