2.8 fading water material

Does anyone know how to create a fading water material that changes with the depth of the liquid. I came across a cg geek tutorial of making fading water that becomes darker with increased depth, but when I recreate it in blender 2.8 it doesn’t work for some reason. This is the node setup:

This produces a a solid colour though that can be changed by changing the value of the minium math node. This is the result:

or changing the math node results in this:

I have tried other setups with glass, glossy, transparent etc. but I can’t seem to get any transparency for some reason.
Any help would be much appreciated
Thanks

If you’re using eevee, you need to enable transparency. I think it is in the material panel, not sure.

Also, I’m not sure how well glass works on eevee.

Yeah thanks for any others wondering do this:
Render - screen space reflections - on
Render - screen space reflections - refraction - on
Material - settings - screen space refraction - on