Obviously it will move up and down with the water level. When it reaches the bottom that will trigger your pump. As the water level rises, when it gets to the top of the switch,that will then trigger the pump to shut off.
You will need to figure out some way to mount it. Mine are mounted by a suction cup. I also have a Casing around mine to stop anything from getting in or on the switch!!
Remember, as with anything, this will require some maintenance. I take my switches out every 6 months or so and give me a good Vinegar bath to ensure they stay working properly.
Hope this helps...Shane..