Using a water level sensor in salt water

For my project, I need to test the water depth of a small pool, depth between 20 and 40mm. The water may be salt water or fresh, and while we have gotten the sensor to work in fresh water, it is not giving accurate values in the salt water (it gives around the same value no matter what depth). Is this a problem with the code, sensor, wiring, or something else? The sensor we are using is one of the standard ones that does with arduinos, red with three pins coming out of the top. Any help or suggestions are appreciated!

Post a link to the product page.

What reading do You get from analogRead?

Can you consider an ultrasonic or Lidar mounted in the air looking down on the water surface?

If you mean this one:

It depends on the electrical conductivity of the water. Salt water is much more conductive so you will need to re-calibrate your sensor for different water.

I doubt it will last very long in salt water