You have to watch out for magnet polarity as in the sensor is only sensitive to either North or South. The side of the sensor is also critical for best operation.
This is how mine is mounted inside the 3D printed holder with the pull up resistor and LED to show activation. I filled that with void epoxy to keep the wires in the right place.
View attachment 26697
Here is the sensor tripping as the magnet rotates around.
View attachment 26696
And you can see here there is plenty of space to the sensor and the magnet is not that big.
View attachment 26695
I believe the one I'm using is the
Item 99K3101, 1/4" × 1/10" Rare-Earth Magnet
www.leevalley.com