I am trying to optimize marketing spend across multiple websites i.e., Nanigans (Facebook), Google, etc, to increase customer conversion (purchasing). Each ad placement results in two things: new users signing up and purchasing and existing users seeing an ad and purchasing again.

For example, for Nanigans I might spend X for new user acquisition, Y for re-targeting, and Z for App installs. These are my input variables (Spend). My output variables are revenue that resulted from X, Y, and Z. I have daily time series data for all of the inputs and outputs across all websites. There is a catch. Advertisements meant for New User acquisition might be seen by existing customers.

What is the best statistical technique to solve this problem? How would I solve this problem in R?


This is an optimisation problem, not so much a statistical problem.

in R you can use the package lpSolve or lpSolveAPI. Also have a look at the optimization task view on CRAN. But if you are not stuck on R, you could use the solver in Excel or in libreoffice. For reasonable amounts of data these are quicker to set up and work really fast. If you need more speed in excel, then you can also use opensolver.

Looking at the time series data you have, I would just look to bring this back to hours. There is no point in optimizing per second or even minute. But I might be mistaken in that. I don't know enough about your data and needs.

  • $\begingroup$ Thanks for the reply. I looked at the package but it is not clear how one would define the objective function and constraints with respect to the question. Could you be a little bit more specific as to how you would apply the lpSolve package in this case? $\endgroup$ – Hidden Markov Model Aug 11 '15 at 7:51
  • $\begingroup$ Here is an example using lpSolveAPI. It shows how to solve the problem shown in this video on youtube. $\endgroup$ – phiver Aug 11 '15 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.