Magnet should be no more than a millimeter or so from the sensor, and both as close to the hub as you can make them. Putting it too far out will make the magnet fly past the sensor so fast that when going at higher speeds the sensor might start missing pulses.
__________________
Work: the 8 hours that separates bike rides.