Measure liquid amount from the pump

Deous:
What is the best and possibly simplest inexpensive method to measure how much liquid in mL was pumped out of the container?

Liquid has different density e.g milk, water, cleaner, alcohol etc.
System must pump out only specific amount so water flow sensors do not work.
I need a sensor with precise measurements but what sensor?
Anyone could help here?

Thanks for tips and ideas

Flow sensors measure volume flow, so why do you think water flow sensors aren't going to work?