Product analytics metrics: formulas and SQL

Metrics for activity, adoption and retention. Define what counts as an active user and a session before measuring anything else.