You put a cookie on their machine when they hit your website, tracking where they came from, and exactly how much you paid for that visit (because FB will give you which cohort they came from).
Then you track that to a sale, and you can determine how much you made from them.
If it is a single sale, then that's basically it (obviously you track return visitors and amortize the cost of them against that too).
If it is a SAAS, then customer value calculation is a little more complicated (you record how long people stay with you etc).
You put a cookie on their machine when they hit your website, tracking where they came from, and exactly how much you paid for that visit (because FB will give you which cohort they came from).
Then you track that to a sale, and you can determine how much you made from them.
If it is a single sale, then that's basically it (obviously you track return visitors and amortize the cost of them against that too).
If it is a SAAS, then customer value calculation is a little more complicated (you record how long people stay with you etc).
Most ecommerce platforms or marketing platforms have this setup with a click of a button. Here's a link to KissMetric's page on this: https://blog.kissmetrics.com/customer-acquisition-cost/
A16Z included this on their metrics post: https://a16z.com/2015/08/21/16-metrics/