I use this:
https://www.homedepot.com/p/Basement-Watchdog-Battery-Operated-Water-Alarm-BWD-HWA/100038838
The sensor is on a wire, so it can be placed exactly where you need it. The unit can then be up, where it won’t get submerged and fail and the battery can be easily replaced. The one I...