ROI stands for Return On Investment, and in digital marketing we need to know the total revenue and the total cost.
\[ROI = \left( \frac{ \text{Amount Gained} - \text{Amount Spent} }{ \text{Amount Spent} } \right) \times 100\]
You can also consider ROI = Profit / Cost x 100