Marketing metrics: formulas and SQL

Metrics for acquisition cost, campaign return and funnel conversion. The usual trap is mixing windows: spend from one period against customers from another.