Optimization of marketing investments